Skip to content

Commit 45615b7

Browse files
authored
Merge branch 'main' into pytest-mypy-log-filename
2 parents 18d961a + c117671 commit 45615b7

File tree

177 files changed

+1744
-1968
lines changed

Some content is hidden

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

177 files changed

+1744
-1968
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 = 72.1.0
2+
current_version = 73.0.1
33
commit = True
44
tag = True
55

.coveragerc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ disable_warnings =
1717
[report]
1818
show_missing = True
1919
exclude_also =
20-
# jaraco/skeleton#97
21-
@overload
20+
# Exclude common false positives per
21+
# https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion
22+
# Ref jaraco/skeleton#97 and jaraco/skeleton#135
23+
class .*\bProtocol\):
2224
if TYPE_CHECKING:

.pre-commit-config.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
repos:
2-
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.4.9
4-
hooks:
5-
- id: ruff
6-
- id: ruff-format
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.5.7
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ recursive-include newsfragments *
1010
include *.py
1111
include *.rst
1212
include MANIFEST.in
13-
include LICENSE
13+
global-include LICEN[CS]E* COPYING* NOTICE* AUTHORS*
1414
include launcher.c
1515
include msvc-build-launcher.cmd
1616
include mypy.ini
1717
include pytest.ini
1818
include tox.ini
1919
include setuptools/tests/config/setupcfg_examples.txt
20+
include setuptools/config/*.schema.json
2021
global-exclude *.py[cod] __pycache__

NEWS.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
1+
v73.0.1
2+
=======
3+
4+
Bugfixes
5+
--------
6+
7+
- Remove `abc.ABCMeta` metaclass from abstract classes. `pypa/setuptools#4503 <https://github.com/pypa/setuptools/pull/4503>`_ had an unintended consequence of causing potential ``TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases`` -- by :user:`Avasam` (#4579)
8+
9+
10+
v73.0.0
11+
=======
12+
13+
Features
14+
--------
15+
16+
- Mark abstract base classes and methods with `abc.ABC` and `abc.abstractmethod` -- by :user:`Avasam` (#4503)
17+
- Changed the order of type checks in ``setuptools.command.easy_install.CommandSpec.from_param`` to support any `collections.abc.Iterable` of `str` param -- by :user:`Avasam` (#4505)
18+
19+
20+
Bugfixes
21+
--------
22+
23+
- Prevent an error in ``bdist_wheel`` if ``compression`` is set to a `str` (even if valid) after finalizing options but before running the command. -- by :user:`Avasam` (#4383)
24+
- Raises an exception when ``py_limited_api`` is used in a build with
25+
``Py_GIL_DISABLED``. This is currently not supported (python/cpython#111506). (#4420)
26+
- Synced with pypa/distutils@30b7331 including fix for modified check on empty sources (pypa/distutils#284).
27+
28+
29+
Deprecations and Removals
30+
-------------------------
31+
32+
- ``setuptools`` is replacing the usages of :pypi:`ordered_set` with simple
33+
instances of ``dict[Hashable, None]``. This is done to remove the extra
34+
dependency and it is possible because since Python 3.7, ``dict`` maintain
35+
insertion order. (#4574)
36+
37+
38+
Misc
39+
----
40+
41+
- #4534, #4546, #4554, #4559, #4565
42+
43+
44+
v72.2.0
45+
=======
46+
47+
Features
48+
--------
49+
50+
- Merged with pypa/distutils@b7ee725f3 including: Support for Pathlike objects in data files and extensions (pypa/distutils#272, pypa/distutils#237), native support for C++ compilers (pypa/distuils#228) and removed unused get_msvcr() (pypa/distutils#274). (#4538)
51+
52+
153
v72.1.0
254
=======
355

_distutils_hack/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# don't import any costly modules
2-
import sys
32
import os
4-
3+
import sys
54

65
report_url = (
76
"https://github.com/pypa/setuptools/issues/new?"

conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import pytest
77
from pytest_mypy import MypyFileItem, MypyResults
88

9-
109
pytest_plugins = 'setuptools.tests.fixtures'
1110

1211

docs/development/developer-guide.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,35 @@ simple Python script ``tools/vendor.py``.
131131
To refresh the dependencies, run the following command::
132132

133133
$ tox -e vendor
134+
135+
----------------
136+
Type annotations
137+
----------------
138+
139+
Most standards and best practices are enforced by
140+
`Ruff <https://docs.astral.sh/ruff/rules/>`_'s ``ANN2``, ``FA``, ``PYI``, ``UP``
141+
and ``YTT`` rules.
142+
143+
Explicit return types have to be added for typed public functions whose
144+
parameters are *all* annotated. This is enforced by ``ANN2``, but it's worth noting
145+
that this is due to mypy inferring ``Any`` even for simple return types. Mypy also
146+
doesn't count functions with missing parameter annotations as "typed". (see
147+
`python/mypy#4409 <https://github.com/python/mypy/issues/4409>`_,
148+
`python/mypy#10149 <https://github.com/python/mypy/issues/10149>`_ and
149+
`python/mypy#6646 <https://github.com/python/mypy/issues/6646>`_).
150+
Otherwise, return annotations can be omitted to reduce verbosity,
151+
especially for complex return types.
152+
153+
Instead of typing an explicit return type annotation as
154+
``Generator[..., None, None]``, we'll prefer using an ``Iterator`` as it is more
155+
concise and conceptually easier to deal with. Returning a ``Generator`` with no
156+
``yield`` type or ``send`` type can sometimes be considered as exposing
157+
implementation details. See
158+
`Y058 <https://github.com/PyCQA/flake8-pyi/blob/main/ERRORCODES.md#Y058>`_.
159+
160+
Avoid importing private type-checking-only symbols. These are often
161+
`typeshed <https://github.com/python/typeshed>`_ internal details and are not
162+
guaranteed to be stable.
163+
Importing from ``_typeshed`` or ``typing_extensions`` is fine, but if you find
164+
yourself importing the same symbol in ``TYPE_CHECKING`` blocks a lot, consider
165+
implementing an alias directly in ``setuptools``.

docs/history.rst

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

8+
.. meta::
9+
:keywords: changelog
10+
811
.. towncrier-draft-entries:: DRAFT, unreleased as on |today|
912

1013
.. include:: ../NEWS (links).rst

docs/userguide/package_discovery.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ exactly to the directory structure, you also need to configure ``package_dir``:
8888
package_dir = {
8989
"mypkg": "lib", # mypkg.module corresponds to lib/module.py
9090
"mypkg.subpkg1": "lib1", # mypkg.subpkg1.module1 corresponds to lib1/module1.py
91-
"mypkg.subpkg2": "lib2" # mypkg.subpkg2.module2 corresponds to lib2/module2.py
91+
"mypkg.subpkg2": "lib2", # mypkg.subpkg2.module2 corresponds to lib2/module2.py
9292
# ...
93+
}
9394
)
9495
9596
.. tab:: pyproject.toml

mypy.ini

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[mypy]
22
# CI should test for all versions, local development gets hints for oldest supported
3-
# Some upstream typeshed distutils stubs fixes are necessary before we can start testing on Python 3.12
4-
python_version = 3.8
3+
# But our testing setup doesn't allow passing CLI arguments, so local devs have to set this manually.
4+
# python_version = 3.8
55
strict = False
66
warn_unused_ignores = True
77
warn_redundant_casts = True
@@ -15,14 +15,13 @@ exclude = (?x)(
1515
| ^setuptools/_vendor/ # Vendored
1616
| ^setuptools/_distutils/ # Vendored
1717
| ^setuptools/config/_validate_pyproject/ # Auto-generated
18-
| ^setuptools/tests/bdist_wheel_testdata/ # Duplicate module name
1918
)
2019
# Too many false-positives
2120
disable_error_code = overload-overlap
2221

23-
# Ignoring attr-defined because setuptools wraps a lot of distutils classes, adding new attributes,
24-
# w/o updating all the attributes and return types from the base classes for type-checkers to understand
25-
# Especially with setuptools.dist.command vs distutils.dist.command vs setuptools._distutils.dist.command
22+
# DistributionMetadata.license_files and DistributionMetadata.license_file
23+
# are dynamically patched in setuptools/_core_metadata.py
24+
# and no DistributionMetadata subclass exists in setuptools
2625
[mypy-setuptools.*]
2726
disable_error_code = attr-defined
2827

@@ -31,16 +30,20 @@ disable_error_code = attr-defined
3130
[mypy-pkg_resources.tests.*]
3231
disable_error_code = import-not-found
3332

34-
# - distutils._modified has different errors on Python 3.8 [import-untyped], on Python 3.9+ [import-not-found]
33+
# - distutils doesn't exist on Python 3.12, unfortunately, this means typing
34+
# will be missing for subclasses of distutils on Python 3.12 until either:
35+
# - support for `SETUPTOOLS_USE_DISTUTILS=stdlib` is dropped (#3625)
36+
# for setuptools to import `_distutils` directly
37+
# - or non-stdlib distutils typings are exposed
3538
# - All jaraco modules are still untyped
3639
# - _validate_project sometimes complains about trove_classifiers (#4296)
3740
# - wheel appears to be untyped
3841
# - pytest_mypy isn't marked as py.typed
39-
[mypy-distutils._modified,jaraco.*,trove_classifiers,wheel.*,pytest_mypy.*]
42+
[mypy-distutils.*,jaraco.*,trove_classifiers,wheel.*,pytest_mypy.*]
4043
ignore_missing_imports = True
4144

4245
# Even when excluding a module, import issues can show up due to following import
4346
# https://github.com/python/mypy/issues/11936#issuecomment-1466764006
44-
[mypy-setuptools.config._validate_pyproject.*]
47+
[mypy-setuptools.config._validate_pyproject.*,setuptools._distutils.*]
4548
follow_imports = silent
4649
# silent => ignore errors when following imports

0 commit comments

Comments
 (0)