[Bug 2003583] Re: Versions of the form "0.23ubuntu1" do not obey PEP440 and break current pip/setuptools

Benjamin Drung 2003583 at bugs.launchpad.net
Thu Mar 9 11:06:41 UTC 2023


This bug is a duplicate of bug #1991606 but due to bug #2008514 it runs
into a timeout when marking as duplicate. Since distro-info and
reportbug in Ubuntu 23.04 (lunar) are fixed, I am marking this bug is
fixed as well. Please follow bug #1991606 for the updates to the stable
releases.

** Changed in: reportbug (Ubuntu)
       Status: New => Fix Released

** Changed in: reportbug (Ubuntu)
   Importance: Undecided => High

** Changed in: distro-info (Ubuntu)
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to distro-info in Ubuntu.
https://bugs.launchpad.net/bugs/2003583

Title:
  Versions of the form "0.23ubuntu1" do not obey PEP440 and break
  current pip/setuptools

Status in distro-info package in Ubuntu:
  Fix Released
Status in reportbug package in Ubuntu:
  Fix Released

Bug description:
  With setuptools 66, the versions of all packages visible in the Python
  environment *must* obey PEP440 <https://peps.python.org/pep-0440/>.
  Otherwise, attempts to use pip to install a package with a setup.py-
  based build system, or other attempts to use the `pkg-resources`
  module, can produce errors like this:

    File "/builds/databiosphere/toil/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 844, in _resolve_dist
      env = Environment(self.entries)
    File "/builds/databiosphere/toil/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1044, in __init__
      self.scan(search_path)
    File "/builds/databiosphere/toil/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1077, in scan
      self.add(dist)
    File "/builds/databiosphere/toil/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1096, in add
      dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
    File "/builds/databiosphere/toil/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2631, in hashcmp
      self.parsed_version,
    File "/builds/databiosphere/toil/venv/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2678, in parsed_version
      self._parsed_version = parse_version(self.version)
    File "/builds/databiosphere/toil/venv/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 266, in __init__
      raise InvalidVersion(f"Invalid version: '{version}'")
  pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.23ubuntu1'

  The official opinion of the setuptools maintainers seems to be that
  version strings of this form haven't *really* been allowed since about
  2014, and distributions need to change their package version naming
  scheme for Python packages they install, so that the resulting version
  strings obey PEP440. See for example
  <https://github.com/pypa/setuptools/issues/3772#issuecomment-1384342813>.

  Therefore, the version of the `distro-info` package shipped in Focal
  cannot remain '0.23ubuntu1', at least as exposed to the Python
  environment in `python3-distro-info`. A new version needs to be
  released where the version string that Python code sees follows
  https://peps.python.org/pep-0440/#public-version-identifiers or
  https://peps.python.org/pep-0440/#local-version-identifiers

  Other versions of `distro-info` as shipped in other reasonably current
  Ubuntu versions would also need to be changed:

  1.1build1 in Jammy
  1.1ubuntu1 in Kinetic

  Older Ubuntu releases that are still "supported" might also need
  changes.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/distro-info/+bug/2003583/+subscriptions




More information about the foundations-bugs mailing list