-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
buildPython*: add updateScript to passthru #50983
Conversation
updateScript = let | ||
filename = builtins.head (lib.splitString ":" self.meta.position); | ||
in writeScript "update-python" '' | ||
${update-python-libraries} ${filename} --commit |
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.
will have to disable committing in case we run concurrently with #50977
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.
I think it would be nice if update.py
handled the committing. Though in my experience git’s locking is pretty bad for things like this.
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.
Yes, I agree.
passthru = { | ||
updateScript = let | ||
filename = builtins.head (lib.splitString ":" self.meta.position); | ||
in writeScript "update-python" '' |
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.
in writeScript "update-python" '' | |
in writeScript "update-python" '' | |
#!${python.stdenv.shell} |
passthru = { | ||
updateScript = let | ||
filename = builtins.head (lib.splitString ":" self.meta.position); | ||
in writeScript "update-python" '' |
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.
With #50977 (comment), you can do
passthru = {
updateScript = let
filename = builtins.head (lib.splitString ":" self.meta.position);
in [ update-python-libraries filename "--commit" ];
};
# Commits are created sequentially. | ||
if args.commit: | ||
logging.info("Committing updates...") | ||
list(map(lambda x: _commit(**x), filter(bool, results))) |
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.
I find this easier to read:
list(map(lambda x: _commit(**x), filter(bool, results))) | |
for result in results: | |
if results: | |
_commit(**result) |
or if your really want code golfing:
list(map(lambda x: _commit(**x), filter(bool, results))) | |
[_commit(**result) for result in results if result] |
All Python packages now have an updateScript. The script calls `update-python-libraries` and passes it the position of the derivation expression obtained using `meta.position`. This works fine in case a Nix expression represents only a single derivation. If there are more in it, `update-python-libraries` will fail.
This seems to break No error is printed but if I modify the script, I can see that the
|
This pull request has been mentioned on Nix community. There might be relevant details there: https://discourse.nixos.org/t/automating-updates-of-ruby-packages/2996/2 |
All Python packages now have an updateScript. The script calls
update-python-libraries
and passes it the position of the derivationexpression obtained using
meta.position
. This works fine in case a Nixexpression represents only a single derivation. If there are more in it,
update-python-libraries
will fail.Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)