Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Changelog

This lists the most important changes for each release.

Unreleased
==========

Changed
-------

* Remove the upper version limits for Setuptools and ``wheel-filename``.
* Require ``wheel-filename`` 2.0 or newer.

Removed
-------

* Remove the remaining use of ``pkg_resources``.


Version 7.0.0 - 2026-02-16
==========================
Expand Down
6 changes: 3 additions & 3 deletions core-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
devpi-plumber>=0.2.14
setuptools<82 # setuptools 82 drops pkg_resources
setuptools
wheel
wheel-filename<2 # wheel-filename 2 breaks imports of InvalidFilenameError, parse_wheel_filename
wheel-inspect>=1.6.0
wheel-filename>=2.0
wheel-inspect>=1.8.0
pip>=1.5.3
junit-xml>=1.9 # First version to support to_xml_report_file
pip-requirements-parser>=32.0.1
8 changes: 4 additions & 4 deletions devpi_builder/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

import pip_requirements_parser
import pkg_resources
from packaging.utils import canonicalize_name, canonicalize_version


def _extract_project_version(requirement):
Expand Down Expand Up @@ -61,10 +61,10 @@ def matched_by_list(package, version, requirements):
:param requirements: A list of requirements as read by read_raw()
:return: True if the package can be used to fulfil on of the requirements in the file, False otherwise
"""
version = pkg_resources.safe_version('{}'.format(version))
package = pkg_resources.safe_name(package)
version = canonicalize_version('{}'.format(version))
package = canonicalize_name(package)
matches = (
package.lower() == pkg_resources.safe_name(requirement.name) and (requirement.specifier.contains(version) if requirement.specifier else 1)
package == canonicalize_name(requirement.name) and (requirement.specifier.contains(version) if requirement.specifier else True)
for requirement in requirements
)
return any(matches)
16 changes: 9 additions & 7 deletions devpi_builder/wheeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import tempfile

from packaging import tags
from pkg_resources import Distribution, Requirement
from packaging.requirements import Requirement
from packaging.utils import canonicalize_name
from wheel_filename import ParseError, WheelFilename

from wheel_filename import InvalidFilenameError, parse_wheel_filename
from wheel_inspect import inspect_wheel
from wheel_inspect.classes import WheelFile

Expand Down Expand Up @@ -52,13 +53,14 @@ def _matches_requirement(self, requirement, wheels):
:param requirement:str : The requirement to satisfy
:param wheels: List of wheels to search.
"""
req = Requirement.parse(requirement)
req = Requirement(requirement)
req_name = canonicalize_name(req.name)

matching = []
for wheel in wheels:
w = wheel.parsed_filename
dist = Distribution(project_name=self._standardize_package_name(w.project), version=w.version)
if dist in req:
name = canonicalize_name(self._standardize_package_name(w.project))
if name == req_name and req.specifier.contains(str(w.version)):
matching.append(wheel.path)
return matching

Expand Down Expand Up @@ -120,12 +122,12 @@ def is_compatible(package):
Compatibility is based on https://www.python.org/dev/peps/pep-0425/
"""
try:
w = parse_wheel_filename(package)
w = WheelFilename.parse(package)
for systag in tags.sys_tags():
for tag in w.tag_triples():
if systag in tags.parse_tag(tag):
return True
except InvalidFilenameError:
except ParseError:
return False


Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --no-emit-index-url --no-index --strip-extras --unsafe-package=pip
# pip-compile --no-emit-index-url --strip-extras --unsafe-package=pip
#
anyio==4.15.1
# via httpx
Expand Down Expand Up @@ -217,11 +217,11 @@ webob==1.8.11
# via pyramid
wheel==0.48.0
# via -r core-requirements.txt
wheel-filename==1.4.2
wheel-filename==2.1.0
# via
# -r core-requirements.txt
# wheel-inspect
wheel-inspect==1.7.2
wheel-inspect==1.8.0
# via -r core-requirements.txt
wrapt==2.5.0
# via deprecated
Expand Down
Loading