Skip to content

Commit c405ac1

Browse files
committed
Merge branch 'main' into debt/remove-test-command
2 parents 6404823 + 08bd311 commit c405ac1

File tree

414 files changed

+22552
-20144
lines changed

Some content is hidden

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

414 files changed

+22552
-20144
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 = 70.2.0
2+
current_version = 71.1.0
33
commit = True
44
tag = True
55

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
name: 📇 Distutils Deprecation Report
3+
description: >-
4+
Report a use-case affected by the deprecation of distutils
5+
labels:
6+
- distutils deprecation
7+
- Needs Triage
8+
projects:
9+
- pypa/6
10+
body:
11+
- type: markdown
12+
attributes:
13+
value: >
14+
So you've encountered an issue with the deprecation of distutils.
15+
16+
First, sorry for the inconvenience while we work to untangle the
17+
legacy which is setuptools/distutils. Our goal is to ensure that
18+
the vast majority of use cases are satisfied prior to removing
19+
the legacy support.
20+
21+
Please check the
22+
[existing reports](https://github.com/pypa/setuptools/issues?q=label%3A%22distutils+deprecation%22+)
23+
to see if the affecting condition has been reported previously.
24+
25+
- type: markdown
26+
attributes:
27+
value: >-
28+
**Environment**
29+
- type: input
30+
attributes:
31+
label: setuptools version
32+
placeholder: For example, setuptools==69.1.0
33+
description: >-
34+
Please also test with the **latest version** of `setuptools`.
35+
36+
Typically, this involves modifying `requires` in `[build-system]` of
37+
[`pyproject.toml`](https://setuptools.pypa.io/en/latest/userguide/quickstart.html#basic-use),
38+
not just updating `setuptools` using `pip`.
39+
validations:
40+
required: true
41+
- type: input
42+
attributes:
43+
label: Python version
44+
placeholder: For example, Python 3.10
45+
description: >-
46+
Please ensure you are using a [supported version of Python](https://devguide.python.org/versions/#supported-versions).
47+
48+
Setuptools does not support versions that have reached [`end-of-life`](https://devguide.python.org/versions/#unsupported-versions).
49+
50+
Support for versions of Python under development (i.e. without a stable release) is experimental.
51+
validations:
52+
required: true
53+
- type: input
54+
attributes:
55+
label: OS
56+
placeholder: For example, Gentoo Linux, RHEL 8, Arch Linux, macOS etc.
57+
validations:
58+
required: true
59+
- type: textarea
60+
attributes:
61+
label: Additional environment information
62+
description: >-
63+
Feel free to add more information about your environment here.
64+
placeholder: >-
65+
This is only happening when I run setuptools on my fridge's patched firmware 🤯
66+
67+
- type: textarea
68+
attributes:
69+
label: Description
70+
description: >-
71+
A clear and concise description of the circumstances leading to the warning.
72+
validations:
73+
required: true
74+
75+
- type: textarea
76+
attributes:
77+
label: How to Reproduce
78+
description: >-
79+
Describe the steps to reproduce the warning.
80+
81+
Please try to create a [minimal reproducer](https://stackoverflow.com/help/minimal-reproducible-example),
82+
and avoid things like "see the steps in the CI logs".
83+
placeholder: |
84+
1. Clone a simplified example: `git clone ...`
85+
2. Create a virtual environment for isolation with `...`
86+
2. Build the project with setuptools via '...'
87+
2. Then run '...'
88+
3. An error occurs.
89+
validations:
90+
required: true
91+
92+
- type: textarea
93+
attributes:
94+
label: Other detail
95+
description: >-
96+
Paste the output of the steps above, including the commands
97+
themselves and setuptools' output/traceback etc.
98+
value: |
99+
```console
100+
101+
```
102+
103+
...

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ jobs:
129129
job:
130130
- diffcov
131131
- docs
132-
- check-extern
133132
runs-on: ubuntu-latest
134133
steps:
135134
- uses: actions/checkout@v4

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ recursive-include setuptools *.py *.exe *.xml *.tmpl
22
recursive-include tests *.py
33
recursive-include setuptools/tests *.html
44
recursive-include docs *.py *.txt *.rst *.conf *.css *.css_t Makefile indexsidebar.html
5-
recursive-include setuptools/_vendor *.py *.txt
5+
recursive-include setuptools/_vendor *
66
recursive-include pkg_resources *.py *.txt
77
recursive-include pkg_resources/tests/data *
88
recursive-include tools *

NEWS.rst

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
1+
v71.1.0
2+
=======
3+
4+
Features
5+
--------
6+
7+
- Added return types to typed public functions -- by :user:`Avasam`
8+
9+
Marked `pkg_resources` as ``py.typed`` -- by :user:`Avasam` (#4409)
10+
11+
12+
Misc
13+
----
14+
15+
- #4492
16+
17+
18+
v71.0.4
19+
=======
20+
21+
Bugfixes
22+
--------
23+
24+
- Removed lingering unused code around Distribution._patched_dist. (#4489)
25+
26+
27+
v71.0.3
28+
=======
29+
30+
Bugfixes
31+
--------
32+
33+
- Reset the backports module when enabling vendored packages. (#4476)
34+
35+
36+
v71.0.2
37+
=======
38+
39+
Bugfixes
40+
--------
41+
42+
- Include all vendored files in the sdist. (#4480)
43+
44+
45+
v71.0.1
46+
=======
47+
48+
Bugfixes
49+
--------
50+
51+
- Restored package data that went missing in 71.0. This change also incidentally causes tests to be installed once again. (#4475)
52+
53+
54+
v71.0.0
55+
=======
56+
57+
Deprecations and Removals
58+
-------------------------
59+
60+
- Now setuptools declares its own dependencies in the ``core`` extra. Dependencies are still vendored for bootstrapping purposes, but setuptools will prefer installed dependencies if present. The ``core`` extra is used for informational purposes and should *not* be declared in package metadata (e.g. ``build-requires``). Downstream packagers can de-vendor by simply removing the ``setuptools/_vendor`` directory. Since Setuptools now prefers installed dependencies, those installing to an environment with old, incompatible dependencies will not work. In that case, either uninstall the incompatible dependencies or upgrade them to satisfy those declared in ``core``. (#2825)
61+
62+
63+
v70.3.0
64+
=======
65+
66+
Features
67+
--------
68+
69+
- Support for loading distutils from the standard library is now deprecated, including use of SETUPTOOLS_USE_DISTUTILS=stdlib and importing distutils before importing setuptools. (#4137)
70+
71+
72+
Bugfixes
73+
--------
74+
75+
- Bugfix for building Cython extension on Windows (pypa/distutils#268).
76+
77+
178
v70.2.0
279
=======
380

_distutils_hack/__init__.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
import os
44

55

6+
report_url = (
7+
"https://github.com/pypa/setuptools/issues/new?"
8+
"template=distutils-deprecation.yml"
9+
)
10+
11+
612
def warn_distutils_present():
713
if 'distutils' not in sys.modules:
814
return
@@ -23,7 +29,12 @@ def clear_distutils():
2329
return
2430
import warnings
2531

26-
warnings.warn("Setuptools is replacing distutils.")
32+
warnings.warn(
33+
"Setuptools is replacing distutils. Support for replacing "
34+
"an already imported distutils is deprecated. In the future, "
35+
"this condition will fail. "
36+
f"Register concerns at {report_url}"
37+
)
2738
mods = [
2839
name
2940
for name in sys.modules
@@ -38,6 +49,16 @@ def enabled():
3849
Allow selection of distutils by environment variable.
3950
"""
4051
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
52+
if which == 'stdlib':
53+
import warnings
54+
55+
warnings.warn(
56+
"Reliance on distutils from stdlib is deprecated. Users "
57+
"must rely on setuptools to provide the distutils module. "
58+
"Avoid importing distutils or import setuptools first, "
59+
"and avoid setting SETUPTOOLS_USE_DISTUTILS=stdlib. "
60+
f"Register concerns at {report_url}"
61+
)
4162
return which == 'local'
4263

4364

conftest.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ def pytest_configure(config):
3232
'setuptools/tests/mod_with_constant.py',
3333
'setuptools/_distutils',
3434
'_distutils_hack',
35-
'setuptools/extern',
36-
'pkg_resources/extern',
3735
'pkg_resources/tests/data',
3836
'setuptools/_vendor',
39-
'pkg_resources/_vendor',
4037
'setuptools/config/_validate_pyproject',
4138
'setuptools/modified.py',
4239
'setuptools/tests/bdist_wheel_testdata',

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106

107107
intersphinx_mapping.update({
108108
'pip': ('https://pip.pypa.io/en/latest', None),
109-
'build': ('https://pypa-build.readthedocs.io/en/latest', None),
109+
'build': ('https://build.pypa.io/en/latest', None),
110110
'PyPUG': ('https://packaging.python.org/en/latest/', None),
111111
'packaging': ('https://packaging.pypa.io/en/latest/', None),
112112
'twine': ('https://twine.readthedocs.io/en/stable/', None),

mypy.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exclude = (?x)(
1212
| ^.tox/
1313
| ^.eggs/
1414
| ^pkg_resources/tests/data/my-test-package-source/setup.py$ # Duplicate module name
15-
| ^.+?/(_vendor|extern)/ # Vendored
15+
| ^setuptools/_vendor/ # Vendored
1616
| ^setuptools/_distutils/ # Vendored
1717
| ^setuptools/config/_validate_pyproject/ # Auto-generated
1818
| ^setuptools/tests/bdist_wheel_testdata/ # Duplicate module name
@@ -31,15 +31,15 @@ disable_error_code = attr-defined
3131
[mypy-pkg_resources.tests.*]
3232
disable_error_code = import-not-found
3333

34-
# - Avoid raising issues when importing from "extern" modules, as those are added to path dynamically.
35-
# https://github.com/pypa/setuptools/pull/3979#discussion_r1367968993
3634
# - distutils._modified has different errors on Python 3.8 [import-untyped], on Python 3.9+ [import-not-found]
3735
# - All jaraco modules are still untyped
3836
# - _validate_project sometimes complains about trove_classifiers (#4296)
39-
[mypy-pkg_resources.extern.*,setuptools.extern.*,distutils._modified,jaraco.*,trove_classifiers]
37+
# - wheel appears to be untyped
38+
[mypy-distutils._modified,jaraco.*,trove_classifiers,wheel.*]
4039
ignore_missing_imports = True
4140

42-
# Even when excluding vendored/generated modules, there might be problems: https://github.com/python/mypy/issues/11936#issuecomment-1466764006
43-
[mypy-setuptools._vendor.packaging._manylinux,setuptools.config._validate_pyproject.*]
41+
# Even when excluding a module, import issues can show up due to following import
42+
# https://github.com/python/mypy/issues/11936#issuecomment-1466764006
43+
[mypy-setuptools.config._validate_pyproject.*]
4444
follow_imports = silent
4545
# silent => ignore errors when following imports

0 commit comments

Comments
 (0)