!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

331 Members
https://github.com/nix-community/poetry2nix63 Servers

Load older messages


SenderMessageTime
12 Jul 2022
@plato:matrix.orgplatoWhen would that be sensible in general?07:04:03
@k900:0upti.meK900Here it doesn't07:04:03
@k900:0upti.meK900Maybe if you're building some sort of plugin or wrapper tool for poetry itself07:04:15
@k900:0upti.meK900There's some discussion upstream about locking build system versions as well, but it hasn't really gone anywhere07:04:32
@plato:matrix.orgplatoAh, interesting.07:04:49
@plato:matrix.orgplatoThanks for the input, I get the problem now.07:05:38
@wildsebastian:matrix.orgwildsebastian joined the room.11:01:04
@pederbs:pvv.ntnu.nopederbs joined the room.22:55:35
13 Jul 2022
@tho_frank:matrix.orgThomas Frank joined the room.12:04:43
@tho_frank:matrix.orgThomas FrankHi there, I added an whl file as a dependency via poetry add “https://url.of/the/file.whl” That makes mkPoetryApplication fail with the error error: tarball 'https://url.of/the/file.whl' contains an unexpected number of top-level files Which comes from https://github.com/NixOS/nix/blob/d8398d33c9a09e1f5599127ae6d477e7e0868b55/src/libfetchers/tarball.cc#L148 12:13:53
14 Jul 2022
@g00pix:matrix.orgg00pix joined the room.19:25:29
@sephi:matrix.orgsephi

I’m getting a reaaaally strange thing with poetry: running poetry lock on a project empties some [metadata.files] entries, making poetry2nix then fail with error: Missing suitable source/wheel file entry for xxx:

[metadata.files]
-arrow = [
-    {file = "arrow-1.2.1-py3-none-any.whl", hash = "sha256:6b2914ef3997d1fd7b37a71ce9dd61a6e329d09e1c7b4
4f4d3099ca4a5c0933e"},
-    {file = "arrow-1.2.1.tar.gz", hash = "sha256:c2dde3c382d9f7e6922ce636bf0b318a7a853df40ecb383b29192e6
c5cc82840"},
-]
+arrow = []

Any idea what’s happening here?

20:38:47
@k900:0upti.meK900PyPI broke 20:39:42
@k900:0upti.meK900 Update to Poetry 1.1.14 20:39:45
@k900:0upti.meK900And regenerate the lockfile20:39:53
@k900:0upti.meK900 You might also need to poetry cache clear pypi --all 20:41:22
@sephi:matrix.orgsephihmmmm I’m using poetry from nixpkgs/release-22.05. Is 1.1.14 in master?20:41:43
@k900:0upti.meK900 1.1.14 should be backported to 22.05 20:41:57
@k900:0upti.meK900I think 20:42:02
@sephi:matrix.orgsephiIt looks like it’s still 1.1.12 https://github.com/NixOS/nixpkgs/blob/release-22.05/pkgs/development/python-modules/poetry/default.nix#L35 :/ I’ll use the one from master20:49:02
@sephi:matrix.orgsephiUsing 1.1.14 and clearing the cache worked, thanks!20:53:31
15 Jul 2022
@sephi:matrix.orgsephi

Now I’m getting a collision error:

error: builder for '/nix/store/hfsfhk6p3kp7cl7vrhc4a0ahnixsb5dv-python3-3.9.13-env.drv' failed with exit code 25;
       last 1 log lines:
       > error: collision between `/nix/store/fiyljlyywkmri69jvnwfkm8v8yfzpaw6-python3.9-django-3.0.14/bin/.django-admin-wrapped' and `/nix/store/9n0j67gwj13c2jfkplc524r8kqf4jnc4-python3.9-mysite-0.1.0/bin/.django-admin-wrapped'

My derivation is really basic:

  server = poetry2nix.mkPoetryApplication {
    projectDir = ./.;
    python = python39;
  };

As soon as I’m using server.dependencyEnv in a systemd unit I’m getting the collision error. Using just server works (I guess because it doesn’t include any binaries).

Is there a way to tell nix to not try to add the bin directory to the path?

09:22:57
@sephi:matrix.orgsephi I ended up using server.dependencyEnv.overrideAttrs (_: { pathsToLink = [ "/lib" ]; }) and it worked (I also tried pathsToLink = [ ] but the lib directory was missing in the environment, I’m not sure why) 10:55:34
16 Jul 2022
@adis:blad.isadisbladis
In reply to @k900:0upti.me
1.1.14 should be backported to 22.05
It was backported already
08:48:29
@worldofgeese:one.ems.hostworldofgeeseMaybe a dumb question but if you're using direnv for virtual environments and just using Poetry for the binary output of your program and not anything of the poetry run, shell "baggage" is the appropriate thing to do to put all your development dependencies into your devShell?11:08:13
@k900:0upti.meK900 You can use mkPoetryEnv as your devShell 11:08:53
@worldofgeese:one.ems.hostworldofgeeseOr what's best practice? Because I've found with direnv and then a poetry shell my terminal session turns into hieroglyphics11:08:59
@worldofgeese:one.ems.hostworldofgeese K900: and then just skip any of poetry's own commands, right? 11:10:25
@k900:0upti.meK900What commands?11:10:33
@worldofgeese:one.ems.hostworldofgeeseWell poetry run and shell11:10:41

Show newer messages


Back to Room ListRoom Version: 6