FS#68971 - [python-packaging] broken metadata produces DistributionNotFound for any program relying on it

Attached to Project: Arch Linux
Opened by Amin Vakil (aminvakil) - Monday, 14 December 2020, 10:24 GMT
Last edited by Felix Yan (felixonmars) - Tuesday, 15 December 2020, 11:48 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

ansible-lint does not work with latest upgrade on python and python-packaging.

Traceback (most recent call last):
File "/usr/bin/ansible-lint", line 33, in <module>
sys.exit(load_entry_point('ansible-lint==4.3.7', 'console_scripts', 'ansible-lint')())
File "/usr/bin/ansible-lint", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/lib/python3.9/site-packages/ansiblelint/__init__.py", line 23, in <module>
from ansiblelint.version import __version__
File "/usr/lib/python3.9/site-packages/ansiblelint/version.py", line 4, in <module>
import pkg_resources
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3239, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3222, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3251, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 567, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 884, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 770, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'packaging' distribution was not found and is required by ansible-base

Additional info:

python 3.9.1-1 (testing)
python-packaging 20.8-1 (testing)
ansible-lint 4.3.7-3 (community)

Steps to reproduce:

update to these versions, execute ansible-lint
This task depends upon

Closed by  Felix Yan (felixonmars)
Tuesday, 15 December 2020, 11:48 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-packaging 20.8-2
Comment by Chih-Hsuan Yen (yan12125) - Monday, 14 December 2020, 11:39 GMT
Assigning Felix Yan as the actual issue is in python-packaging. Since version 20.8 of packaging, setup.py is back [1], while the PKGBUILD still calls dephell to generate a setup.py file, and the latter appears broken. The issue is fixed if python-packaging is rebuilt with the dephell line in PKGBUILD is commented out.

[1] https://github.com/pypa/packaging/pull/367
Comment by Pascal Ernster (hardfalcon) - Tuesday, 15 December 2020, 00:00 GMT
The same issue with python-packaging 2.8-1 also seems to affect gajim. Downgrading to python-packaging 2.7-1 makes gajim work again as expected.
Comment by Eli Schwartz (eschwartz) - Tuesday, 15 December 2020, 00:13 GMT
  • Field changed: Attached to Project (Community Packages → Arch Linux)
  • Field changed: Summary (ansible-lint needs a specific version of python-packaging → [python-packaging] broken metadata produces DistributionNotFound for any program relying on it)
The funny thing is I cannot even replicate this with dephell myself.

But dephell is still redundant here.
Comment by Pascal Ernster (hardfalcon) - Tuesday, 15 December 2020, 00:20 GMT
Both the ansible-lint and the gajim issues are gone on my machines when I rebuild python-packaging 2.8-1 with the dephell call in the prepare() function removed from the PKGBUILD.

Thanks a lot for the valuable hint, Chih-Hsuan! :)
Comment by Amin Vakil (aminvakil) - Tuesday, 15 December 2020, 11:32 GMT
Upgrading to python-packaging 20.8-2 fixed the issue for me.

Loading...