Hi all,
when building my nix-shell environment, I found that including package pre-commit in mkShell
buildInputs
results in populated PYTHONPATH
shell environment variable, but including Poetry doesn’t. Both are Python packages and are built in very similar way. The only difference is that Poetry declares pythonNamespaces
while pre-commit doesn’t, but according my testing (trying to override pre-commit with setting pythonNamespaces) it doesn’t have any impact on resulting PYTHONPATH
.
Example:
- shell.nix with poetry:
pkgs.mkShell {
name = "xyz";
buildInputs = with pkgs; [
poetry
];
$ echo $PYTHONPATH
[NOTHING]
- shell.nix with pre-commit:
pkgs.mkShell {
name = "xyz";
buildInputs = with pkgs; [
pre-commit
];
$ echo $PYTHONPATH
/nix/store/6kcxf8w39r1gfgbssg8jwigsg4bz21xw-python3.8-pre-commit-2.11.0/lib/python3.8/site-packages:/nix/store/k0x66mivh0dmmiw68xx4qnkcakvdjcw9-python3.8-aspy.yaml-1.3.0/lib/python3.8/site-packages:/nix/store/hqfbrk1q1zjj04990r3frhnxrqb1by8g-python3.8-PyYAML-5.4.1/lib/python3.8/site-packages: ....
Thank you very much.