New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pythonPackages: fix nix-shell development environments #117157
Conversation
Result of 919 packages marked as broken and skipped:
1 package failed to build:21919 packages skipped due to time constraints:
235 packages built successfully:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. Result of 825 packages marked as broken and skipped:
1 package failed to build:24172 packages skipped due to time constraints:
204 packages built successfully:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
/rebase staging |
A change in setuptools v49.0.0 broke the development mode of Python packages inside nix-shell. This workaround fixes it. Closes NixOS#108525.
bb560f8
to
53737f7
Compare
Rebased, please reopen the pull request to restart CI |
# a sitecustomize.py file is a workaround for making nix-shell | ||
# environments work again. | ||
# See https://github.com/pypa/setuptools/issues/2612 | ||
cat >"$tmp_path/@pythonSitePackages@/sitecustomize.py" <<EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our interpreter comes with a sitecustomize.py
. I suppose this one could take precedence and so it works. This may stop working if we put more logic in the main one though.
I think we could use the existing sitecustomize.py
for this by just exporting
NIX_PYTHONPATH="$tmp_path/@pythonSitePackages@"
Thank you for looking into this. I've pushed 7a65bb7 to staging. Please test this. |
I tested the staging branch and the problem looks fixed. Thanks! |
A change in setuptools v49.0.0 broke the development mode of Python
packages inside nix-shell. This workaround fixes it.
Closes #108525.
Note that this change will require a rebuild of all Python packages. I only tested the change using the example described in the issue (using the sampleproject package). I'm not sure if this change will introduce a regression, so if possible hydra should check that all Python packages work ok before merging this.
Motivation for this change
Fix #108525.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)