Skip to content

Commit d69bf04

Browse files
committed
Merge failing test into fix_msvc_host_dir_arm64.
2 parents e1d81b8 + 0a4f350 commit d69bf04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+4590
-3390
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 75.6.0
2+
current_version = 76.0.0
33
commit = True
44
tag = True
55

.github/dependabot.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,29 @@ jobs:
6363
- platform: ubuntu-latest
6464
python: "3.10"
6565
distutils: stdlib
66-
# TODO: Re-evaluate the need for the following workaround
67-
exclude:
68-
- {python: "3.9", platform: "macos-latest"} # actions/setup-python#981
6966
runs-on: ${{ matrix.platform }}
7067
continue-on-error: ${{ matrix.python == '3.14' }}
7168
env:
7269
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils || 'local' }}
7370
timeout-minutes: 75
7471
steps:
7572
- uses: actions/checkout@v4
73+
- name: Install build dependencies
74+
# Install dependencies for building packages on pre-release Pythons
75+
# jaraco/skeleton#161
76+
if: matrix.python == '3.14' && matrix.platform == 'ubuntu-latest'
77+
run: |
78+
sudo apt update
79+
sudo apt install -y libxml2-dev libxslt-dev
7680
- name: Setup Python
7781
id: python-install
7882
uses: actions/setup-python@v5
7983
with:
8084
python-version: ${{ matrix.python }}
8185
allow-prereleases: true
86+
env:
87+
# Workaround for actions/setup-python#981 (env var only modified for this specific step)
88+
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.platform == 'macos-latest' && matrix.python == '3.9' && 'stdlib' || matrix.distutils || 'local' }}
8289
- uses: actions/cache@v4
8390
id: cache
8491
with:
@@ -90,6 +97,10 @@ jobs:
9097
if: steps.cache.outputs.cache-hit != 'true'
9198
working-directory: setuptools/tests/config
9299
run: python -m downloads.preload setupcfg_examples.txt
100+
- name: Adjust env vars
101+
shell: bash
102+
run: |
103+
echo 'PIPX_DEFAULT_PYTHON=${{ steps.python-install.outputs.python-path }}' >> $GITHUB_ENV
93104
- name: Pre-build distributions for test
94105
shell: bash
95106
run: |
@@ -178,7 +189,7 @@ jobs:
178189
packages: >-
179190
python${{ matrix.python }},
180191
python${{ matrix.python }}-devel,
181-
python${{ matrix.python }}-tox,
192+
python${{ matrix.python }}-pip,
182193
gcc-core,
183194
git,
184195
- name: Record the currently selected Python version
@@ -189,11 +200,17 @@ jobs:
189200
run: |
190201
python -c 'import platform; print("python-version=" + platform.python_version())' >> ${GITHUB_OUTPUT}
191202
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
203+
- name: Install tox using pip
204+
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
205+
run: |
206+
# Workaround for https://github.com/pypa/setuptools/issues/4831
207+
python -m pip install tox
192208
- name: Run tests
193209
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
194210
run: |
195-
git config --global --add safe.directory "$(cygpath -u "$GITHUB_WORKSPACE")" # workaround for #3408
196-
tox
211+
git config --global --add safe.directory "$(cygpath -u "${{ github.workspace }}")" # workaround for #3408
212+
echo "$(cygpath -u "${{ github.workspace }}")" # for debugging purposes
213+
python -m tox
197214
- name: Create coverage report
198215
if: hashFiles('.coverage') != '' # Rudimentary `file.exists()`
199216
run: |

.readthedocs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ python:
55
extra_requirements:
66
- doc
77

8+
sphinx:
9+
configuration: docs/conf.py
10+
811
# required boilerplate readthedocs/readthedocs.org#10401
912
build:
1013
os: ubuntu-lts-latest

NEWS.rst

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1+
v75.3.2
2+
=======
3+
4+
- Fixed version error in changelog.
5+
6+
7+
v75.3.1
8+
=======
9+
10+
Bugfixes
11+
--------
12+
13+
- Fix wheel file naming to follow binary distribution specification -- by :user:`di` (#4877)
14+
15+
16+
v76.0.0
17+
=======
18+
19+
Deprecations and Removals
20+
-------------------------
21+
22+
- Synced with pypa/distutils@5589d7527 including a simplified shebang generation when building scripts (#4863). (#4865)
23+
24+
25+
v75.9.1
26+
=======
27+
28+
Bugfixes
29+
--------
30+
31+
- Fix ImportError in distutils when configuring for linking. (#4866)
32+
33+
34+
v75.9.0
35+
=======
36+
37+
Features
38+
--------
39+
40+
- Synced with pypa/distutils@91f75bb98 including exporting of PyInit_pkg (pypa/distutils#327) and a refactoring of the compiler classes into distutils.compilers (pypa/distutils#295). (#4852)
41+
42+
43+
v75.8.2
44+
=======
45+
46+
Bugfixes
47+
--------
48+
49+
- Fixed ``pkg_resources.require(...)`` to also consider standardised
50+
``dist-info`` directories. (#4856)
51+
52+
53+
v75.8.1
54+
=======
55+
56+
Bugfixes
57+
--------
58+
59+
- Fix wheel file naming to follow binary distribution specification -- by :user:`di` (#4766)
60+
- Fixed crash generating error message printed when building wheels for the
61+
free-threaded build using the limited API. -- by :user:`ngoldbaum` (#4809)
62+
- Fix documentation for recent CFLAGS distutils change. -- by :user:`thesamesam` (#4836)
63+
64+
65+
v75.8.0
66+
=======
67+
68+
Features
69+
--------
70+
71+
- Implemented ``Dynamic`` field for core metadata (as introduced in PEP 643).
72+
The existing implementation is currently experimental and the exact approach
73+
may change in future releases. (#4698)
74+
75+
76+
v75.7.0
77+
=======
78+
79+
Features
80+
--------
81+
82+
- Synced with pypa/distutils@c97a3db2f including better support for free threaded Python on Windows (pypa/distutils#310), improved typing support, and linter accommodations. (#4478)
83+
- Synced with pypa/distutils@ff11eed0c including bugfix for duplicate CFLAGS and adaption to support Python 3.13 is_abs in the C compiler (#4669). (#4790)
84+
85+
186
v75.6.0
287
=======
388

@@ -599,7 +684,7 @@ Bugfixes
599684
--------
600685

601686
- In tests, rely on pytest-home for reusable fixture. (#4072)
602-
- Explicitely marked as ``Protocol`` and fixed missing ``self`` argument in interfaces ``pkg_resources.IMetadataProvider`` and ``pkg_resources.IResourceProvider`` -- by :user:`Avasam` (#4144)
687+
- Explicitly marked as ``Protocol`` and fixed missing ``self`` argument in interfaces ``pkg_resources.IMetadataProvider`` and ``pkg_resources.IResourceProvider`` -- by :user:`Avasam` (#4144)
603688
- Restored expectation that egg-link files would be named with dash separators for compatibility with pip prior to version 24. (#4167)
604689

605690

@@ -7130,7 +7215,7 @@ setuptools
71307215

71317216
* Fixed invalid URL error catching. Old Setuptools #20.
71327217

7133-
* Fixed invalid bootstraping with easy_install installation (Distribute #40).
7218+
* Fixed invalid bootstrapping with easy_install installation (Distribute #40).
71347219
Thanks to Florian Schulze for the help.
71357220

71367221
* Removed buildout/bootstrap.py. A new repository will create a specific

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
.. |docs-badge| image:: https://img.shields.io/readthedocs/setuptools/latest.svg
1515
:target: https://setuptools.pypa.io
1616

17-
.. |skeleton-badge| image:: https://img.shields.io/badge/skeleton-2024-informational
17+
.. |skeleton-badge| image:: https://img.shields.io/badge/skeleton-2025-informational
1818
:target: https://blog.jaraco.com/skeleton
1919

2020
.. |codecov-badge| image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@
136136
"color-brand-primary": "#E5B62F", # "yellow"
137137
"color-brand-content": "#E5B62F",
138138
},
139+
"source_repository": "https://github.com/pypa/setuptools/",
140+
"source_branch": "main",
141+
"source_directory": "docs/",
139142
}
140143

141144
# Redirect old docs so links and references in the ecosystem don't break

docs/userguide/ext_modules.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ The compiler options appear in the command line in the following order:
110110

111111
.. Reference: "compiler_so" and distutils.ccompiler.gen_preprocess_options, CCompiler.compile, UnixCCompiler._compile
112112
113-
* first, the options provided by the ``sysconfig`` variable ``CFLAGS``,
114-
* then, the options provided by the environment variables ``CFLAGS`` and ``CPPFLAGS``,
113+
* first, the options provided by the environment variables ``CFLAGS`` and ``CPPFLAGS``,
115114
* then, the options provided by the ``sysconfig`` variable ``CCSHARED``,
116115
* then, a ``-I`` option for each element of ``Extension.include_dirs``,
117116
* finally, the options provided by ``Extension.extra_compile_args``.

newsfragments/4478.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

pkg_resources/__init__.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -708,14 +708,19 @@ def find(self, req: Requirement) -> Distribution | None:
708708
If there is no active distribution for the requested project, ``None``
709709
is returned.
710710
"""
711-
dist = self.by_key.get(req.key)
711+
dist: Distribution | None = None
712712

713-
if dist is None:
714-
canonical_key = self.normalized_to_canonical_keys.get(req.key)
713+
candidates = (
714+
req.key,
715+
self.normalized_to_canonical_keys.get(req.key),
716+
safe_name(req.key).replace(".", "-"),
717+
)
715718

716-
if canonical_key is not None:
717-
req.key = canonical_key
718-
dist = self.by_key.get(canonical_key)
719+
for candidate in filter(None, candidates):
720+
dist = self.by_key.get(candidate)
721+
if dist:
722+
req.key = candidate
723+
break
719724

720725
if dist is not None and dist not in req:
721726
# XXX add more info
@@ -873,9 +878,7 @@ def resolve(
873878

874879
# Mapping of requirement to set of distributions that required it;
875880
# useful for reporting info about conflicts.
876-
required_by: collections.defaultdict[Requirement, set[str]] = (
877-
collections.defaultdict(set)
878-
)
881+
required_by = collections.defaultdict[Requirement, set[str]](set)
879882

880883
while requirements:
881884
# process dependencies breadth-first

pkg_resources/tests/test_pkg_resources.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import builtins
44
import datetime
5+
import inspect
56
import os
67
import plistlib
78
import stat
@@ -425,3 +426,60 @@ def test_normalize_path_backslash_sep(self, unnormalized, expected):
425426
"""Ensure path seps are cleaned on backslash path sep systems."""
426427
result = pkg_resources.normalize_path(unnormalized)
427428
assert result.endswith(expected)
429+
430+
431+
class TestWorkdirRequire:
432+
def fake_site_packages(self, tmp_path, monkeypatch, dist_files):
433+
site_packages = tmp_path / "site-packages"
434+
site_packages.mkdir()
435+
for file, content in self.FILES.items():
436+
path = site_packages / file
437+
path.parent.mkdir(exist_ok=True, parents=True)
438+
path.write_text(inspect.cleandoc(content), encoding="utf-8")
439+
440+
monkeypatch.setattr(sys, "path", [site_packages])
441+
return os.fspath(site_packages)
442+
443+
FILES = {
444+
"pkg1_mod-1.2.3.dist-info/METADATA": """
445+
Metadata-Version: 2.4
446+
Name: pkg1.mod
447+
Version: 1.2.3
448+
""",
449+
"pkg2.mod-0.42.dist-info/METADATA": """
450+
Metadata-Version: 2.1
451+
Name: pkg2.mod
452+
Version: 0.42
453+
""",
454+
"pkg3_mod.egg-info/PKG-INFO": """
455+
Name: pkg3.mod
456+
Version: 1.2.3.4
457+
""",
458+
"pkg4.mod.egg-info/PKG-INFO": """
459+
Name: pkg4.mod
460+
Version: 0.42.1
461+
""",
462+
}
463+
464+
@pytest.mark.parametrize(
465+
("version", "requirement"),
466+
[
467+
("1.2.3", "pkg1.mod>=1"),
468+
("0.42", "pkg2.mod>=0.4"),
469+
("1.2.3.4", "pkg3.mod<=2"),
470+
("0.42.1", "pkg4.mod>0.2,<1"),
471+
],
472+
)
473+
def test_require_non_normalised_name(
474+
self, tmp_path, monkeypatch, version, requirement
475+
):
476+
# https://github.com/pypa/setuptools/issues/4853
477+
site_packages = self.fake_site_packages(tmp_path, monkeypatch, self.FILES)
478+
ws = pkg_resources.WorkingSet([site_packages])
479+
480+
for req in [requirement, requirement.replace(".", "-")]:
481+
[dist] = ws.require(req)
482+
assert dist.version == version
483+
assert os.path.samefile(
484+
os.path.commonpath([dist.location, site_packages]), site_packages
485+
)

pkg_resources/tests/test_working_set.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ def parametrize_test_working_set_resolve(*test_list):
104104
)
105105
)
106106
return pytest.mark.parametrize(
107-
'installed_dists,installable_dists,'
108-
'requirements,replace_conflicting,'
109-
'resolved_dists_or_exception',
107+
(
108+
"installed_dists",
109+
"installable_dists",
110+
"requirements",
111+
"replace_conflicting",
112+
"resolved_dists_or_exception",
113+
),
110114
argvalues,
111115
ids=idlist,
112116
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ backend-path = ["."]
55

66
[project]
77
name = "setuptools"
8-
version = "75.6.0"
8+
version = "76.0.0"
99
authors = [
1010
{ name = "Python Packaging Authority", email = "[email protected]" },
1111
]

0 commit comments

Comments
 (0)