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
5 changes: 1 addition & 4 deletions setuptools/_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
import contextlib
import os
import sys
from typing import TYPE_CHECKING, TypeVar
from typing import TypeAlias, TypeVar

from more_itertools import unique_everseen

if TYPE_CHECKING:
from typing import TypeAlias

StrPath: TypeAlias = str | os.PathLike[str] # Same as _typeshed.StrPath
StrPathT = TypeVar("StrPathT", bound=str | os.PathLike[str])

Expand Down
5 changes: 1 addition & 4 deletions setuptools/_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

from collections.abc import Callable, Iterable, Iterator
from functools import lru_cache
from typing import TYPE_CHECKING, TypeVar, overload
from typing import TypeAlias, TypeVar, overload

import jaraco.text as text
from packaging.requirements import Requirement

if TYPE_CHECKING:
from typing import TypeAlias

_T = TypeVar("_T")
_StrOrIter: TypeAlias = str | Iterable[str]

Expand Down
5 changes: 1 addition & 4 deletions setuptools/build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import warnings
from collections.abc import Iterable, Iterator, Mapping
from pathlib import Path
from typing import TYPE_CHECKING, NoReturn
from typing import NoReturn, TypeAlias

import setuptools

Expand All @@ -51,9 +51,6 @@
import distutils
from distutils.util import strtobool

if TYPE_CHECKING:
from typing import TypeAlias

__all__ = [
'get_requires_for_build_sdist',
'get_requires_for_build_wheel',
Expand Down
4 changes: 1 addition & 3 deletions setuptools/command/bdist_egg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from collections.abc import Iterator
from sysconfig import get_path, get_platform, get_python_version
from types import CodeType
from typing import TYPE_CHECKING, AnyStr, Literal
from typing import TYPE_CHECKING, AnyStr, Literal, TypeAlias

from setuptools import Command
from setuptools.extension import Library
Expand All @@ -23,8 +23,6 @@
from distutils.dir_util import mkpath, remove_tree

if TYPE_CHECKING:
from typing import TypeAlias

from _typeshed import GenericPath

# Same as zipfile._ZipFileMode from typeshed
Expand Down
4 changes: 1 addition & 3 deletions setuptools/compat/py311.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import shutil
import sys
from collections.abc import Callable
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, TypeAlias

if TYPE_CHECKING:
from typing import TypeAlias

from _typeshed import ExcInfo, StrOrBytesPath

# Same as shutil._OnExcCallback from typeshed
Expand Down
4 changes: 1 addition & 3 deletions setuptools/config/_apply_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from inspect import cleandoc
from itertools import chain
from types import MappingProxyType
from typing import TYPE_CHECKING, Any, TypeVar
from typing import TYPE_CHECKING, Any, TypeAlias, TypeVar

from .. import _static
from .._path import StrPath
Expand All @@ -27,12 +27,10 @@
from ..warnings import SetuptoolsDeprecationWarning, SetuptoolsWarning

if TYPE_CHECKING:
from typing import TypeAlias

from setuptools._importlib import metadata
from setuptools.dist import Distribution

from distutils.dist import _OptionsList # Comes from typeshed

Check warning on line 33 in setuptools/config/_apply_pyprojecttoml.py

View workflow job for this annotation

GitHub Actions / pyright (3.14, ubuntu-latest)

"_OptionsList" is unknown import symbol (reportAttributeAccessIssue)

Check warning on line 33 in setuptools/config/_apply_pyprojecttoml.py

View workflow job for this annotation

GitHub Actions / pyright (3.14, ubuntu-latest)

Import "distutils.dist" could not be resolved from source (reportMissingModuleSource)


EMPTY: Mapping = MappingProxyType({}) # Immutable dict-like
Expand Down Expand Up @@ -405,7 +403,7 @@
>>> _attrgetter("d")(obj) is None
True
"""
return partial(reduce, lambda acc, x: getattr(acc, x, None), attr.split("."))

Check warning on line 406 in setuptools/config/_apply_pyprojecttoml.py

View workflow job for this annotation

GitHub Actions / pyright (3.14, ubuntu-latest)

No overloads for "getattr" match the provided arguments (reportCallIssue)

Check warning on line 406 in setuptools/config/_apply_pyprojecttoml.py

View workflow job for this annotation

GitHub Actions / pyright (3.10, ubuntu-latest)

Argument of type "_S@reduce" cannot be assigned to parameter "name" of type "str" in function "getattr"   "object*" is not assignable to "str" (reportArgumentType)

Check warning on line 406 in setuptools/config/_apply_pyprojecttoml.py

View workflow job for this annotation

GitHub Actions / pyright (3.10, ubuntu-latest)

No overloads for "getattr" match the provided arguments (reportCallIssue)


def _some_attrgetter(*items):
Expand Down
4 changes: 1 addition & 3 deletions setuptools/config/setupcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from collections import defaultdict
from collections.abc import Callable, Iterable, Iterator
from functools import partial, wraps
from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypeVar, cast
from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypeAlias, TypeVar, cast

from packaging.markers import default_environment as marker_env
from packaging.requirements import InvalidRequirement, Requirement
Expand All @@ -31,8 +31,6 @@
from . import expand

if TYPE_CHECKING:
from typing import TypeAlias

from setuptools.dist import Distribution

from distutils.dist import DistributionMetadata
Expand Down
6 changes: 1 addition & 5 deletions setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from collections.abc import Iterable, Iterator, MutableMapping, Sequence
from glob import glob
from pathlib import Path
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, TypeAlias

from more_itertools import partition, unique_everseen
from packaging.markers import InvalidMarker, Marker
Expand Down Expand Up @@ -43,10 +43,6 @@
from distutils.fancy_getopt import translate_longopt
from distutils.util import strtobool

if TYPE_CHECKING:
from typing import TypeAlias


__all__ = ['Distribution']

_sequence = tuple, list
Expand Down
5 changes: 1 addition & 4 deletions setuptools/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
from datetime import date
from inspect import cleandoc
from textwrap import indent
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import TypeAlias
from typing import TypeAlias

_DueDate: TypeAlias = tuple[int, int, int] # time tuple
_INDENT = 8 * " "
Expand Down
Loading