Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 878151 - dev-python/pyjwt-2.5.0: requires non-existing `types-cryptography` when imported with extras==crypto
Summary: dev-python/pyjwt-2.5.0: requires non-existing `types-cryptography` when impor...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-24 10:06 UTC by Osiris
Modified: 2022-10-24 14:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Osiris 2022-10-24 10:06:48 UTC
In version 2.5.0 of `dev-python/pyjwt`, upstream decided it would be a good idea to have a dependency on the `types-cryptography` module when the package was imported with the `crypto` extras enabled (https://github.com/jpadilla/pyjwt/pull/784). On Gentoo, this results in a `DistributionNotFound` error when `pkg_resources` from `setuptools` is being used to import the PyJWT module with `extras==crypto`:

```
Python 3.10.8 (main, Oct 23 2022, 21:44:41) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> __requires__ = ["PyJWT[crypto]"]
>>> import pkg_resources
  warnings.warn(
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3260, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 909, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 795, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'types-cryptography>=3.3.21; extra == "crypto"' distribution was not found and is required by PyJWT
>>> 
```

As `cryptography` was typed in more recent versions than 3.3.21 and this dependency on `types-cryptography` lead to all kinds of problems, an issue was raised upstream (https://github.com/jpadilla/pyjwt/issues/804) and consequently fixed in version 2.6.0 (https://github.com/jpadilla/pyjwt/pull/805).

However, `dev-python/pyjwt-2.6.0` is currently marked as unstable and stable version 2.5.0 is not working in some situations.