Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2162667

Summary: scapy version doesn't comply with pep-0440: Invalid version: 'git-archive.dev95ba5b8504'
Product: Red Hat Enterprise Linux 9 Reporter: Flavio Leitner <fleitner>
Component: scapyAssignee: Andrea Claudi <aclaudi>
Status: CLOSED ERRATA QA Contact: Li Shuang <shuali>
Severity: high Docs Contact:
Priority: high    
Version: CentOS StreamCC: bstinson, i.maximets, jwboyer, rjarry, shuali
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: scapy-2.5.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:35:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Flavio Leitner 2023-01-20 12:42:06 UTC
The current scapy version uses dash '-' in its version which doesn't comply with https://peps.python.org/pep-0440/ and that breaks any python project using setuptools.

See the example below:
01:13:09 + git clone https://github.com/chaudron/XenaPythonLib.git /ovsci/xena
01:13:09 Cloning into '/ovsci/xena'...
01:13:09 + cd /ovsci/xena
01:13:09 + python3 setup.py install
01:13:09 Traceback (most recent call last):
01:13:09   File "/ovsci/xena/setup.py", line 3, in <module>
01:13:09     setup(name='xenalib-python',
01:13:09   File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 86, in setup
01:13:09     _install_setup_requires(attrs)
01:13:09   File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
01:13:09     dist.fetch_build_eggs(dist.setup_requires)
01:13:09   File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 874, in fetch_build_eggs
01:13:09     resolved_dists = pkg_resources.working_set.resolve(
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 815, in resolve
01:13:09     dist = self._resolve_dist(
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 844, in _resolve_dist
01:13:09     env = Environment(self.entries)
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1044, in __init__
01:13:09     self.scan(search_path)
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1077, in scan
01:13:09     self.add(dist)
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1096, in add
01:13:09     dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2631, in hashcmp
01:13:09     self.parsed_version,
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2678, in parsed_version
01:13:09     self._parsed_version = parse_version(self.version)
01:13:09   File "/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 266, in __init__
01:13:09     raise InvalidVersion(f"Invalid version: '{version}'")
01:13:09 pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: 'git-archive.dev95ba5b8504'


[root@wsfd-advnetlab71 ~]# rpm -ql python3-scapy-2.4.4-5.el9.noarch  | grep git
/usr/lib/python3.9/site-packages/scapy-git_archive.dev95ba5b8504-py3.9.egg-info
/usr/lib/python3.9/site-packages/scapy-git_archive.dev95ba5b8504-py3.9.egg-info/PKG-INFO
/usr/lib/python3.9/site-packages/scapy-git_archive.dev95ba5b8504-py3.9.egg-info/SOURCES.txt
/usr/lib/python3.9/site-packages/scapy-git_archive.dev95ba5b8504-py3.9.egg-info/dependency_links.txt
/usr/lib/python3.9/site-packages/scapy-git_archive.dev95ba5b8504-py3.9.egg-info/entry_points.txt
/usr/lib/python3.9/site-packages/scapy-git_archive.dev95ba5b8504-py3.9.egg-info/not-zip-safe
/usr/lib/python3.9/site-packages/scapy-git_archive.dev95ba5b8504-py3.9.egg-info/top_level.txt
[root@wsfd-advnetlab71 ~]# rpm -q --provides python3-scapy-2.4.4-5.el9.noarch | grep git-
python3.9dist(scapy) = git-archive.dev95ba5b8504
python3dist(scapy) = git-archive.dev95ba5b8504

Comment 1 Robin Jarry 2023-01-20 12:44:13 UTC
I am working on an upstream patch to allow forcing a version when doing downstream packaging from a non-tagged git archive. I'll update this BZ when ready.

Comment 2 Andrea Claudi 2023-01-20 13:14:23 UTC
Thanks Robin. Let me know when you're done, so I can backport your fix to the RHEL package.

Comment 3 Robin Jarry 2023-01-20 16:16:06 UTC
Here's the pull request: https://github.com/secdev/scapy/pull/3862

Comment 4 Robin Jarry 2023-02-14 21:10:27 UTC
Hi Andrea. The fix was applied upstream. Let me know if I can help with the RHEL package.

Comment 12 errata-xmlrpc 2023-11-07 08:35:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (scapy bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6511