Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 696224

Summary: dev-python/cryptography should depend on dev-python/cffi - pkg_resources.DistributionNotFound: The 'cffi!=1.11.3,>=1.8' distribution was not found and is required by cryptography
Product: Gentoo Linux Reporter: Nuno <can.ecodo.nu.n.o+bugs.gentoo>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: mattst88
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Nuno 2019-10-04 15:19:44 UTC
Currently, dev-python/cryptography only has a DEPEND on dev-python/cffi.
However, it needs it on runtime.

For example, here's certbot trying to use cryptography without dev-python/cffi installed (dev-python/cryptography was installed as a binary package and therefore did not pull in cffi):


host ~ # certbot certificates
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.6/certbot", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
    @_call_aside
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 784, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'cffi!=1.11.3,>=1.8' distribution was not found and is required by cryptography


Manually installing dev-python/cffi words solves the issue.


Using:
- dev-python/cryptography-2.6.1 (also checked 2.7)
- dev-python/cffi-1.11.4
- app-crypt/certbot-0.38.0
Comment 1 Matt Turner gentoo-dev 2019-12-07 16:24:59 UTC
Seems like cffi should be listed in cryptography's RDEPEND, not just in DEPEND.
Comment 2 Larry the Git Cow gentoo-dev 2020-01-09 18:04:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=484ac3d510a71d0c47a2841d06dd79cb5a34b202

commit 484ac3d510a71d0c47a2841d06dd79cb5a34b202
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-01-09 18:03:32 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-01-09 18:04:14 +0000

    dev-python/cryptography: add cffi to RDEPEND
    
    cryptography installs egg-info/requires.txt containing cffi. This means
    packages using pkg_resources to import cryptography will fail if cffi is not
    installed at runtime.
    
    Closes: https://bugs.gentoo.org/696224
    Package-Manager: Portage-2.3.84_p2, Repoman-2.3.20_p24
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../{cryptography-2.6.1.ebuild => cryptography-2.6.1-r1.ebuild}       | 4 ++--
 .../{cryptography-2.8.ebuild => cryptography-2.8-r1.ebuild}           | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)