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

pythonPackages.jenkins-job-builder: 3.0.1 -> 3.0.2 #70057

Merged
merged 3 commits into from
Oct 1, 2019

Conversation

jonringer
Copy link
Contributor

@jonringer jonringer commented Sep 30, 2019

Motivation for this change

was reviewing #69825 and noticed:

nix-shell:/home/jon/.cache/nix-review/pr-69825]$ ./results/jenkins-job-builder/bin/jenkins-jobs --help
Traceback (most recent call last):
  File "/nix/store/glxjcxidj9lkaf484kmsq9ww67r773jd-python2.7-jenkins-job-builder-3.0.2/bin/.jenkins-jobs-wrapped", line 7, in <module>
    from jenkins_jobs.cli.entry import main
  File "/nix/store/glxjcxidj9lkaf484kmsq9ww67r773jd-python2.7-jenkins-job-builder-3.0.2/lib/python2.7/site-packages/jenkins_jobs/cli/entry.py", line 21, in <module>
    from stevedore import extension
  File "/nix/store/rvbwxscav32rf453ff53586ndfiynmnc-python2.7-stevedore-1.30.1/lib/python2.7/site-packages/stevedore/__init__.py", line 11, in <module>
    from .extension import ExtensionManager
  File "/nix/store/rvbwxscav32rf453ff53586ndfiynmnc-python2.7-stevedore-1.30.1/lib/python2.7/site-packages/stevedore/extension.py", line 17, in <module>
    import pkg_resources
ImportError: No module named pkg_resources

Actions:

  • added setuptools to stevedore
  • bumped stevedore version
  • bumped jenkins-job-builder
  • added limited test to jenkins-job-builder
  • made jenkins-job-builder application use python3

closes #69825

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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.
Notify maintainers

cc @

no regressions:

[14 built, 10 copied (4.9 MiB), 2.3 MiB DL]
https://github.com/NixOS/nixpkgs/pull/70057
12 package were build:
jenkins-job-builder python27Packages.doc8 python27Packages.jenkins-job-builder python27Packages.stevedore python27Packages.subliminal python27Packages.virtualenvwrapper python37Packages.cliff python37Packages.doc8 python37Packages.optuna python37Packages.stevedore python37Packages.subliminal python37Packages.virtualenvwrapper

Sorry, something went wrong.

Jonathan Ringer added 3 commits September 30, 2019 06:29

Verified

This commit was signed with the committer’s verified signature.
wyattjoh Wyatt Johnson
@jonringer jonringer requested a review from FRidh as a code owner September 30, 2019 13:37
@jonringer jonringer changed the title Bump jenkins job pythonPackages.jenkins-job-builder: 3.0.1 -> 3.0.2 Sep 30, 2019
@teto
Copy link
Member

teto commented Oct 1, 2019

checking this as I had just finished updating stevedore locally xD

I tried running this in a nix-review


(ins)[nix-shell:~/.cache/nix-review/pr-70057]$ results/jenkins-job-builder/bin/jenkins-jobs 
Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
  File "/nix/store/wan80v555576xjj6x4idj1snycax14v0-python2.7-setuptools-41.2.0/lib/python2.7/site-packages/site.py", line 73, in <module>
    __boot()
  File "/nix/store/wan80v555576xjj6x4idj1snycax14v0-python2.7-setuptools-41.2.0/lib/python2.7/site-packages/site.py", line 26, in __boot
    import imp  # Avoid import loop in Python 3
  File "/nix/store/swy0p01xr0wyh907d67hkxr1g0kngcpn-python3-3.7.4/lib/python3.7/imp.py", line 27, in <module>
    import tokenize
  File "/nix/store/swy0p01xr0wyh907d67hkxr1g0kngcpn-python3-3.7.4/lib/python3.7/tokenize.py", line 33, in <module>
    import re
  File "/nix/store/swy0p01xr0wyh907d67hkxr1g0kngcpn-python3-3.7.4/lib/python3.7/re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

seems like this shouldn't be allowed to run with python2.

@jonringer
Copy link
Contributor Author

jonringer commented Oct 1, 2019

@teto that's not a failure, you can see that it initially calls into setuptools with python2, then tries to load a python3 library. What's going on is that nix-review dumps you into an env with all of python dependencies dumped on your PYTHONPATH. You need to do nix-shell --pure -p "with import ./nixpkgs {}; jenkins-job-builder" and you should be able to run jenkins-job-builder fine.

Since the application is wrapped, it should be fine in most scenario's. It's unfortunate that the nix-review blindly does this.

I guess another solution would be to unset PYTHONPATH. export PYTHONPATH=

@teto teto merged commit 4c70f45 into NixOS:master Oct 1, 2019
@jonringer
Copy link
Contributor Author

actually, that does work:

[nix-shell:/home/jon/.cache/nix-review/pr-70057-1]$ ./results/jenkins-job-builder/bin/jenkins-jobs --help
Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
  File "/nix/store/wan80v555576xjj6x4idj1snycax14v0-python2.7-setuptools-41.2.0/lib/python2.7/site-packages/site.py", line 73, in <module>
    __boot()
  File "/nix/store/wan80v555576xjj6x4idj1snycax14v0-python2.7-setuptools-41.2.0/lib/python2.7/site-packages/site.py", line 26, in __boot
    import imp  # Avoid import loop in Python 3
  File "/nix/store/swy0p01xr0wyh907d67hkxr1g0kngcpn-python3-3.7.4/lib/python3.7/imp.py", line 27, in <module>
    import tokenize
  File "/nix/store/swy0p01xr0wyh907d67hkxr1g0kngcpn-python3-3.7.4/lib/python3.7/tokenize.py", line 33, in <module>
    import re
  File "/nix/store/swy0p01xr0wyh907d67hkxr1g0kngcpn-python3-3.7.4/lib/python3.7/re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

[nix-shell:/home/jon/.cache/nix-review/pr-70057-1]$ unset PYTHONPATH

[nix-shell:/home/jon/.cache/nix-review/pr-70057-1]$ ./results/jenkins-job-builder/bin/jenkins-jobs --help
usage: jenkins-jobs [-h] [--conf CONF] [-l LOG_LEVEL] [--ignore-cache]
                    [--flush-cache] [--version] [--allow-empty-variables]
                    [--server SECTION] [--user USER] [--password PASSWORD]
                    {delete,delete-all,get-plugins-info,list,test,update} ...

positional arguments:
...

@jonringer jonringer deleted the bump-jenkins-job branch October 1, 2019 14:41
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