Skip to content
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

update-python-libraries: make script updateScript friendly #100268

Merged
merged 1 commit into from Oct 11, 2020

Conversation

@jonringer
Copy link
Contributor

@jonringer jonringer commented Oct 11, 2020

Motivation for this change

when using this as an updateScripts (which buildPythonPackage does by default), it will error as the script will be added to the nixstore, then executed. So instead of making assumptions about the script's location, we make the assumption that the cwd is in a valid nixpkgs repo.

follow-up to: #99635

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@jonringer jonringer requested a review from FRidh as a code owner Oct 11, 2020
@jonringer jonringer force-pushed the update-python-libraries-nixpkgs branch from bcbc436 to 2a9c3ec Oct 11, 2020
@jonringer
Copy link
Contributor Author

@jonringer jonringer commented Oct 11, 2020

tested this locally:

$ nix-shell maintainers/scripts/update.nix --argstr package python3Packages.monty
these derivations will be built:
  /nix/store/0jhzr1r3hzb8gy373c5y56dj5vzjaqvh-packages.json.drv
building '/nix/store/0jhzr1r3hzb8gy373c5y56dj5vzjaqvh-packages.json.drv'...

Going to be running update for following packages:
 - python3.8-monty-3.0.2

Press Enter key to continue...

Running update for:
 - python3.8-monty-3.0.2: UPDATING ...
 - python3.8-monty-3.0.2: DONE.

Packages updated!
$ git diff pkgs/
diff --git a/pkgs/development/python-modules/monty/default.nix b/pkgs/development/python-modules/monty/default.nix
index 77448d0e15f..28713df212c 100644
--- a/pkgs/development/python-modules/monty/default.nix
+++ b/pkgs/development/python-modules/monty/default.nix
@@ -15,7 +15,7 @@

 buildPythonPackage rec {
   pname = "monty";
-  version = "3.0.2";
+  version = "4.0.0";
   disabled = isPy27; # uses type annotations

   # No tests in Pypi
@@ -23,7 +23,7 @@ buildPythonPackage rec {
     owner = "materialsvirtuallab";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1wxqxp0j7i6czdpr2r1imgmy3qbgn2l7d4za2h1lg3hllvx6jra1";
+    sha256 = "1zc610kg528wjdm5fr8ncqwi9h8c78020ad60rvjcdk4dpl52p1i";
   };

   checkInputs = [ lsof nose numpy msgpack coverage coveralls pymongo];

@ryantm ryantm merged commit 29abb4a into NixOS:master Oct 11, 2020
19 of 20 checks passed
@jonringer jonringer deleted the update-python-libraries-nixpkgs branch Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants