Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pypa/setuptools into type-c…
Browse files Browse the repository at this point in the history
…heck-3.12
  • Loading branch information
Avasam committed Aug 21, 2024
2 parents fd44868 + 4cc8ad3 commit 117b375
Show file tree
Hide file tree
Showing 38 changed files with 113 additions and 759 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 = 72.2.0
current_version = 73.0.1
commit = True
tag = True

Expand Down
6 changes: 4 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ disable_warnings =
[report]
show_missing = True
exclude_also =
# jaraco/skeleton#97
@overload
# Exclude common false positives per
# https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion
# Ref jaraco/skeleton#97 and jaraco/skeleton#135
class .*\bProtocol\):
if TYPE_CHECKING:
43 changes: 43 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
v73.0.1
=======

Bugfixes
--------

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


v73.0.0
=======

Features
--------

- Mark abstract base classes and methods with `abc.ABC` and `abc.abstractmethod` -- by :user:`Avasam` (#4503)
- 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)


Bugfixes
--------

- 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)
- Raises an exception when ``py_limited_api`` is used in a build with
``Py_GIL_DISABLED``. This is currently not supported (python/cpython#111506). (#4420)
- Synced with pypa/distutils@30b7331 including fix for modified check on empty sources (pypa/distutils#284).


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

- ``setuptools`` is replacing the usages of :pypi:`ordered_set` with simple
instances of ``dict[Hashable, None]``. This is done to remove the extra
dependency and it is possible because since Python 3.7, ``dict`` maintain
insertion order. (#4574)


Misc
----

- #4534, #4546, #4554, #4559, #4565


v72.2.0
=======

Expand Down
1 change: 0 additions & 1 deletion newsfragments/4383.bugfix.rst

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/4420.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4503.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4505.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4534.misc.rst

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/4546.misc.rst

This file was deleted.

1 change: 0 additions & 1 deletion newsfragments/4554.misc.rst

This file was deleted.

2 changes: 0 additions & 2 deletions newsfragments/4559.misc.rst

This file was deleted.

3 changes: 0 additions & 3 deletions newsfragments/4565.misc.rst

This file was deleted.

3 changes: 1 addition & 2 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from __future__ import annotations

import sys
from abc import ABC

if sys.version_info < (3, 8): # noqa: UP036 # Check for unsupported versions
raise RuntimeError("Python 3.8 or later is required")
Expand Down Expand Up @@ -306,7 +305,7 @@ def get_supported_platform():
]


class ResolutionError(Exception, ABC):
class ResolutionError(Exception):
"""Abstract base for dependency resolution errors"""

def __repr__(self):
Expand Down
30 changes: 23 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ backend-path = ["."]

[project]
name = "setuptools"
version = "72.2.0"
version = "73.0.1"
authors = [
{ name = "Python Packaging Authority", email = "distutils-sig@python.org" },
]
Expand Down Expand Up @@ -36,11 +36,6 @@ Changelog = "https://setuptools.pypa.io/en/stable/history.html"
test = [
# upstream
"pytest >= 6, != 8.1.*",
"pytest-checkdocs >= 2.4",
"pytest-cov",
"pytest-mypy",
"pytest-enabler >= 2.2",
"pytest-ruff >= 0.2.1; sys_platform != 'cygwin'",

# local
"virtualenv>=13.0.0",
Expand Down Expand Up @@ -81,6 +76,7 @@ test = [
# workaround for businho/pytest-ruff#28
'pytest-ruff < 0.4; platform_system == "Windows"',
]

doc = [
# upstream
"sphinx >= 3.5",
Expand Down Expand Up @@ -110,7 +106,6 @@ ssl = []
certs = []
core = [
"packaging>=24",
"ordered-set>=3.1.1",
"more_itertools>=8.8",
"jaraco.text>=3.7",
"importlib_resources>=5.10.2; python_version < '3.9'",
Expand All @@ -122,6 +117,27 @@ core = [
"platformdirs >= 2.6.2",
]

check = [
"pytest-checkdocs >= 2.4",
"pytest-ruff >= 0.2.1; sys_platform != 'cygwin'",
]

cover = [
"pytest-cov",
]

enabler = [
"pytest-enabler >= 2.2",
]

type = [
# upstream
"pytest-mypy",

# local
]


[project.entry-points."distutils.commands"]
alias = "setuptools.command.alias:alias"
bdist_egg = "setuptools.command.bdist_egg:bdist_egg"
Expand Down
4 changes: 2 additions & 2 deletions setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import re
import sys
from abc import ABC, abstractmethod
from abc import abstractmethod
from typing import TYPE_CHECKING, TypeVar, overload

sys.path.extend(((vendor_path := os.path.join(os.path.dirname(os.path.dirname(__file__)), 'setuptools', '_vendor')) not in sys.path) * [vendor_path]) # fmt: skip
Expand Down Expand Up @@ -127,7 +127,7 @@ def setup(**attrs):
_Command = monkey.get_unpatched(distutils.core.Command)


class Command(_Command, ABC):
class Command(_Command):
"""
Setuptools internal actions are organized using a *command design pattern*.
This means that each action (or group of closely related actions) executed during
Expand Down
2 changes: 1 addition & 1 deletion setuptools/_distutils/_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def missing_as_newer(source):
return missing == 'newer' and not os.path.exists(source)

ignored = os.path.exists if missing == 'ignore' else None
return any(
return not os.path.exists(target) or any(
missing_as_newer(source) or _newer(source, target)
for source in filter(ignored, sources)
)
Expand Down
2 changes: 1 addition & 1 deletion setuptools/_distutils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def _show_help(
)
print()

for command in self.commands:
for command in commands:
if isinstance(command, type) and issubclass(command, Command):
klass = command
else:
Expand Down
7 changes: 7 additions & 0 deletions setuptools/_distutils/tests/test_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,10 @@ def test_newer_pairwise_group(groups_target):
newer = newer_pairwise_group([groups_target.newer], [groups_target.target])
assert older == ([], [])
assert newer == ([groups_target.newer], [groups_target.target])


def test_newer_group_no_sources_no_target(tmp_path):
"""
Consider no sources and no target "newer".
"""
assert newer_group([], str(tmp_path / 'does-not-exist'))
1 change: 0 additions & 1 deletion setuptools/_vendor/ordered_set-4.1.0.dist-info/INSTALLER

This file was deleted.

158 changes: 0 additions & 158 deletions setuptools/_vendor/ordered_set-4.1.0.dist-info/METADATA

This file was deleted.

8 changes: 0 additions & 8 deletions setuptools/_vendor/ordered_set-4.1.0.dist-info/RECORD

This file was deleted.

Empty file.
4 changes: 0 additions & 4 deletions setuptools/_vendor/ordered_set-4.1.0.dist-info/WHEEL

This file was deleted.

Loading

0 comments on commit 117b375

Please sign in to comment.