Skip to content

Commit

Permalink
Merge branch 'main' into debt/remove-test-command
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jul 21, 2024
2 parents 6404823 + 08bd311 commit c405ac1
Show file tree
Hide file tree
Showing 414 changed files with 22,552 additions and 20,144 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 70.2.0
current_version = 71.1.0
commit = True
tag = True

Expand Down
103 changes: 103 additions & 0 deletions .github/ISSUE_TEMPLATE/distutils-deprecation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
name: 📇 Distutils Deprecation Report
description: >-
Report a use-case affected by the deprecation of distutils
labels:
- distutils deprecation
- Needs Triage
projects:
- pypa/6
body:
- type: markdown
attributes:
value: >
So you've encountered an issue with the deprecation of distutils.
First, sorry for the inconvenience while we work to untangle the
legacy which is setuptools/distutils. Our goal is to ensure that
the vast majority of use cases are satisfied prior to removing
the legacy support.
Please check the
[existing reports](https://github.com/pypa/setuptools/issues?q=label%3A%22distutils+deprecation%22+)
to see if the affecting condition has been reported previously.
- type: markdown
attributes:
value: >-
**Environment**
- type: input
attributes:
label: setuptools version
placeholder: For example, setuptools==69.1.0
description: >-
Please also test with the **latest version** of `setuptools`.
Typically, this involves modifying `requires` in `[build-system]` of
[`pyproject.toml`](https://setuptools.pypa.io/en/latest/userguide/quickstart.html#basic-use),
not just updating `setuptools` using `pip`.
validations:
required: true
- type: input
attributes:
label: Python version
placeholder: For example, Python 3.10
description: >-
Please ensure you are using a [supported version of Python](https://devguide.python.org/versions/#supported-versions).
Setuptools does not support versions that have reached [`end-of-life`](https://devguide.python.org/versions/#unsupported-versions).
Support for versions of Python under development (i.e. without a stable release) is experimental.
validations:
required: true
- type: input
attributes:
label: OS
placeholder: For example, Gentoo Linux, RHEL 8, Arch Linux, macOS etc.
validations:
required: true
- type: textarea
attributes:
label: Additional environment information
description: >-
Feel free to add more information about your environment here.
placeholder: >-
This is only happening when I run setuptools on my fridge's patched firmware 🤯
- type: textarea
attributes:
label: Description
description: >-
A clear and concise description of the circumstances leading to the warning.
validations:
required: true

- type: textarea
attributes:
label: How to Reproduce
description: >-
Describe the steps to reproduce the warning.
Please try to create a [minimal reproducer](https://stackoverflow.com/help/minimal-reproducible-example),
and avoid things like "see the steps in the CI logs".
placeholder: |
1. Clone a simplified example: `git clone ...`
2. Create a virtual environment for isolation with `...`
2. Build the project with setuptools via '...'
2. Then run '...'
3. An error occurs.
validations:
required: true

- type: textarea
attributes:
label: Other detail
description: >-
Paste the output of the steps above, including the commands
themselves and setuptools' output/traceback etc.
value: |
```console
```
...
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ jobs:
job:
- diffcov
- docs
- check-extern
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ recursive-include setuptools *.py *.exe *.xml *.tmpl
recursive-include tests *.py
recursive-include setuptools/tests *.html
recursive-include docs *.py *.txt *.rst *.conf *.css *.css_t Makefile indexsidebar.html
recursive-include setuptools/_vendor *.py *.txt
recursive-include setuptools/_vendor *
recursive-include pkg_resources *.py *.txt
recursive-include pkg_resources/tests/data *
recursive-include tools *
Expand Down
77 changes: 77 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
v71.1.0
=======

Features
--------

- Added return types to typed public functions -- by :user:`Avasam`

Marked `pkg_resources` as ``py.typed`` -- by :user:`Avasam` (#4409)


Misc
----

- #4492


v71.0.4
=======

Bugfixes
--------

- Removed lingering unused code around Distribution._patched_dist. (#4489)


v71.0.3
=======

Bugfixes
--------

- Reset the backports module when enabling vendored packages. (#4476)


v71.0.2
=======

Bugfixes
--------

- Include all vendored files in the sdist. (#4480)


v71.0.1
=======

Bugfixes
--------

- Restored package data that went missing in 71.0. This change also incidentally causes tests to be installed once again. (#4475)


v71.0.0
=======

Deprecations and Removals
-------------------------

- 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)


v70.3.0
=======

Features
--------

- 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)


Bugfixes
--------

- Bugfix for building Cython extension on Windows (pypa/distutils#268).


v70.2.0
=======

Expand Down
23 changes: 22 additions & 1 deletion _distutils_hack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
import os


report_url = (
"https://github.com/pypa/setuptools/issues/new?"
"template=distutils-deprecation.yml"
)


def warn_distutils_present():
if 'distutils' not in sys.modules:
return
Expand All @@ -23,7 +29,12 @@ def clear_distutils():
return
import warnings

warnings.warn("Setuptools is replacing distutils.")
warnings.warn(
"Setuptools is replacing distutils. Support for replacing "
"an already imported distutils is deprecated. In the future, "
"this condition will fail. "
f"Register concerns at {report_url}"
)
mods = [
name
for name in sys.modules
Expand All @@ -38,6 +49,16 @@ def enabled():
Allow selection of distutils by environment variable.
"""
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
if which == 'stdlib':
import warnings

warnings.warn(
"Reliance on distutils from stdlib is deprecated. Users "
"must rely on setuptools to provide the distutils module. "
"Avoid importing distutils or import setuptools first, "
"and avoid setting SETUPTOOLS_USE_DISTUTILS=stdlib. "
f"Register concerns at {report_url}"
)
return which == 'local'


Expand Down
3 changes: 0 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ def pytest_configure(config):
'setuptools/tests/mod_with_constant.py',
'setuptools/_distutils',
'_distutils_hack',
'setuptools/extern',
'pkg_resources/extern',
'pkg_resources/tests/data',
'setuptools/_vendor',
'pkg_resources/_vendor',
'setuptools/config/_validate_pyproject',
'setuptools/modified.py',
'setuptools/tests/bdist_wheel_testdata',
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

intersphinx_mapping.update({
'pip': ('https://pip.pypa.io/en/latest', None),
'build': ('https://pypa-build.readthedocs.io/en/latest', None),
'build': ('https://build.pypa.io/en/latest', None),
'PyPUG': ('https://packaging.python.org/en/latest/', None),
'packaging': ('https://packaging.pypa.io/en/latest/', None),
'twine': ('https://twine.readthedocs.io/en/stable/', None),
Expand Down
12 changes: 6 additions & 6 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exclude = (?x)(
| ^.tox/
| ^.eggs/
| ^pkg_resources/tests/data/my-test-package-source/setup.py$ # Duplicate module name
| ^.+?/(_vendor|extern)/ # Vendored
| ^setuptools/_vendor/ # Vendored
| ^setuptools/_distutils/ # Vendored
| ^setuptools/config/_validate_pyproject/ # Auto-generated
| ^setuptools/tests/bdist_wheel_testdata/ # Duplicate module name
Expand All @@ -31,15 +31,15 @@ disable_error_code = attr-defined
[mypy-pkg_resources.tests.*]
disable_error_code = import-not-found

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

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

0 comments on commit c405ac1

Please sign in to comment.