Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,6 @@ jobs:
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
# Workaround for actions/setup-python#981 on macos
# Workaround for https://github.com/pypa/setuptools/issues/5143 on windows
# (env var only modified for this specific step)
env:
SETUPTOOLS_USE_DISTUTILS: >-
${{
(
( matrix.platform == 'macos-latest' || matrix.platform == 'windows-latest' )
&& matrix.python == '3.9'
&& 'stdlib'
)
|| matrix.distutils
|| 'local'
}}
- uses: actions/cache@v4
id: cache
with:
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ disable_error_code =

# CI should test for all versions, local development gets hints for oldest supported
# But our testing setup doesn't allow passing CLI arguments, so local devs have to set this manually.
# python_version = 3.9
# python_version = 3.X

exclude = (?x)(
# Avoid scanning Python files in generated folders
Expand Down
1 change: 1 addition & 0 deletions newsfragments/5222.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dropped dependency on :pypi:`importlib_metadata` -- by :user:`Avasam`
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test = [
"pytest-timeout",
'pytest-perf; sys_platform != "cygwin"', # workaround for jaraco/inflect#195, pydantic/pydantic-core#773 (see #3986)
# for tools/finalize.py
'jaraco.develop >= 7.21; python_version >= "3.9" and sys_platform != "cygwin"',
'jaraco.develop >= 7.21; sys_platform != "cygwin"',
"pytest-home >= 0.5",
"pytest-subprocess",

Expand Down Expand Up @@ -98,7 +98,6 @@ core = [
"packaging>=24.2",
"more_itertools>=8.8",
"jaraco.text>=3.7",
"importlib_metadata>=6; python_version < '3.10'",
"tomli>=2.0.1; python_version < '3.11'",
"wheel>=0.43.0",

Expand Down
2 changes: 1 addition & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"setuptools/_distutils",
],
// Our testing setup doesn't allow passing CLI arguments, so local devs have to set this manually.
// "pythonVersion": "3.9",
// "pythonVersion": "3.X",
// For now we don't mind if mypy's `type: ignore` comments accidentally suppresses pyright issues
"enableTypeIgnoreComments": true,
"typeCheckingMode": "basic",
Expand Down
10 changes: 4 additions & 6 deletions setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
for use with `isinstance`.
"""
_Sequence: TypeAlias = tuple[str, ...] | list[str]
# This is how stringifying _Sequence would look in Python 3.10
_sequence_type_repr = "tuple[str, ...] | list[str]"
_OrderedStrSequence: TypeAlias = str | dict[str, Any] | Sequence[str]
"""
:meta private:
Expand Down Expand Up @@ -101,7 +99,7 @@ def assert_string_list(dist, attr: str, value: _Sequence) -> None:
assert ''.join(value) != value
except (TypeError, ValueError, AttributeError, AssertionError) as e:
raise DistutilsSetupError(
f"{attr!r} must be of type <{_sequence_type_repr}> (got {value!r})"
f"{attr!r} must be of type <{_Sequence}> (got {value!r})"
) from e


Expand Down Expand Up @@ -926,7 +924,7 @@ def _exclude_misc(self, name: str, value: _Sequence) -> None:
"""Handle 'exclude()' for list/tuple attrs without a special handler"""
if not isinstance(value, _sequence):
raise DistutilsSetupError(
f"{name}: setting must be of type <{_sequence_type_repr}> (got {value!r})"
f"{name}: setting must be of type <{_Sequence}> (got {value!r})"
)
try:
old = getattr(self, name)
Expand All @@ -944,7 +942,7 @@ def _include_misc(self, name: str, value: _Sequence) -> None:

if not isinstance(value, _sequence):
raise DistutilsSetupError(
f"{name}: setting must be of type <{_sequence_type_repr}> (got {value!r})"
f"{name}: setting must be of type <{_Sequence}> (got {value!r})"
)
try:
old = getattr(self, name)
Expand Down Expand Up @@ -986,7 +984,7 @@ def exclude(self, **attrs) -> None:
def _exclude_packages(self, packages: _Sequence) -> None:
if not isinstance(packages, _sequence):
raise DistutilsSetupError(
f"packages: setting must be of type <{_sequence_type_repr}> (got {packages!r})"
f"packages: setting must be of type <{_Sequence}> (got {packages!r})"
)
list(map(self.exclude_package, packages))

Expand Down
Loading