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

python: add use-pkgs-prefix option to update script #83334

Merged
merged 1 commit into from Mar 27, 2020

Conversation

jonringer
Copy link
Contributor

@jonringer jonringer commented Mar 25, 2020

Motivation for this change

before the colon should specify the installable path

python: pname: ... -> pythonPackages.pname: ...

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 March 25, 2020 01:52
@jonringer
Copy link
Contributor Author

cc @FRidh

@FRidh
Copy link
Member

FRidh commented Mar 25, 2020

I use this also for applications that are not part of the package set.

@jonringer
Copy link
Contributor Author

jonringer commented Mar 25, 2020

added a opt-in switch, we may later want to make this into a switch for applications where they wouldn't have a prefix (E.g. ansible).

But, current usage looks like:

$ ./maintainers/scripts/update-python-libraries --commit --use-pkgs-prefix pkgs/development/python-modules/azure*
...
INFO:root:Finished updating packages.
INFO:root:Using pythonPackages. prefix for commits
INFO:root:Committing updates...
[update-python-script 1a6786a1d1d] pythonPackages.azure-mgmt-advisor: 3.0.0 -> 4.0.0
 1 file changed, 2 insertions(+), 2 deletions(-)
[update-python-script fae85508e54] pythonPackages.azure-mgmt-cognitiveservices: 6.0.0 -> 6.1.0
 1 file changed, 2 insertions(+), 2 deletions(-)
INFO:root:Finished committing updates
INFO:root:2 package(s) updated

@jonringer jonringer changed the title python: make update script use installable path python: add use-pkgs-prefix option to update script Mar 25, 2020
@jonringer
Copy link
Contributor Author

updated commit msg and title to reflect addition of option

@FRidh
Copy link
Member

FRidh commented Mar 25, 2020

Have not tested it, but I suppose the following still works?

$ ./maintainers/scripts/update-python-libraries --commit --use-pkgs-prefix pkgs/development/python-modules/**/default.nix

@jonringer
Copy link
Contributor Author

[17:20:02] jon@jon-desktop /home/jon/projects/nixpkgs (test-script)
$ ./maintainers/scripts/update-python-libraries --commit --use-pkgs-prefix pkgs/development/python-modules/**/default.nix
...
[update-python-script 9156f3cbad4] pythonPackages.zope.schema: 4.9.3 -> 6.0.0
 1 file changed, 2 insertions(+), 2 deletions(-)
INFO:root:Finished committing updates
INFO:root:492 package(s) updated
$ git log --oneline HEAD | head -20
9156f3cbad4 pythonPackages.zope.schema: 4.9.3 -> 6.0.0
42d7a37e52a pythonPackages.zope.proxy: 4.3.3 -> 4.3.5
3f5838aa6d9 pythonPackages.zope.interface: 4.7.1 -> 5.0.1
8ad8080368b pythonPackages.zope.i18nmessageid: 5.0.0 -> 5.0.1
7f36d871e1a pythonPackages.zope.configuration: 4.3.1 -> 4.4.0
2f78b59a302 pythonPackages.zope.component: 4.6 -> 4.6.1
2c2981cd02f pythonPackages.zipp: 0.6.0 -> 3.1.0
0c5873a9837 pythonPackages.zigpy-homeassistant: 0.11.0 -> 0.16.0
dc2449d1b3e pythonPackages.zict: 1.0.0 -> 2.0.0
fb23ecf5b3a pythonPackages.zha-quirks: 0.0.30 -> 0.0.37
f4f5ac4aa88 pythonPackages.zeroconf: 0.24.4 -> 0.24.5
23396dd6c76 pythonPackages.zarr: 2.3.2 -> 2.4.0
e87882d4d1e pythonPackages.yattag: 1.12.2 -> 1.13.2
01c225866f3 pythonPackages.yamllint: 1.20.0 -> 1.21.0
4553f72186b pythonPackages.xml2rfc: 2.37.3 -> 2.41.0
8ce3b655787 pythonPackages.xhtml2pdf: 0.2.3 -> 0.2.4
5424386a124 pythonPackages.xarray: 0.15.0 -> 0.15.1
91657568194 pythonPackages.wrapt: 1.11.2 -> 1.12.1
0d6a669fd65 pythonPackages.wptserve: 2.0 -> 3.0
5a9b924ebca pythonPackages.whisper: 1.1.6 -> 1.1.7

@jonringer
Copy link
Contributor Author

As part of my "cleanup", I changed list(map(lambda x: _commit(**x, **commit_options), results)) to map(lambda x: _commit(**x, **commit_options), results) forgetting that map produces a lazy generator. Fixed

@jonringer
Copy link
Contributor Author

cc @FRidh I think this is good to go :)

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe make it python3Packages? Hopefully more people start writing that, easier copy-pasting when invoking ofborg.

@jonringer jonringer merged commit 279438e into NixOS:master Mar 27, 2020
@jonringer jonringer deleted the update-python-script branch March 27, 2020 08:47
@jonringer
Copy link
Contributor Author

agreed about python3Packages. It's the better default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants