Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pypa/setuptools into pkg_re…
Browse files Browse the repository at this point in the history
…sources-explicit-public-return-annotations
  • Loading branch information
Avasam committed Jul 17, 2024
2 parents 9fcd7fa + 9c53695 commit e402f44
Show file tree
Hide file tree
Showing 559 changed files with 27,266 additions and 19,889 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.1.0
current_version = 71.0.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
```
...
3 changes: 0 additions & 3 deletions .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 Expand Up @@ -206,8 +205,6 @@ jobs:
if: hashFiles('coverage.xml') != '' # Rudimentary `file.exists()`
uses: codecov/codecov-action@v4
with:
files: >-
${{ github.workspace }}\coverage.xml
flags: >- # Mark which lines are covered by which envs
CI-GHA,
${{ github.job }},
Expand Down
23 changes: 0 additions & 23 deletions .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ python:
install:
- path: .
extra_requirements:
- docs
- doc

# required boilerplate readthedocs/readthedocs.org#10401
build:
Expand Down
49 changes: 49 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
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. (#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
=======

Features
--------

- Updated distutils including significant changes to support Cygwin and mingw compilers. (#4444)


Bugfixes
--------

- Fix distribution name normalisation (:pep:`625`) for valid versions that are
not canonical (e.g. ``1.0-2``). (#4434)


v70.1.1
=======

Misc
----

- #4429


v70.1.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
8 changes: 4 additions & 4 deletions 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 All @@ -124,9 +124,9 @@
github_repo_url = f'{github_url}/{github_repo_slug}'
github_sponsors_url = f'{github_url}/sponsors'
extlinks = {
'user': (f'{github_sponsors_url}/%s', '@%s'), # noqa: WPS323
'pypi': ('https://pypi.org/project/%s', '%s'), # noqa: WPS323
'wiki': ('https://wikipedia.org/wiki/%s', '%s'), # noqa: WPS323
'user': (f'{github_sponsors_url}/%s', '@%s'),
'pypi': ('https://pypi.org/project/%s', '%s'),
'wiki': ('https://wikipedia.org/wiki/%s', '%s'),
}
extensions += ['sphinx.ext.extlinks']

Expand Down
Loading

0 comments on commit e402f44

Please sign in to comment.