| 12 Jul 2022 |
plato | When would that be sensible in general? | 07:04:03 |
K900 | Here it doesn't | 07:04:03 |
K900 | Maybe if you're building some sort of plugin or wrapper tool for poetry itself | 07:04:15 |
K900 | There's some discussion upstream about locking build system versions as well, but it hasn't really gone anywhere | 07:04:32 |
plato | Ah, interesting. | 07:04:49 |
plato | Thanks for the input, I get the problem now. | 07:05:38 |
| wildsebastian joined the room. | 11:01:04 |
| pederbs joined the room. | 22:55:35 |
| 13 Jul 2022 |
| Thomas Frank joined the room. | 12:04:43 |
Thomas Frank | Hi 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 joined the room. | 19:25:29 |
sephi | 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 | PyPI broke | 20:39:42 |
K900 | Update to Poetry 1.1.14 | 20:39:45 |
K900 | And regenerate the lockfile | 20:39:53 |
K900 | You might also need to poetry cache clear pypi --all | 20:41:22 |
sephi | hmmmm I’m using poetry from nixpkgs/release-22.05. Is 1.1.14 in master? | 20:41:43 |
K900 | 1.1.14 should be backported to 22.05 | 20:41:57 |
K900 | I think | 20:42:02 |
sephi | It 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 master | 20:49:02 |
sephi | Using 1.1.14 and clearing the cache worked, thanks! | 20:53:31 |
| 15 Jul 2022 |
sephi | 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 | 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 |
adisbladis | In reply to @k900:0upti.me 1.1.14 should be backported to 22.05 It was backported already | 08:48:29 |
worldofgeese | Maybe 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 | You can use mkPoetryEnv as your devShell | 11:08:53 |
worldofgeese | Or what's best practice? Because I've found with direnv and then a poetry shell my terminal session turns into hieroglyphics | 11:08:59 |
worldofgeese | K900: and then just skip any of poetry's own commands, right? | 11:10:25 |
K900 | What commands? | 11:10:33 |
worldofgeese | Well poetry run and shell | 11:10:41 |