12 Jan 2022 |
zrsk | Thank you for the hint, I'll try. Do you know any project using flake and poetry2nix as reference? | 00:31:16 |
averagechris | zrsk: I have been packaging a few python apps as nix flakes. I'm no expert, but what's worked for me with editable installs is mkPoetryEnv as devShell instead of mkShell with the env as an input | 00:33:43 |
averagechris | here is a copy paste of an example from one of the apps I packaged last week
devShell = (pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
editablePackageSources.YOUR_APP = ./YOUR_SRC_DIR;
}).env.overrideAttrs (old: {
propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ]) ++ nativeDependencies;
shellHook = (old.shellHook or "") + ''
export GDAL_LIBRARY_PATH="${pkgs.gdal}/lib/libgdal.so"
export GEOS_LIBRARY_PATH="${pkgs.geos}/lib/libgeos_c.so"
'';
buildInputs = extraDevDependencies;
});
| 00:36:11 |
zrsk | averagechris: thank you! I'll definitely try this approach, I don't like the idea to use --impure | 00:39:17 |
averagechris | Good luck and let us know if you learn anything interesting :) | 00:39:47 |
adisbladis | In reply to @averagechris:matrix.org zrsk: I have been packaging a few python apps as nix flakes. I'm no expert, but what's worked for me with editable installs is mkPoetryEnv as devShell instead of mkShell with the env as an input I don't understand how that would work, but if it does I'm very interested in knowing more... | 00:42:56 |
averagechris | I'm using lorri that might be it? | 00:44:26 |
averagechris | so maybe I'm just slow enough so that it reevaluates everything | 00:44:47 |
adisbladis | Lorri doesn't have flakes support afaik? | 00:45:39 |
averagechris | you have to make a compatible shell.nix | 00:46:03 |
adisbladis | Right, then the evaluation model is different | 00:46:14 |
adisbladis | Flakes enforces hermetic evaluation by copying everything to the store | 00:46:35 |
adisbladis | Which changes the semantics of paths | 00:46:49 |
averagechris | ah right and so when lorri invokes the shell.nix those semantics are not in place | 00:47:23 |
averagechris | zrsk: that's important context ^ | 00:47:33 |
adisbladis | Exactamundo | 00:47:34 |
averagechris | Totally makes sense I didn't even think about that. | 00:47:54 |
| averagechris set a profile picture. | 03:00:47 |
| Jairo Llopis joined the room. | 11:53:46 |
Jairo Llopis | hello folks, I'm trying to use poetry2nix (total noob in nix, sorry) with a new project I'm developing.
it's weird that I can run this without problems:
> nix develop -c python -c 'import plumbum; print(plumbum.__file__)'
warning: Git tree '/var/home/yajo/prodevel/automirror' is dirty
/nix/store/5vnfif1w37raxbaxqn5qvpc9caqdgrkf-python3-3.9.6-env/lib/python3.9/site-packages/plumbum/__init__.py
however, when I attempt to build it, it fails:
> nix build
warning: Git tree '/var/home/yajo/prodevel/automirror' is dirty
error: --- Error -------------------------------------------------------------------------------------------------------------------------------------------------------------- nix
builder for '/nix/store/6s1kmxzh0nm65hj0zb18f1hs913szy0q-python3.9-automirror-0.0.0.drv' failed with exit code 1; last 10 log lines:
Removed build tracker: '/build/pip-req-tracker-3skg7iy7'
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/build/source/dist /build/source
Processing ./automirror-0.0.0-py3-none-any.whl
Requirement already satisfied: git-aggregator<3.0.0,>=2.1.0 in /nix/store/nv8c0dhjcqxdrr08wgp25al6qfiqs5kk-python3.9-git-aggregator-2.1.0/lib/python3.9/site-packages (from automirror==0.0.0) (2.1.0)
ERROR: Could not find a version that satisfies the requirement plumbum<2.0.0,>=1.7.2 (from automirror) (from versions: none)
ERROR: No matching distribution found for plumbum<2.0.0,>=1.7.2
of course, plumbum is in my dependencies, added with poetry add plumbum just like normal; actually there's another dependency and that one gives no problems
| 11:57:58 |
Jairo Llopis | nix shell and nix run fail with the same error as nix build ; of course I can just use nix develop for everything, but it doesn't seem extremely nice to me when not actually developing | 12:00:18 |
Jairo Llopis | any idea on how to fix it? | 12:02:29 |
Jairo Llopis | did I give enough information? | 13:20:53 |
15 Jan 2022 |
| ollijh joined the room. | 09:34:30 |
16 Jan 2022 |
| mou joined the room. | 15:01:46 |
17 Jan 2022 |
mou | Hi everyone. Thanks to all who contributed into such great tool. It works like a charm. But i encountered issue that's is quite common, according to search. Issue i encountered is related to coverage python package. Including just this package cause infinite recursion. Searching and reading bring me to workaround, by explicitly specifying setuptools-scm dependency in my poetry config.
But i would like to know is it the only way to avoid infinite recursion or there are another more elegant without polluting dependencies? Also i would like to understand what goes under the hood to produce such error, is there any explanation documented?
| 08:36:36 |
mou | * Hi everyone. Thanks to all who contributed into such great tool. It works like a charm. But i encountered issue that's is quite common, according to search. Issue i encountered is related to coverage python package. Including just this package cause infinite recursion. Searching and reading bring me to workaround, by explicitly specifying setuptools-scm dependency in my poetry config.
But i would like to know is it the only way to avoid infinite recursion or there are another more elegant ways without polluting dependencies? Also i would like to understand what goes under the hood to produce such error, is there any explanation documented?
| 08:40:01 |
| mou changed their display name from mou_bugtracker to mou. | 08:40:42 |
adisbladis | In reply to @jairo:recallstack.icu
hello folks, I'm trying to use poetry2nix (total noob in nix, sorry) with a new project I'm developing.
it's weird that I can run this without problems:
> nix develop -c python -c 'import plumbum; print(plumbum.__file__)'
warning: Git tree '/var/home/yajo/prodevel/automirror' is dirty
/nix/store/5vnfif1w37raxbaxqn5qvpc9caqdgrkf-python3-3.9.6-env/lib/python3.9/site-packages/plumbum/__init__.py
however, when I attempt to build it, it fails:
> nix build
warning: Git tree '/var/home/yajo/prodevel/automirror' is dirty
error: --- Error -------------------------------------------------------------------------------------------------------------------------------------------------------------- nix
builder for '/nix/store/6s1kmxzh0nm65hj0zb18f1hs913szy0q-python3.9-automirror-0.0.0.drv' failed with exit code 1; last 10 log lines:
Removed build tracker: '/build/pip-req-tracker-3skg7iy7'
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/build/source/dist /build/source
Processing ./automirror-0.0.0-py3-none-any.whl
Requirement already satisfied: git-aggregator<3.0.0,>=2.1.0 in /nix/store/nv8c0dhjcqxdrr08wgp25al6qfiqs5kk-python3.9-git-aggregator-2.1.0/lib/python3.9/site-packages (from automirror==0.0.0) (2.1.0)
ERROR: Could not find a version that satisfies the requirement plumbum<2.0.0,>=1.7.2 (from automirror) (from versions: none)
ERROR: No matching distribution found for plumbum<2.0.0,>=1.7.2
of course, plumbum is in my dependencies, added with poetry add plumbum just like normal; actually there's another dependency and that one gives no problems
I guess it's the same setuptools-scm problems that keeps haunting us.. You could try an override similar to https://github.com/nix-community/poetry2nix/blob/master/overrides.nix#L53-L57 | 09:28:32 |
adisbladis | In reply to @mou_bugtracker:matrix.org
Hi everyone. Thanks to all who contributed into such great tool. It works like a charm. But i encountered issue that's is quite common, according to search. Issue i encountered is related to coverage python package. Including just this package cause infinite recursion. Searching and reading bring me to workaround, by explicitly specifying setuptools-scm dependency in my poetry config.
But i would like to know is it the only way to avoid infinite recursion or there are another more elegant ways without polluting dependencies? Also i would like to understand what goes under the hood to produce such error, is there any explanation documented?
Could you give me a complete reproduction case? I could try to figure out what's going on. | 09:30:37 |