Poetry2nix | 313 Members | |
| https://github.com/nix-community/poetry2nix | 58 Servers |
| Sender | Message | Time |
|---|---|---|
| 23 Jan 2022 | ||
| I have a question, does poetry2nix use nixpkgs to download ANY of the python packages defined in poetry.lock or does it build all from source? | 15:24:09 | |
| It does, but exact cache hits are rare | 15:30:22 | |
| So you'll end up building most things from source | 15:30:44 | |
| Okay thanks! So if you create a default.nix for nixpkgs and submit it, then want to use that same package from poetry2nix you will probably have to redefine some build steps and dependencies twice for a complicated package? | 15:39:35 | |
| No | 15:39:58 | |
| poetry2nix will use the package definitions from nixpkgs | 15:40:13 | |
| But the build environment is slightly different usually, so you'll get rebuuldsn | 15:40:38 | |
| * But the build environment is slightly different usually, so you'll get rebuilds | 15:40:45 | |
| Ah okay, rebuilds are of course fine. Will it use the definition if the version for the package is different? | 15:41:52 | |
| Yes | 15:42:00 | |
| looks like i almost get my first working flake with dev environment but ended up with code duplication to solve external library build dependency on poetry. And i can not think of good solution to extract duplication. Maybe anybody can suggest good idiomatic solution?
| 15:43:35 | |
| * looks like i almost get my first working flake with dev environment but ended up with code duplication to solve external library build dependency on poetry. And i can not think of good solution to extract duplication. Maybe anybody can suggest good idiomatic solution?
| 15:43:57 | |
| Duplication is because i need override in mkPoetryApplication and in mkPoetryEnv | 15:44:29 | |
| * Duplication occurred because i need override in mkPoetryApplication and in mkPoetryEnv | 15:44:56 | |
| Is there a way of overriding the package version specified by poetry and just using whatever is defined in nixpkgs instead? The command I'm imagining might naively look like this:
| 16:18:23 | |
| Why do you want that? | 16:18:40 | |
| because the poetry build breaks | 16:18:56 | |
| Breaks how exactly? | 16:19:20 | |
| it builds fine, then at runtime I get this It looks like there's some build logic in https://github.com/NixOS/nixpkgs/blob/nixos-21.11/pkgs/development/python-modules/debugpy/default.nix to create the missing file. I tried adding the preBuild to my overrides:
but then I just get a different runtime error Since it's a dev dependency I figured it might be simpler to just use the nix packaged version entirely? | 16:22:32 | |
| But perhaps there an alternative to this which just involves adding the correct overrides? | 16:43:51 | |
| Redacted or Malformed Event | 16:57:44 | |
In reply to @k900:0upti.meI made direnv flawlessly works with my flake in console. But in PyCharm even if force reimport of direnv, nothing happened. It does not detect python in Add interpreter dialog, nor poetry. Can not find any information on how to use this plugin and what effects to expect from it. | 16:58:11 | |
In reply to @k900:0upti.me* I made direnv flawlessly works with my flake in console. But in PyCharm even if force reimport of direnv, nothing happens. It does not detect python in Add interpreter dialog, nor poetry. Can not find any information on how to use this plugin and what effects to expect from it. | 16:58:31 | |
| It shouldn't be using Poetry, you should be able to just set it to the interpreter set in your Nix environment | 16:59:00 | |
You can find out the path with which python | 16:59:06 | |
| It is somewhat annoying | 16:59:10 | |
| Now i understand. So if my env will change path (due to any changes in attributes), i should update my interpreter settings manually? I think i'ts ok for the start. | 17:01:42 | |
Does poetry2nix respect interpreter version specification from pyproject.toml? | 18:22:41 | |
or should i specify it in mkPoetryApplication? | 18:23:39 | |
I've confirmed that a poetry2nix build with just the debugpy package experiences errors, and that a shell.nix python environment with just this package does not. Is it ok if I open an issue on the repo for this? | 19:56:07 | |