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

python2Packages.PyJWT fails to build #121883

Closed
lapp0 opened this issue May 6, 2021 · 7 comments · Fixed by #122142
Closed

python2Packages.PyJWT fails to build #121883

lapp0 opened this issue May 6, 2021 · 7 comments · Fixed by #122142

Comments

@lapp0
Copy link

lapp0 commented May 6, 2021

Describe the bug
python2Packages.PyJWT fails to build since it was upgraded to 2.0.1 in this change.

I ran into this issue trying to build nixops, logs in the following section.

To Reproduce
Either

nix-shell -p nixops

or

nix-shell -p python2Packages.pyjwt

these derivations will be built:
  /nix/store/1sil47bdavwacfanpqlpw2dlpprpxb09-python2.7-PyJWT-2.0.1.drv
building '/nix/store/1sil47bdavwacfanpqlpw2dlpprpxb09-python2.7-PyJWT-2.0.1.drv'...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing setuptools-check-hook
unpacking sources
unpacking source archive /nix/store/w1zbzlnx1dwcd2pvg5094550iljjmrai-PyJWT-2.0.1.tar.gz
source root is PyJWT-2.0.1
setting SOURCE_DATE_EPOCH to timestamp 1610906219 of file PyJWT-2.0.1/setup.cfg
patching sources
substituteStream(): WARNING: pattern 'pytest>=4.0.1,<5.0.0' doesn't match anything in file 'setup.py'
configuring
no configure script, doing nothing
building
Executing setuptoolsBuildPhase
Traceback (most recent call last):
  File "nix_run_setup", line 8, in <module>
    exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
  File "setup.py", line 5, in <module>
    setup()
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/nix/store/r8xqa85n5m0xg7p6rymwh0ldzf0h5wqv-python-2.7.18/lib/python2.7/distutils/core.py", line 124, in setup
    dist.parse_config_files()
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/dist.py", line 702, in parse_config_files
    ignore_option_errors=ignore_option_errors)
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/config.py", line 121, in parse_configuration
    meta.parse()
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/config.py", line 426, in parse
    section_parser_method(section_options)
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/config.py", line 399, in parse_section
    self[name] = value
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/config.py", line 184, in __setitem__
    value = parser(value)
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/config.py", line 515, in _parse_version
    version = self._parse_attr(value, self.package_dir)
  File "/nix/store/8yqk17gg1594prmi5hi5ggm9ifr8l4cx-python2.7-setuptools-44.0.0/lib/python2.7/site-packages/setuptools/config.py", line 350, in _parse_attr
    value = getattr(module, attr_name)
AttributeError: 'module' object has no attribute '__version__'
builder for '/nix/store/1sil47bdavwacfanpqlpw2dlpprpxb09-python2.7-PyJWT-2.0.1.drv' failed with exit code 1
error: build of '/nix/store/1sil47bdavwacfanpqlpw2dlpprpxb09-python2.7-PyJWT-2.0.1.drv' failed

Additional context
python2Packages.PyJWT is used by a variety of packages including conan (fixed here via an override).

Notify maintainers
@prikhi

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.22, NixOS, 20.09.git.b82a99fd5d9 (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.10`
 - channels(andrew): `"nixos-20.09.1599.d105075a1fd"`
 - nixpkgs: `/etc/nixos/nixpkgs`

Because multiple packages use python2 and depend on PyJWT, perhaps rather than writing an override for each package depending on it, python2Packages.PyJWT should use a different version than in python3?

Slightly related NixOS/nixops#504

@fabaff
Copy link
Member

fabaff commented May 6, 2021

PyJTW > 2.0.0 doesn't support Python 2 any more.

@fabaff
Copy link
Member

fabaff commented May 6, 2021

Because multiple packages use python2 and depend on PyJWT

About how many packages are we talking here. I guess that there are 20-25 packages in total which depend on PyJWT but not many that are still supporting Python 2.

@dotlambda
Copy link
Member

@NixOS/nixops-committers Someone will have to package a Python 2 version of PyJWT.

@lapp0
Copy link
Author

lapp0 commented May 6, 2021

I'm not sure how many depend on python2 PyJWT. Ideally unsupported versions of python are phased out.

I'm a bit confused here, this comment from April 2020 said nixops is python3 only NixOS/nixops#504 (comment)

However,

nix-store -q --referrers /nix/store/1sil47bdavwacfanpqlpw2dlpprpxb09-python2.7-PyJWT-2.0.1.drv

/nix/store/7n78bd1zqazqiq9x0my2x8l5xjg46sq1-shell.drv
/nix/store/9hkzmbmy7vlvrk50rv0iwigxkal3wrcb-python2.7-adal-1.2.6.drv
nix-store -q --referrers /nix/store/9hkzmbmy7vlvrk50rv0iwigxkal3wrcb-python2.7-adal-1.2.6.drv

/nix/store/bzjrqiwsdz9is1xkwq5n3vd45ch1fldb-nixops-1.7.drv

Is the actual bug that nixops depends on python2 adal when it shouldn't?

@dotlambda
Copy link
Member

Is the actual bug that nixops depends on python2 adal when it shouldn't?

No, nixops refers to version 1.7 which uses Python 2 while nixopsUnstable refers to version 2.0 which uses Python 3.

@lapp0
Copy link
Author

lapp0 commented May 6, 2021

Thanks! Seems like they're quite close to 2.0's release. NixOS/nixops#1242

@mweinelt
Copy link
Member

mweinelt commented May 8, 2021

Fixed in #122142.

@mweinelt mweinelt linked a pull request May 8, 2021 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants