Skip to content

Vendor distutils stubs #4691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
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
3 changes: 1 addition & 2 deletions _distutils_hack/__init__.py
Original file line number Diff line number Diff line change
@@ -3,8 +3,7 @@
import sys

report_url = (
"https://github.com/pypa/setuptools/issues/new?"
"template=distutils-deprecation.yml"
"https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml"
)


@@ -74,7 +73,7 @@

# check that submodules load as expected
core = importlib.import_module('distutils.core')
assert '_distutils' in core.__file__, core.__file__

Check warning on line 76 in _distutils_hack/__init__.py

GitHub Actions / pyright (3.8, ubuntu-latest)

Operator "in" not supported for types "Literal['_distutils']" and "str | None"   Operator "in" not supported for types "Literal['_distutils']" and "None" (reportOperatorIssue)

Check warning on line 76 in _distutils_hack/__init__.py

GitHub Actions / pyright (3.12, ubuntu-latest)

Operator "in" not supported for types "Literal['_distutils']" and "str | None"   Operator "in" not supported for types "Literal['_distutils']" and "None" (reportOperatorIssue)
assert 'setuptools._distutils.log' not in sys.modules


@@ -213,7 +212,7 @@


def add_shim():
DISTUTILS_FINDER in sys.meta_path or insert_shim()

Check warning on line 215 in _distutils_hack/__init__.py

GitHub Actions / pyright (3.8, ubuntu-latest)

Expression value is unused (reportUnusedExpression)

Check warning on line 215 in _distutils_hack/__init__.py

GitHub Actions / pyright (3.12, ubuntu-latest)

Expression value is unused (reportUnusedExpression)


class shim:
14 changes: 5 additions & 9 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
strict = False

# Early opt-in even when strict = False
# warn_unused_ignores = True # Disabled until we have distutils stubs for Python 3.12+
warn_unused_ignores = True
warn_redundant_casts = True
enable_error_code = ignore-without-code

@@ -18,6 +18,9 @@ disable_error_code =

## local

# Use our custom stubs for distutils
mypy_path = $MYPY_CONFIG_FILE_DIR/typings
Comment on lines +21 to +22
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used pyright's default of typings so that I didn't have to configure it there. But that folder name can be arbitrary.


# 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.8
@@ -48,17 +51,10 @@ disable_error_code =
[mypy-pkg_resources.tests.*]
disable_error_code = import-not-found

# - distutils doesn't exist on Python 3.12, unfortunately, this means typing
# will be missing for subclasses of distutils on Python 3.12 until either:
# - support for `SETUPTOOLS_USE_DISTUTILS=stdlib` is dropped (#3625)
# for setuptools to import `_distutils` directly
# - or non-stdlib distutils typings are exposed
[mypy-distutils.*]
ignore_missing_imports = True

# - wheel: does not intend on exposing a programmatic API https://github.com/pypa/wheel/pull/610#issuecomment-2081687671
[mypy-wheel.*]
ignore_missing_imports = True

# - The following are not marked as py.typed:
# - jaraco: Since mypy 1.12, the root name of the untyped namespace package gets called-out too
# - jaraco.develop: https://github.com/jaraco/jaraco.develop/issues/22
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -133,6 +133,8 @@ type = [

# local

# Referenced in distutils-stubs
"types-docutils",
# pin mypy version so a new version doesn't suddenly cause the CI to fail,
# until types-setuptools is removed from typeshed.
# For help with static-typing issues, or mypy update, ping @Avasam
@@ -203,6 +205,8 @@ include-package-data = true
include = [
"setuptools*",
"pkg_resources*",
# TODO: Include distutils stubs with package once we're confident in them
# "typings/distutils-stubs",
Comment on lines +208 to +209
Copy link
Contributor Author

@Avasam Avasam Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to ship anything as long as typeshed provides stubs for setuptools/_distutils. We can synchronize once ready.
As I mentioned in the issue, there's also always the option to ship it as a different package (in which case it could live completely separately from setuptools and pypa/distutils)

"_distutils_hack*",
]
exclude = [
2 changes: 2 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@
],
// Our testing setup doesn't allow passing CLI arguments, so local devs have to set this manually.
// "pythonVersion": "3.8",
// Allow using distutils-stubs on Python 3.12+
"reportMissingModuleSource": false,
// For now we don't mind if mypy's `type: ignore` comments accidentally suppresses pyright issues
"enableTypeIgnoreComments": true,
"typeCheckingMode": "basic",
3 changes: 3 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -34,6 +34,9 @@ ignore = [
# Only enforcing return type annotations for public functions
"ANN202", # missing-return-type-private-function
"ANN204", # missing-return-type-special-method
# Typeshed doesn't want complex or non-literal defaults for maintenance and testing reasons.
# This doesn't affect us, let's have more complete stubs.
"PYI011", # typed-argument-default-in-stub

# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
7 changes: 1 addition & 6 deletions setuptools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
"""Extensions to the 'distutils' for large or complex distributions"""
# mypy: disable_error_code=override
# Command.reinitialize_command has an extra **kw param that distutils doesn't have
# Can't disable on the exact line because distutils doesn't exists on Python 3.12
# and mypy isn't aware of distutils_hack, causing distutils.core.Command to be Any,
# and a [unused-ignore] to be raised on 3.12+

from __future__ import annotations

@@ -213,7 +208,7 @@ def ensure_string_list(self, option: str):
"'%s' must be a list of strings (got %r)" % (option, val)
)

@overload
@overload # type: ignore[override] # Has an extra **kw param that distutils doesn't have
def reinitialize_command(
self, command: str, reinit_subcommands: bool = False, **kw
) -> _Command: ...
2 changes: 1 addition & 1 deletion setuptools/command/build_py.py
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ def find_data_files(self, package, src_dir):
)
return self.exclude_data_files(package, src_dir, files)

def get_outputs(self, include_bytecode: bool = True) -> list[str]: # type: ignore[override] # Using a real boolean instead of 0|1
def get_outputs(self, include_bytecode: bool = True) -> list[str]:
"""See :class:`setuptools.commands.build.SubCommand`"""
if self.editable_mode:
return list(self.get_output_mapping().keys())
7 changes: 3 additions & 4 deletions setuptools/command/install_lib.py
Original file line number Diff line number Diff line change
@@ -95,10 +95,9 @@ def copy_tree(
self,
infile: StrPath,
outfile: str,
# override: Using actual booleans
preserve_mode: bool = True, # type: ignore[override]
preserve_times: bool = True, # type: ignore[override]
preserve_symlinks: bool = False, # type: ignore[override]
preserve_mode: bool = True,
preserve_times: bool = True,
preserve_symlinks: bool = False,
level: object = 1,
) -> list[str]:
assert preserve_mode and preserve_times and not preserve_symlinks
5 changes: 1 addition & 4 deletions setuptools/config/setupcfg.py
Original file line number Diff line number Diff line change
@@ -24,10 +24,8 @@
Generic,
Iterable,
Iterator,
List,
Tuple,
TypeVar,
cast,
)

from packaging.markers import default_environment as marker_env
@@ -112,8 +110,7 @@ def _apply(
filenames = [*other_files, filepath]

try:
# TODO: Temporary cast until mypy 1.12 is released with upstream fixes from typeshed
_Distribution.parse_config_files(dist, filenames=cast(List[str], filenames))
_Distribution.parse_config_files(dist, filenames=filenames)
handlers = parse_configuration(
dist, dist.command_options, ignore_option_errors=ignore_option_errors
)
8 changes: 4 additions & 4 deletions setuptools/errors.py
Original file line number Diff line number Diff line change
@@ -30,15 +30,15 @@
BaseError = _distutils_errors.DistutilsError


class InvalidConfigError(OptionError): # type: ignore[valid-type, misc] # distutils imports are `Any` on python 3.12+
class InvalidConfigError(OptionError):
"""Error used for invalid configurations."""


class RemovedConfigError(OptionError): # type: ignore[valid-type, misc] # distutils imports are `Any` on python 3.12+
class RemovedConfigError(OptionError):
"""Error used for configurations that were deprecated and removed."""


class RemovedCommandError(BaseError, RuntimeError): # type: ignore[valid-type, misc] # distutils imports are `Any` on python 3.12+
class RemovedCommandError(BaseError, RuntimeError):
"""Error used for commands that have been removed in setuptools.

Since ``setuptools`` is built on ``distutils``, simply removing a command
@@ -48,7 +48,7 @@ class RemovedCommandError(BaseError, RuntimeError): # type: ignore[valid-type,
"""


class PackageDiscoveryError(BaseError, RuntimeError): # type: ignore[valid-type, misc] # distutils imports are `Any` on python 3.12+
class PackageDiscoveryError(BaseError, RuntimeError):
"""Impossible to perform automatic discovery of packages and/or modules.

The current project layout or given discovery options can lead to problems when
Empty file.
25 changes: 25 additions & 0 deletions typings/distutils-stubs/_modified.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from collections.abc import Callable, Iterable
from typing import Literal, TypeVar

from _typeshed import StrOrBytesPath

_SourcesT = TypeVar("_SourcesT", bound=StrOrBytesPath)
_TargetsT = TypeVar("_TargetsT", bound=StrOrBytesPath)

def newer(source: StrOrBytesPath, target: StrOrBytesPath) -> bool: ...
def newer_pairwise(
sources: Iterable[_SourcesT],
targets: Iterable[_TargetsT],
newer: Callable[[_SourcesT, _TargetsT], bool] = newer,
) -> tuple[list[_SourcesT], list[_TargetsT]]: ...
def newer_group(
sources: Iterable[StrOrBytesPath],
target: StrOrBytesPath,
missing: Literal["error", "ignore", "newer"] = "error",
) -> bool: ...
def newer_pairwise_group(
sources: Iterable[_SourcesT],
targets: Iterable[_TargetsT],
*,
newer: Callable[[_SourcesT, _TargetsT], bool] = newer,
) -> tuple[list[_SourcesT], list[_TargetsT]]: ...
38 changes: 38 additions & 0 deletions typings/distutils-stubs/archive_util.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from typing import Literal, overload

from _typeshed import StrOrBytesPath, StrPath

@overload
def make_archive(
base_name: str,
format: str,
root_dir: StrOrBytesPath | None = None,
base_dir: str | None = None,
verbose: bool = False,
dry_run: bool = False,
owner: str | None = None,
group: str | None = None,
) -> str: ...
@overload
def make_archive(
base_name: StrPath,
format: str,
root_dir: StrOrBytesPath,
base_dir: str | None = None,
verbose: bool = False,
dry_run: bool = False,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_tarball(
base_name: str,
base_dir: StrPath,
compress: Literal["gzip", "bzip2", "xz"] | None = "gzip",
verbose: bool = False,
dry_run: bool = False,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_zipfile(
base_name: str, base_dir: str, verbose: bool = False, dry_run: bool = False
) -> str: ...
3 changes: 3 additions & 0 deletions typings/distutils-stubs/bcppcompiler.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .ccompiler import CCompiler

class BCPPCompiler(CCompiler): ...
215 changes: 215 additions & 0 deletions typings/distutils-stubs/ccompiler.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
from collections.abc import Callable, Iterable
from typing import ClassVar, Literal, TypeVar, overload

from _typeshed import BytesPath, StrPath, Unused
from typing_extensions import TypeAlias, TypeVarTuple, Unpack

_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
_StrPathT = TypeVar("_StrPathT", bound=StrPath)
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
_Ts = TypeVarTuple("_Ts")

def gen_lib_options(
compiler: CCompiler,
library_dirs: list[str],
runtime_library_dirs: list[str],
libraries: list[str],
) -> list[str]: ...
def gen_preprocess_options(
macros: list[_Macro], include_dirs: list[str]
) -> list[str]: ...
def get_default_compiler(
osname: str | None = None, platform: str | None = None
) -> str: ...
def new_compiler(
plat: str | None = None,
compiler: str | None = None,
verbose: bool = False,
dry_run: bool = False,
force: bool = False,
) -> CCompiler: ...
def show_compilers() -> None: ...

class CCompiler:
src_extensions: ClassVar[list[str] | None]
obj_extension: ClassVar[str | None]
static_lib_extension: ClassVar[str | None]
shared_lib_extension: ClassVar[str | None]
static_lib_format: ClassVar[str | None]
shared_lib_format: ClassVar[str | None]
exe_extension: ClassVar[str | None]
language_map: ClassVar[dict[str, str]]
language_order: ClassVar[list[str]]
dry_run: bool
force: bool
verbose: bool
output_dir: str | None
macros: list[_Macro]
include_dirs: list[str]
libraries: list[str]
library_dirs: list[str]
runtime_library_dirs: list[str]
objects: list[str]
def __init__(
self, verbose: bool = False, dry_run: bool = False, force: bool = False
) -> None: ...
def add_include_dir(self, dir: str) -> None: ...
def set_include_dirs(self, dirs: list[str]) -> None: ...
def add_library(self, libname: str) -> None: ...
def set_libraries(self, libnames: list[str]) -> None: ...
def add_library_dir(self, dir: str) -> None: ...
def set_library_dirs(self, dirs: list[str]) -> None: ...
def add_runtime_library_dir(self, dir: str) -> None: ...
def set_runtime_library_dirs(self, dirs: list[str]) -> None: ...
def define_macro(self, name: str, value: str | None = None) -> None: ...
def undefine_macro(self, name: str) -> None: ...
def add_link_object(self, object: str) -> None: ...
def set_link_objects(self, objects: list[str]) -> None: ...
def detect_language(self, sources: str | list[str]) -> str | None: ...
def find_library_file(
self, dirs: list[str], lib: str, debug: bool = False
) -> str | None: ...
def has_function(
self,
funcname: str,
includes: list[str] | None = None,
include_dirs: list[str] | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
) -> bool: ...
def library_dir_option(self, dir: str) -> str: ...
def library_option(self, lib: str) -> str: ...
def runtime_library_dir_option(self, dir: str) -> str: ...
def set_executables(self, **args: str) -> None: ...
def compile(
self,
sources: list[str],
output_dir: str | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
depends: list[str] | None = None,
) -> list[str]: ...
def create_static_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = None,
debug: bool = False,
target_lang: str | None = None,
) -> None: ...
def link(
self,
target_desc: str,
objects: list[str],
output_filename: str,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def link_executable(
self,
objects: list[str],
output_progname: str,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_object(
self,
objects: list[str],
output_filename: str,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def preprocess(
self,
source: str,
output_file: str | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | None = None,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
) -> None: ...
@overload
def executable_filename(
self, basename: str, strip_dir: Literal[False] = False, output_dir: StrPath = ""
) -> str: ...
@overload
def executable_filename(
self, basename: StrPath, strip_dir: Literal[True], output_dir: StrPath = ""
) -> str: ...
def library_filename(
self,
libname: str,
lib_type: str = "static",
strip_dir: bool = False,
output_dir: StrPath = "",
) -> str: ...
def object_filenames(
self,
source_filenames: Iterable[StrPath],
strip_dir: bool = False,
output_dir: StrPath | None = '',
) -> list[str]: ...
@overload
def shared_object_filename(
self, basename: str, strip_dir: Literal[False] = False, output_dir: StrPath = ""
) -> str: ...
@overload
def shared_object_filename(
self, basename: StrPath, strip_dir: Literal[True], output_dir: StrPath = ""
) -> str: ...
def execute(
self,
func: Callable[[Unpack[_Ts]], Unused],
args: tuple[Unpack[_Ts]],
msg: str | None = None,
level: int = 1,
) -> None: ...
def spawn(self, cmd: list[str]) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
@overload
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
@overload
def move_file(self, src: BytesPath, dst: _BytesPathT) -> _BytesPathT | bytes: ...
def announce(self, msg: str, level: int = 1) -> None: ...
def warn(self, msg: str) -> None: ...
def debug_print(self, msg: str) -> None: ...
309 changes: 309 additions & 0 deletions typings/distutils-stubs/cmd.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
from abc import abstractmethod
from collections.abc import Callable, Iterable
from typing import Any, ClassVar, Literal, TypeVar, overload

from _typeshed import BytesPath, StrOrBytesPath, StrPath, Unused
from typing_extensions import TypeVarTuple, Unpack

from .command.bdist import bdist
from .command.bdist_dumb import bdist_dumb
from .command.bdist_rpm import bdist_rpm
from .command.build import build
from .command.build_clib import build_clib
from .command.build_ext import build_ext
from .command.build_py import build_py
from .command.build_scripts import build_scripts
from .command.check import check
from .command.clean import clean
from .command.config import config
from .command.install import install
from .command.install_data import install_data
from .command.install_egg_info import install_egg_info
from .command.install_headers import install_headers
from .command.install_lib import install_lib
from .command.install_scripts import install_scripts
from .command.register import register
from .command.sdist import sdist
from .command.upload import upload
from .dist import Distribution

_StrPathT = TypeVar("_StrPathT", bound=StrPath)
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
_CommandT = TypeVar("_CommandT", bound=Command)
_Ts = TypeVarTuple("_Ts")

class Command:
dry_run: bool # Exposed from __getattr_. Same as Distribution.dry_run
distribution: Distribution
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
def __init__(self, dist: Distribution) -> None: ...
def ensure_finalized(self) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
@abstractmethod
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...
def announce(self, msg: str, level: int = 10) -> None: ...
def debug_print(self, msg: str) -> None: ...
def ensure_string(self, option: str, default: str | None = None) -> None: ...
def ensure_string_list(self, option: str) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
def set_undefined_options(
self, src_cmd: str, *option_pairs: tuple[str, str]
) -> None: ...
# NOTE: This list comes directly from the distutils/command folder. Minus bdist_msi and bdist_wininst.
@overload
def get_finalized_command(
self, command: Literal["bdist"], create: bool = True
) -> bdist: ...
@overload
def get_finalized_command(
self, command: Literal["bdist_dumb"], create: bool = True
) -> bdist_dumb: ...
@overload
def get_finalized_command(
self, command: Literal["bdist_rpm"], create: bool = True
) -> bdist_rpm: ...
@overload
def get_finalized_command(
self, command: Literal["build"], create: bool = True
) -> build: ...
@overload
def get_finalized_command(
self, command: Literal["build_clib"], create: bool = True
) -> build_clib: ...
@overload
def get_finalized_command(
self, command: Literal["build_ext"], create: bool = True
) -> build_ext: ...
@overload
def get_finalized_command(
self, command: Literal["build_py"], create: bool = True
) -> build_py: ...
@overload
def get_finalized_command(
self, command: Literal["build_scripts"], create: bool = True
) -> build_scripts: ...
@overload
def get_finalized_command(
self, command: Literal["check"], create: bool = True
) -> check: ...
@overload
def get_finalized_command(
self, command: Literal["clean"], create: bool = True
) -> clean: ...
@overload
def get_finalized_command(
self, command: Literal["config"], create: bool = True
) -> config: ...
@overload
def get_finalized_command(
self, command: Literal["install"], create: bool = True
) -> install: ...
@overload
def get_finalized_command(
self, command: Literal["install_data"], create: bool = True
) -> install_data: ...
@overload
def get_finalized_command(
self, command: Literal["install_egg_info"], create: bool = True
) -> install_egg_info: ...
@overload
def get_finalized_command(
self, command: Literal["install_headers"], create: bool = True
) -> install_headers: ...
@overload
def get_finalized_command(
self, command: Literal["install_lib"], create: bool = True
) -> install_lib: ...
@overload
def get_finalized_command(
self, command: Literal["install_scripts"], create: bool = True
) -> install_scripts: ...
@overload
def get_finalized_command(
self, command: Literal["register"], create: bool = True
) -> register: ...
@overload
def get_finalized_command(
self, command: Literal["sdist"], create: bool = True
) -> sdist: ...
@overload
def get_finalized_command(
self, command: Literal["upload"], create: bool = True
) -> upload: ...
@overload
def get_finalized_command(self, command: str, create: bool = True) -> Command: ...
@overload
def reinitialize_command(
self, command: Literal["bdist"], reinit_subcommands: bool = False
) -> bdist: ...
@overload
def reinitialize_command(
self, command: Literal["bdist_dumb"], reinit_subcommands: bool = False
) -> bdist_dumb: ...
@overload
def reinitialize_command(
self, command: Literal["bdist_rpm"], reinit_subcommands: bool = False
) -> bdist_rpm: ...
@overload
def reinitialize_command(
self, command: Literal["build"], reinit_subcommands: bool = False
) -> build: ...
@overload
def reinitialize_command(
self, command: Literal["build_clib"], reinit_subcommands: bool = False
) -> build_clib: ...
@overload
def reinitialize_command(
self, command: Literal["build_ext"], reinit_subcommands: bool = False
) -> build_ext: ...
@overload
def reinitialize_command(
self, command: Literal["build_py"], reinit_subcommands: bool = False
) -> build_py: ...
@overload
def reinitialize_command(
self, command: Literal["build_scripts"], reinit_subcommands: bool = False
) -> build_scripts: ...
@overload
def reinitialize_command(
self, command: Literal["check"], reinit_subcommands: bool = False
) -> check: ...
@overload
def reinitialize_command(
self, command: Literal["clean"], reinit_subcommands: bool = False
) -> clean: ...
@overload
def reinitialize_command(
self, command: Literal["config"], reinit_subcommands: bool = False
) -> config: ...
@overload
def reinitialize_command(
self, command: Literal["install"], reinit_subcommands: bool = False
) -> install: ...
@overload
def reinitialize_command(
self, command: Literal["install_data"], reinit_subcommands: bool = False
) -> install_data: ...
@overload
def reinitialize_command(
self, command: Literal["install_egg_info"], reinit_subcommands: bool = False
) -> install_egg_info: ...
@overload
def reinitialize_command(
self, command: Literal["install_headers"], reinit_subcommands: bool = False
) -> install_headers: ...
@overload
def reinitialize_command(
self, command: Literal["install_lib"], reinit_subcommands: bool = False
) -> install_lib: ...
@overload
def reinitialize_command(
self, command: Literal["install_scripts"], reinit_subcommands: bool = False
) -> install_scripts: ...
@overload
def reinitialize_command(
self, command: Literal["register"], reinit_subcommands: bool = False
) -> register: ...
@overload
def reinitialize_command(
self, command: Literal["sdist"], reinit_subcommands: bool = False
) -> sdist: ...
@overload
def reinitialize_command(
self, command: Literal["upload"], reinit_subcommands: bool = False
) -> upload: ...
@overload
def reinitialize_command(
self, command: str, reinit_subcommands: bool = False
) -> Command: ...
@overload
def reinitialize_command(
self, command: _CommandT, reinit_subcommands: bool = False
) -> _CommandT: ...
def run_command(self, command: str) -> None: ...
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: str) -> None: ...
def execute(
self,
func: Callable[[Unpack[_Ts]], Unused],
args: tuple[Unpack[_Ts]],
msg: str | None = None,
level: int = 1,
) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
@overload
def copy_file(
self,
infile: StrPath,
outfile: _StrPathT,
preserve_mode: bool = True,
preserve_times: bool = True,
link: str | None = None,
level: Unused = 1,
) -> tuple[_StrPathT | str, bool]: ...
@overload
def copy_file(
self,
infile: BytesPath,
outfile: _BytesPathT,
preserve_mode: bool = True,
preserve_times: bool = True,
link: str | None = None,
level: Unused = 1,
) -> tuple[_BytesPathT | bytes, bool]: ...
def copy_tree(
self,
infile: StrPath,
outfile: str,
preserve_mode: bool = True,
preserve_times: bool = True,
preserve_symlinks: bool = False,
level: Unused = 1,
) -> list[str]: ...
@overload
def move_file(
self, src: StrPath, dst: _StrPathT, level: Unused = 1
) -> _StrPathT | str: ...
@overload
def move_file(
self, src: BytesPath, dst: _BytesPathT, level: Unused = 1
) -> _BytesPathT | bytes: ...
def spawn(
self, cmd: Iterable[str], search_path: bool = True, level: Unused = 1
) -> None: ...
@overload
def make_archive(
self,
base_name: str,
format: str,
root_dir: StrOrBytesPath | None = None,
base_dir: str | None = None,
owner: str | None = None,
group: str | None = None,
) -> str: ...
@overload
def make_archive(
self,
base_name: StrPath,
format: str,
root_dir: StrOrBytesPath,
base_dir: str | None = None,
owner: str | None = None,
group: str | None = None,
) -> str: ...
def make_file(
self,
infiles: str | list[str] | tuple[str, ...],
outfile: StrOrBytesPath,
func: Callable[[Unpack[_Ts]], Unused],
args: tuple[Unpack[_Ts]],
exec_msg: str | None = None,
skip_msg: str | None = None,
level: Unused = 1,
) -> None: ...
41 changes: 41 additions & 0 deletions typings/distutils-stubs/command/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from . import (
bdist,
bdist_dumb,
bdist_rpm,
build,
build_clib,
build_ext,
build_py,
build_scripts,
check,
clean,
install,
install_data,
install_headers,
install_lib,
install_scripts,
register,
sdist,
upload,
)

__all__ = [
"build",
"build_py",
"build_ext",
"build_clib",
"build_scripts",
"clean",
"install",
"install_lib",
"install_headers",
"install_scripts",
"install_data",
"sdist",
"register",
"bdist",
"bdist_dumb",
"bdist_rpm",
"check",
"upload",
]
27 changes: 27 additions & 0 deletions typings/distutils-stubs/command/bdist.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from collections.abc import Callable
from typing import ClassVar

from _typeshed import Unused
from typing_extensions import deprecated

from ..cmd import Command

def show_formats() -> None: ...

class ListCompat(dict[str, tuple[str, str]]):
@deprecated("format_commands is now a dict. append is deprecated")
def append(self, item: Unused) -> None: ...

class bdist(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[str, str | None, str | None]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
no_format_option: ClassVar[tuple[str, ...]]
default_format: ClassVar[dict[str, str]]
format_commands: ClassVar[ListCompat]
format_command = format_commands

def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
23 changes: 23 additions & 0 deletions typings/distutils-stubs/command/bdist_dumb.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class bdist_dumb(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
default_format: ClassVar[dict[str, str]]
bdist_dir: Incomplete
plat_name: Incomplete
format: Incomplete
keep_temp: int
dist_dir: Incomplete
skip_build: Incomplete
relative: int
owner: Incomplete
group: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
Empty file.
54 changes: 54 additions & 0 deletions typings/distutils-stubs/command/bdist_rpm.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class bdist_rpm(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
bdist_base: Incomplete
rpm_base: Incomplete
dist_dir: Incomplete
python: Incomplete
fix_python: Incomplete
spec_only: Incomplete
binary_only: Incomplete
source_only: Incomplete
use_bzip2: Incomplete
distribution_name: Incomplete
group: Incomplete
release: Incomplete
serial: Incomplete
vendor: Incomplete
packager: Incomplete
doc_files: Incomplete
changelog: Incomplete
icon: Incomplete
prep_script: Incomplete
build_script: Incomplete
install_script: Incomplete
clean_script: Incomplete
verify_script: Incomplete
pre_install: Incomplete
post_install: Incomplete
pre_uninstall: Incomplete
post_uninstall: Incomplete
prep: Incomplete
provides: Incomplete
requires: Incomplete
conflicts: Incomplete
build_requires: Incomplete
obsoletes: Incomplete
keep_temp: int
use_rpm_opt_flags: int
rpm3_mode: int
no_autoreq: int
force_arch: Incomplete
quiet: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def finalize_package_data(self) -> None: ...
def run(self) -> None: ...
33 changes: 33 additions & 0 deletions typings/distutils-stubs/command/build.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from collections.abc import Callable
from typing import ClassVar

from _typeshed import Incomplete, Unused

from ..cmd import Command

def show_compilers() -> None: ...

class build(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
build_base: str
build_purelib: Incomplete
build_platlib: Incomplete
build_lib: Incomplete
build_temp: Incomplete
build_scripts: Incomplete
compiler: Incomplete
plat_name: Incomplete
debug: Incomplete
force: int
executable: Incomplete
parallel: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def has_pure_modules(self): ...
def has_c_libraries(self): ...
def has_ext_modules(self): ...
def has_scripts(self): ...
28 changes: 28 additions & 0 deletions typings/distutils-stubs/command/build_clib.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from collections.abc import Callable
from typing import ClassVar

from _typeshed import Incomplete, Unused

from ..cmd import Command

class build_clib(Command):
description: str
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
build_clib: Incomplete
build_temp: Incomplete
libraries: Incomplete
include_dirs: Incomplete
define: Incomplete
undef: Incomplete
debug: Incomplete
force: int
compiler: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_library_list(self, libraries) -> None: ...
def get_library_names(self): ...
def get_source_files(self): ...
def build_libraries(self, libraries) -> None: ...
50 changes: 50 additions & 0 deletions typings/distutils-stubs/command/build_ext.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from collections.abc import Callable
from typing import ClassVar

from _typeshed import Incomplete, Unused

from ..cmd import Command
from ..extension import Extension

class build_ext(Command):
description: str
sep_by: Incomplete
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
extensions: Incomplete
build_lib: Incomplete
plat_name: Incomplete
build_temp: Incomplete
inplace: int
package: Incomplete
include_dirs: Incomplete
define: Incomplete
undef: Incomplete
libraries: Incomplete
library_dirs: Incomplete
rpath: Incomplete
link_objects: Incomplete
debug: Incomplete
force: Incomplete
compiler: Incomplete
swig: Incomplete
swig_cpp: Incomplete
swig_opts: Incomplete
user: Incomplete
parallel: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_extensions_list(self, extensions) -> None: ...
def get_source_files(self): ...
def get_outputs(self): ...
def build_extensions(self) -> None: ...
def build_extension(self, ext) -> None: ...
def swig_sources(self, sources, extension): ...
def find_swig(self): ...
def get_ext_fullpath(self, ext_name: str) -> str: ...
def get_ext_fullname(self, ext_name: str) -> str: ...
def get_ext_filename(self, ext_name: str) -> str: ...
def get_export_symbols(self, ext: Extension) -> list[str]: ...
def get_libraries(self, ext: Extension) -> list[str]: ...
40 changes: 40 additions & 0 deletions typings/distutils-stubs/command/build_py.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class build_py(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
build_lib: Incomplete
py_modules: Incomplete
package: Incomplete
package_data: Incomplete
package_dir: Incomplete
compile: int
optimize: int
force: Incomplete
def initialize_options(self) -> None: ...
packages: Incomplete
data_files: Incomplete
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_data_files(self): ...
def find_data_files(self, package, src_dir): ...
def build_package_data(self) -> None: ...
def get_package_dir(self, package): ...
def check_package(self, package, package_dir): ...
def check_module(self, module, module_file): ...
def find_package_modules(self, package, package_dir): ...
def find_modules(self): ...
def find_all_modules(self): ...
def get_source_files(self): ...
def get_module_outfile(self, build_dir, package, module): ...
def get_outputs(self, include_bytecode: bool = True) -> list[str]: ...
def build_module(self, module, module_file, package): ...
def build_modules(self) -> None: ...
def build_packages(self) -> None: ...
def byte_compile(self, files) -> None: ...
22 changes: 22 additions & 0 deletions typings/distutils-stubs/command/build_scripts.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

first_line_re: Incomplete

class build_scripts(Command):
description: str
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
build_dir: Incomplete
scripts: Incomplete
force: Incomplete
executable: Incomplete
outfiles: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def get_source_files(self): ...
def run(self) -> None: ...
def copy_scripts(self): ...
36 changes: 36 additions & 0 deletions typings/distutils-stubs/command/check.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from typing import ClassVar, Final

from _typeshed import Incomplete
from docutils.utils import Reporter

from ..cmd import Command

class SilentReporter(Reporter):
messages: Incomplete
def __init__(
self,
source,
report_level,
halt_level,
stream: Incomplete | None = ...,
debug: bool = False,
encoding: str = ...,
error_handler: str = ...,
) -> None: ...
def system_message(self, level, message, *children, **kwargs): ...

HAS_DOCUTILS: Final[bool]

class check(Command):
description: str
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
restructuredtext: int
metadata: int
strict: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def warn(self, msg): ...
def run(self) -> None: ...
def check_metadata(self) -> None: ...
def check_restructuredtext(self) -> None: ...
19 changes: 19 additions & 0 deletions typings/distutils-stubs/command/clean.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class clean(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
build_base: Incomplete
build_lib: Incomplete
build_temp: Incomplete
build_scripts: Incomplete
bdist_base: Incomplete
all: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
93 changes: 93 additions & 0 deletions typings/distutils-stubs/command/config.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
from collections.abc import Sequence
from re import Pattern
from typing import ClassVar, Final

from _typeshed import Incomplete, StrOrBytesPath

from ..ccompiler import CCompiler
from ..cmd import Command

LANG_EXT: Final[dict[str, str]]

class config(Command):
description: str
# Tuple is full name, short name, description
user_options: ClassVar[list[tuple[str, str | None, str]]]
compiler: str | CCompiler
cc: str | None
include_dirs: Sequence[str] | None
libraries: Sequence[str] | None
library_dirs: Sequence[str] | None
noisy: int
dump_source: int
temp_files: Sequence[str]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def try_cpp(
self,
body: str | None = None,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def search_cpp(
self,
pattern: Pattern[str] | str,
body: str | None = None,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def try_compile(
self,
body: str,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def try_link(
self,
body: str,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def try_run(
self,
body: str,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...
def check_func(
self,
func: str,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
decl: bool = False,
call: bool = False,
) -> bool: ...
def check_lib(
self,
library: str,
library_dirs: Sequence[str] | None = None,
headers: Sequence[str] | None = None,
include_dirs: Sequence[str] | None = None,
other_libraries: list[str] = [],
) -> bool: ...
def check_header(
self,
header: str,
include_dirs: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
lang: str = "c",
) -> bool: ...

def dump_file(filename: StrOrBytesPath, head: Incomplete | None = None) -> None: ...
60 changes: 60 additions & 0 deletions typings/distutils-stubs/command/install.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class install(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
prefix: str | None
exec_prefix: Incomplete
home: str | None
user: bool
install_base: Incomplete
install_platbase: Incomplete
root: str | None
install_purelib: Incomplete
install_platlib: Incomplete
install_headers: Incomplete
install_lib: str | None
install_scripts: Incomplete
install_data: Incomplete
install_userbase: Incomplete
install_usersite: Incomplete
compile: Incomplete
optimize: Incomplete
extra_path: Incomplete
install_path_file: int
force: int
skip_build: int
warn_dir: int
build_base: Incomplete
build_lib: Incomplete
record: Incomplete
def initialize_options(self) -> None: ...
config_vars: Incomplete
install_libbase: Incomplete
def finalize_options(self) -> None: ...
def dump_dirs(self, msg) -> None: ...
def finalize_unix(self) -> None: ...
def finalize_other(self) -> None: ...
def select_scheme(self, name) -> None: ...
def expand_basedirs(self) -> None: ...
def expand_dirs(self) -> None: ...
def convert_paths(self, *names) -> None: ...
path_file: Incomplete
extra_dirs: Incomplete
def handle_extra_path(self) -> None: ...
def change_roots(self, *names) -> None: ...
def create_home_path(self) -> None: ...
def run(self) -> None: ...
def create_path_file(self) -> None: ...
def get_outputs(self): ...
def get_inputs(self): ...
def has_lib(self): ...
def has_headers(self): ...
def has_scripts(self): ...
def has_data(self): ...
21 changes: 21 additions & 0 deletions typings/distutils-stubs/command/install_data.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class install_data(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Incomplete
outfiles: Incomplete
root: Incomplete
force: int
data_files: Incomplete
warn_dir: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_inputs(self): ...
def get_outputs(self): ...
20 changes: 20 additions & 0 deletions typings/distutils-stubs/command/install_egg_info.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class install_egg_info(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[str, str, str]]]
install_dir: Incomplete
def initialize_options(self) -> None: ...
target: Incomplete
outputs: Incomplete
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_outputs(self) -> list[str]: ...

def safe_name(name): ...
def safe_version(version): ...
def to_filename(name): ...
18 changes: 18 additions & 0 deletions typings/distutils-stubs/command/install_headers.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class install_headers(Command):
description: str
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Incomplete
force: int
outfiles: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_inputs(self): ...
def get_outputs(self): ...
25 changes: 25 additions & 0 deletions typings/distutils-stubs/command/install_lib.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class install_lib(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
install_dir: Incomplete
build_dir: Incomplete
force: int
compile: Incomplete
optimize: Incomplete
skip_build: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def build(self) -> None: ...
def install(self) -> list[str]: ...
def byte_compile(self, files) -> None: ...
def get_outputs(self): ...
def get_inputs(self): ...
20 changes: 20 additions & 0 deletions typings/distutils-stubs/command/install_scripts.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..cmd import Command

class install_scripts(Command):
description: str
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Incomplete
force: int
build_dir: Incomplete
skip_build: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
outfiles: list[str]
def run(self) -> None: ...
def get_inputs(self): ...
def get_outputs(self): ...
24 changes: 24 additions & 0 deletions typings/distutils-stubs/command/register.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from collections.abc import Callable
from typing import Any, ClassVar

from _typeshed import Incomplete

from ..config import PyPIRCCommand

class register(PyPIRCCommand):
description: str
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
list_classifiers: int
strict: int
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_metadata(self) -> None: ...
def classifiers(self) -> None: ...
def verify_metadata(self) -> None: ...
def send_metadata(self) -> None: ...
def build_post_data(self, action): ...
def post_to_server(
self, data, auth: Incomplete | None = None
) -> tuple[int, str]: ...
47 changes: 47 additions & 0 deletions typings/distutils-stubs/command/sdist.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from collections.abc import Callable
from typing import ClassVar

from _typeshed import Incomplete, Unused

from ..cmd import Command

def show_formats() -> None: ...

class sdist(Command):
description: ClassVar[str]

def checking_metadata(self): ...

user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]]
negative_opt: ClassVar[dict[str, str]]
READMES: ClassVar[tuple[str, ...]]
template: Incomplete
manifest: Incomplete
use_defaults: int
prune: int
manifest_only: int
force_manifest: int
formats: Incomplete
keep_temp: int
dist_dir: Incomplete
archive_files: Incomplete
metadata_check: int
owner: Incomplete
group: Incomplete
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
filelist: Incomplete
def run(self) -> None: ...
def get_file_list(self) -> None: ...
def add_defaults(self) -> None: ...
def read_template(self) -> None: ...
def prune_file_list(self) -> None: ...
def write_manifest(self) -> None: ...
def read_manifest(self) -> None: ...
def make_release_tree(self, base_dir, files) -> None: ...
def make_distribution(self) -> None: ...
def get_archive_files(self): ...

def is_comment(line: str) -> bool: ...
19 changes: 19 additions & 0 deletions typings/distutils-stubs/command/upload.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from typing import ClassVar

from _typeshed import Incomplete

from ..config import PyPIRCCommand

class upload(PyPIRCCommand):
description: ClassVar[str]
username: str
password: str
show_response: int
sign: bool
identity: Incomplete
def initialize_options(self) -> None: ...
repository: Incomplete
realm: Incomplete
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def upload_file(self, command: str, pyversion: str, filename: str) -> None: ...
1 change: 1 addition & 0 deletions typings/distutils-stubs/compat/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
def consolidate_linker_args(args: list[str]) -> str | list[str]: ...
18 changes: 18 additions & 0 deletions typings/distutils-stubs/config.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from abc import abstractmethod
from typing import ClassVar

from .cmd import Command

DEFAULT_PYPIRC: str

class PyPIRCCommand(Command):
DEFAULT_REPOSITORY: ClassVar[str]
DEFAULT_REALM: ClassVar[str]
repository: None
realm: None
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...
62 changes: 62 additions & 0 deletions typings/distutils-stubs/core.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from collections.abc import Mapping
from typing import Final

from _typeshed import Incomplete, StrOrBytesPath

from .cmd import Command as Command
from .dist import Distribution as Distribution
from .extension import Extension as Extension

USAGE: Final[str]

def gen_usage(script_name: StrOrBytesPath) -> str: ...

setup_keywords: tuple[str, ...]
extension_keywords: tuple[str, ...]

def setup(
*,
name: str = ...,
version: str = ...,
description: str = ...,
long_description: str = ...,
author: str = ...,
author_email: str = ...,
maintainer: str = ...,
maintainer_email: str = ...,
url: str = ...,
download_url: str = ...,
packages: list[str] = ...,
py_modules: list[str] = ...,
scripts: list[str] = ...,
ext_modules: list[Extension] = ...,
classifiers: list[str] = ...,
distclass: type[Distribution] = ...,
script_name: str = ...,
script_args: list[str] = ...,
options: Mapping[str, Incomplete] = ...,
license: str = ...,
keywords: list[str] | str = ...,
platforms: list[str] | str = ...,
cmdclass: Mapping[str, type[Command]] = ...,
data_files: list[tuple[str, list[str]]] = ...,
package_dir: Mapping[str, str] = ...,
obsoletes: list[str] = ...,
provides: list[str] = ...,
requires: list[str] = ...,
command_packages: list[str] = ...,
command_options: Mapping[str, Mapping[str, tuple[Incomplete, Incomplete]]] = ...,
package_data: Mapping[str, list[str]] = ...,
include_package_data: bool = ...,
libraries: list[str] = ...,
headers: list[str] = ...,
ext_package: str = ...,
include_dirs: list[str] = ...,
password: str = ...,
fullname: str = ...,
# Custom Distributions could accept more params
**attrs: object,
) -> Distribution: ...
def run_setup(
script_name: str, script_args: list[str] | None = None, stop_after: str = "run"
) -> Distribution: ...
21 changes: 21 additions & 0 deletions typings/distutils-stubs/cygwinccompiler.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from re import Pattern
from typing import Final, Literal

from .unixccompiler import UnixCCompiler
from .version import LooseVersion

def get_msvcr() -> list[str] | None: ...

class CygwinCCompiler(UnixCCompiler): ...
class Mingw32CCompiler(CygwinCCompiler): ...

CONFIG_H_OK: Final = "ok"
CONFIG_H_NOTOK: Final = "not ok"
CONFIG_H_UNCERTAIN: Final = "uncertain"

def check_config_h() -> tuple[Literal["ok", "not ok", "uncertain"], str]: ...

RE_VERSION: Final[Pattern[bytes]]

def get_versions() -> tuple[LooseVersion | None, ...]: ...
def is_cygwingcc() -> bool: ...
3 changes: 3 additions & 0 deletions typings/distutils-stubs/debug.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Final

DEBUG: Final[str | None]
5 changes: 5 additions & 0 deletions typings/distutils-stubs/dep_util.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ._modified import (
newer as newer,
newer_group as newer_group,
newer_pairwise as newer_pairwise,
)
30 changes: 30 additions & 0 deletions typings/distutils-stubs/dir_util.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from collections.abc import Iterable

from _typeshed import StrOrBytesPath, StrPath

def mkpath(
name: str,
mode: int = 0o777,
verbose: bool = True,
dry_run: bool = False,
) -> list[str]: ...
def create_tree(
base_dir: StrPath,
files: Iterable[StrPath],
mode: int = 0o777,
verbose: bool = True,
dry_run: bool = False,
) -> None: ...
def copy_tree(
src: StrPath,
dst: str,
preserve_mode: bool = True,
preserve_times: bool = True,
preserve_symlinks: bool = False,
update: bool = False,
verbose: bool = True,
dry_run: bool = False,
) -> list[str]: ...
def remove_tree(
directory: StrOrBytesPath, verbose: bool = True, dry_run: bool = False
) -> None: ...
426 changes: 426 additions & 0 deletions typings/distutils-stubs/dist.pyi

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions typings/distutils-stubs/errors.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class DistutilsError(Exception): ...
class DistutilsModuleError(DistutilsError): ...
class DistutilsClassError(DistutilsError): ...
class DistutilsGetoptError(DistutilsError): ...
class DistutilsArgError(DistutilsError): ...
class DistutilsFileError(DistutilsError): ...
class DistutilsOptionError(DistutilsError): ...
class DistutilsSetupError(DistutilsError): ...
class DistutilsPlatformError(DistutilsError): ...
class DistutilsExecError(DistutilsError): ...
class DistutilsInternalError(DistutilsError): ...
class DistutilsTemplateError(DistutilsError): ...
class DistutilsByteCompileError(DistutilsError): ...
class CCompilerError(Exception): ...
class PreprocessError(CCompilerError): ...
class CompileError(CCompilerError): ...
class LibError(CCompilerError): ...
class LinkError(CCompilerError): ...
class UnknownFileError(CCompilerError): ...
36 changes: 36 additions & 0 deletions typings/distutils-stubs/extension.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Extension:
name: str
sources: list[str]
include_dirs: list[str]
define_macros: list[tuple[str, str | None]]
undef_macros: list[str]
library_dirs: list[str]
libraries: list[str]
runtime_library_dirs: list[str]
extra_objects: list[str]
extra_compile_args: list[str]
extra_link_args: list[str]
export_symbols: list[str]
swig_opts: list[str]
depends: list[str]
language: str | None
optional: bool | None
def __init__(
self,
name: str,
sources: list[str],
include_dirs: list[str] | None = None,
define_macros: list[tuple[str, str | None]] | None = None,
undef_macros: list[str] | None = None,
library_dirs: list[str] | None = None,
libraries: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
extra_objects: list[str] | None = None,
extra_compile_args: list[str] | None = None,
extra_link_args: list[str] | None = None,
export_symbols: list[str] | None = None,
swig_opts: list[str] | None = None,
depends: list[str] | None = None,
language: str | None = None,
optional: bool | None = None,
) -> None: ...
38 changes: 38 additions & 0 deletions typings/distutils-stubs/fancy_getopt.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from collections.abc import Iterable, Mapping
from re import Pattern
from typing import Any, Final, overload

from typing_extensions import TypeAlias

_Option: TypeAlias = tuple[str, str | None, str]
_GR: TypeAlias = tuple[list[str], OptionDummy]

longopt_pat: Final = r"[a-zA-Z](?:[a-zA-Z0-9-]*)"
longopt_re: Final[Pattern[str]]
neg_alias_re: Final[Pattern[str]]
longopt_xlate: Final[dict[int, int]]

class FancyGetopt:
def __init__(self, option_table: list[_Option] | None = None) -> None: ...
# TODO kinda wrong, `getopt(object=object())` is invalid
@overload
def getopt(self, args: list[str] | None = None) -> _GR: ...
@overload
def getopt(self, args: list[str] | None, object: Any) -> list[str]: ...
def get_option_order(self) -> list[tuple[str, str]]: ...
def generate_help(self, header: str | None = None) -> list[str]: ...

def fancy_getopt(
options: list[_Option],
negative_opt: Mapping[_Option, _Option],
object: Any,
args: list[str] | None,
) -> list[str] | _GR: ...

WS_TRANS: Final[dict[int, str]]

def wrap_text(text: str, width: int) -> list[str]: ...
def translate_longopt(opt: str) -> str: ...

class OptionDummy:
def __init__(self, options: Iterable[str] = []) -> None: ...
45 changes: 45 additions & 0 deletions typings/distutils-stubs/file_util.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from collections.abc import Iterable
from typing import TypeVar, overload

from _typeshed import BytesPath, StrOrBytesPath, StrPath

_StrPathT = TypeVar("_StrPathT", bound=StrPath)
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)

@overload
def copy_file(
src: StrPath,
dst: _StrPathT,
preserve_mode: bool = True,
preserve_times: bool = True,
update: bool = False,
link: str | None = None,
verbose: bool = True,
dry_run: bool = False,
) -> tuple[_StrPathT | str, bool]: ...
@overload
def copy_file(
src: BytesPath,
dst: _BytesPathT,
preserve_mode: bool = True,
preserve_times: bool = True,
update: bool = False,
link: str | None = None,
verbose: bool = True,
dry_run: bool = False,
) -> tuple[_BytesPathT | bytes, bool]: ...
@overload
def move_file(
src: StrPath,
dst: _StrPathT,
verbose: bool = False,
dry_run: bool = False,
) -> _StrPathT | str: ...
@overload
def move_file(
src: BytesPath,
dst: _BytesPathT,
verbose: bool = False,
dry_run: bool = False,
) -> _BytesPathT | bytes: ...
def write_file(filename: StrOrBytesPath, contents: Iterable[str]) -> None: ...
57 changes: 57 additions & 0 deletions typings/distutils-stubs/filelist.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from collections.abc import Iterable
from re import Pattern
from typing import Literal, overload

# class is entirely undocumented
class FileList:
allfiles: Iterable[str] | None
files: list[str]
def __init__(self, warn: None = None, debug_print: None = None) -> None: ...
def set_allfiles(self, allfiles: Iterable[str]) -> None: ...
def findall(self, dir: str = ...) -> None: ...
def debug_print(self, msg: str) -> None: ...
def append(self, item: str) -> None: ...
def extend(self, items: Iterable[str]) -> None: ...
def sort(self) -> None: ...
def remove_duplicates(self) -> None: ...
def process_template_line(self, line: str) -> None: ...
@overload
def include_pattern(
self,
pattern: str,
anchor: bool = True,
prefix: str | None = None,
is_regex: Literal[False] = False,
) -> bool: ...
@overload
def include_pattern(
self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]
) -> bool: ...
@overload
def include_pattern(
self,
pattern: str | Pattern[str],
anchor: bool = True,
prefix: str | None = None,
is_regex: bool = False,
) -> bool: ...
@overload
def exclude_pattern(
self,
pattern: str,
anchor: bool = True,
prefix: str | None = None,
is_regex: Literal[False] = False,
) -> bool: ...
@overload
def exclude_pattern(
self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]
) -> bool: ...
@overload
def exclude_pattern(
self,
pattern: str | Pattern[str],
anchor: bool = True,
prefix: str | None = None,
is_regex: bool = False,
) -> bool: ...
25 changes: 25 additions & 0 deletions typings/distutils-stubs/log.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from typing import Final

DEBUG: Final = 1
INFO: Final = 2
WARN: Final = 3
ERROR: Final = 4
FATAL: Final = 5

class Log:
def __init__(self, threshold: int = 3) -> None: ...
def log(self, level: int, msg: str, *args: object) -> None: ...
def debug(self, msg: str, *args: object) -> None: ...
def info(self, msg: str, *args: object) -> None: ...
def warn(self, msg: str, *args: object) -> None: ...
def error(self, msg: str, *args: object) -> None: ...
def fatal(self, msg: str, *args: object) -> None: ...

def log(level: int, msg: str, *args: object) -> None: ...
def debug(msg: str, *args: object) -> None: ...
def info(msg: str, *args: object) -> None: ...
def warn(msg: str, *args: object) -> None: ...
def error(msg: str, *args: object) -> None: ...
def fatal(msg: str, *args: object) -> None: ...
def set_threshold(level: int) -> int: ...
def set_verbosity(v: int) -> None: ...
3 changes: 3 additions & 0 deletions typings/distutils-stubs/msvccompiler.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .ccompiler import CCompiler

class MSVCCompiler(CCompiler): ...
7 changes: 7 additions & 0 deletions typings/distutils-stubs/spawn.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def spawn(
cmd: list[str],
search_path: bool = True,
verbose: bool = False,
dry_run: bool = False,
) -> None: ...
def find_executable(executable: str, path: str | None = None) -> str | None: ...
29 changes: 29 additions & 0 deletions typings/distutils-stubs/sysconfig.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from typing import Final, Literal, overload

from _typeshed import MaybeNone
from typing_extensions import deprecated

from setuptools._distutils.ccompiler import CCompiler

PREFIX: Final[str]
EXEC_PREFIX: Final[str]
_config_vars: dict[str, str] | MaybeNone

@overload
@deprecated(
"SO is deprecated, use EXT_SUFFIX. Support will be removed when this module is synchronized with stdlib Python 3.11"
)
def get_config_var(name: Literal["SO"]) -> int | str | None: ...
@overload
def get_config_var(name: str) -> int | str | None: ...
@overload
def get_config_vars() -> dict[str, str | int]: ...
@overload
def get_config_vars(arg: str, /, *args: str) -> list[str | int]: ...
def get_config_h_filename() -> str: ...
def get_makefile_filename() -> str: ...
def get_python_inc(plat_specific: bool = False, prefix: str | None = None) -> str: ...
def get_python_lib(
plat_specific: bool = False, standard_lib: bool = False, prefix: str | None = None
) -> str: ...
def customize_compiler(compiler: CCompiler) -> None: ...
23 changes: 23 additions & 0 deletions typings/distutils-stubs/text_file.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from typing import IO

class TextFile:
def __init__(
self,
filename: str | None = None,
file: IO[str] | None = None,
*,
strip_comments: bool = ...,
lstrip_ws: bool = ...,
rstrip_ws: bool = ...,
skip_blanks: bool = ...,
join_lines: bool = ...,
collapse_join: bool = ...,
) -> None: ...
def open(self, filename: str) -> None: ...
def close(self) -> None: ...
def warn(
self, msg: str, line: list[int] | tuple[int, int] | int | None = None
) -> None: ...
def readline(self) -> str | None: ...
def readlines(self) -> list[str]: ...
def unreadline(self, line: str) -> str: ...
3 changes: 3 additions & 0 deletions typings/distutils-stubs/unixccompiler.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .ccompiler import CCompiler

class UnixCCompiler(CCompiler): ...
38 changes: 38 additions & 0 deletions typings/distutils-stubs/util.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from collections.abc import Callable, Mapping

from _typeshed import Unused
from typing_extensions import TypeVarTuple, Unpack

_Ts = TypeVarTuple("_Ts")

def get_host_platform() -> str: ...
def get_platform() -> str: ...
def get_macosx_target_ver_from_syscfg(): ...
def get_macosx_target_ver(): ...
def split_version(s: str) -> list[int]: ...
def convert_path(pathname: str) -> str: ...
def change_root(new_root: str, pathname: str) -> str: ...
def check_environ() -> None: ...
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
def grok_environment_error(exc: object, prefix: str = "error: ") -> str: ...
def split_quoted(s: str) -> list[str]: ...
def execute(
func: Callable[[Unpack[_Ts]], Unused],
args: tuple[Unpack[_Ts]],
msg: str | None = None,
verbose: bool = False,
dry_run: bool = False,
) -> None: ...
def strtobool(val: str) -> bool: ...
def byte_compile(
py_files: list[str],
optimize: int = 0,
force: bool = False,
prefix: str | None = None,
base_dir: str | None = None,
verbose: bool = True,
dry_run: bool = False,
direct: bool | None = None,
) -> None: ...
def rfc822_escape(header: str) -> str: ...
def is_mingw() -> bool: ...
37 changes: 37 additions & 0 deletions typings/distutils-stubs/version.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from abc import abstractmethod
from re import Pattern

from typing_extensions import Self

class Version:
def __eq__(self, other: object) -> bool: ...
def __lt__(self, other: Self | str) -> bool: ...
def __le__(self, other: Self | str) -> bool: ...
def __gt__(self, other: Self | str) -> bool: ...
def __ge__(self, other: Self | str) -> bool: ...
@abstractmethod
def __init__(self, vstring: str | None = None) -> None: ...
@abstractmethod
def parse(self, vstring: str) -> Self: ...
@abstractmethod
def __str__(self) -> str: ...
@abstractmethod
def _cmp(self, other: Self | str) -> bool: ...

class StrictVersion(Version):
version_re: Pattern[str]
version: tuple[int, int, int]
prerelease: tuple[str, int] | None
def __init__(self, vstring: str | None = None) -> None: ...
def parse(self, vstring: str) -> Self: ...
def __str__(self) -> str: ... # noqa: PYI029
def _cmp(self, other: Self | str) -> bool: ...

class LooseVersion(Version):
component_re: Pattern[str]
vstring: str
version: tuple[str | int, ...]
def __init__(self, vstring: str | None = None) -> None: ...
def parse(self, vstring: str) -> Self: ...
def __str__(self) -> str: ... # noqa: PYI029
def _cmp(self, other: Self | str) -> bool: ...

Unchanged files with check annotations Beta

"""
Undo secondary effect of `extra_path` adding to `install_lib`
"""
suffix = os.path.relpath(self.install_lib, self.install_libbase)

Check warning on line 79 in setup.py

GitHub Actions / pyright (3.8, ubuntu-latest)

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

Check warning on line 79 in setup.py

GitHub Actions / pyright (3.8, ubuntu-latest)

Argument of type "str | None" cannot be assigned to parameter "path" of type "StrPath" in function "relpath"   Type "str | None" is not assignable to type "StrPath"     Type "None" is not assignable to type "StrPath"       "None" is not assignable to "str"       "None" is incompatible with protocol "PathLike[str]"         "__fspath__" is not present (reportArgumentType)

Check warning on line 79 in setup.py

GitHub Actions / pyright (3.12, ubuntu-latest)

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

Check warning on line 79 in setup.py

GitHub Actions / pyright (3.12, ubuntu-latest)

Argument of type "str | None" cannot be assigned to parameter "path" of type "StrPath" in function "relpath"   Type "str | None" is not assignable to type "StrPath"     Type "None" is not assignable to type "StrPath"       "None" is not assignable to "str"       "None" is incompatible with protocol "PathLike[str]"         "__fspath__" is not present (reportArgumentType)
if suffix.strip() == self._pth_contents.strip():
self.install_lib = self.install_libbase
def finalize_options(self):
ei_cmd = self.ei_cmd = self.get_finalized_command("egg_info")
self.egg_info = ei_cmd.egg_info

Check warning on line 106 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.8, ubuntu-latest)

Cannot access attribute "egg_info" for class "Command"   Attribute "egg_info" is unknown (reportAttributeAccessIssue)

Check warning on line 106 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.12, ubuntu-latest)

Cannot access attribute "egg_info" for class "Command"   Attribute "egg_info" is unknown (reportAttributeAccessIssue)
if self.bdist_dir is None:
bdist_base = self.get_finalized_command('bdist').bdist_base

Check warning on line 109 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.8, ubuntu-latest)

Cannot access attribute "bdist_base" for class "bdist"   Attribute "bdist_base" is unknown (reportAttributeAccessIssue)

Check warning on line 109 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.12, ubuntu-latest)

Cannot access attribute "bdist_base" for class "bdist"   Attribute "bdist_base" is unknown (reportAttributeAccessIssue)
self.bdist_dir = os.path.join(bdist_base, 'egg')
if self.plat_name is None:
if self.egg_output is None:
# Compute filename of the output egg
basename = ei_cmd._get_egg_basename(

Check warning on line 121 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.8, ubuntu-latest)

Cannot access attribute "_get_egg_basename" for class "Command"   Attribute "_get_egg_basename" is unknown (reportAttributeAccessIssue)

Check warning on line 121 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.12, ubuntu-latest)

Cannot access attribute "_get_egg_basename" for class "Command"   Attribute "_get_egg_basename" is unknown (reportAttributeAccessIssue)
py_version=get_python_version(),
platform=self.distribution.has_ext_modules() and self.plat_name,
)
self.egg_output = os.path.join(self.dist_dir, basename + '.egg')

Check warning on line 126 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.8, ubuntu-latest)

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

Check warning on line 126 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.8, ubuntu-latest)

Argument of type "None" cannot be assigned to parameter "a" of type "BytesPath" in function "join"   Type "None" is not assignable to type "BytesPath"     "None" is not assignable to "bytes"     "None" is incompatible with protocol "PathLike[bytes]"       "__fspath__" is not present (reportArgumentType)

Check warning on line 126 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.12, ubuntu-latest)

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

Check warning on line 126 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.12, ubuntu-latest)

Argument of type "None" cannot be assigned to parameter "a" of type "BytesPath" in function "join"   Type "None" is not assignable to type "BytesPath"     "None" is not assignable to "bytes"     "None" is incompatible with protocol "PathLike[bytes]"       "__fspath__" is not present (reportArgumentType)
def do_install_data(self):
# Hack for packages that install data to install's --install-lib
to_compile = []
for p, ext_name in enumerate(ext_outputs):
filename, ext = os.path.splitext(ext_name)
pyfile = os.path.join(self.bdist_dir, strip_module(filename) + '.py')

Check warning on line 185 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.8, ubuntu-latest)

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

Check warning on line 185 in setuptools/command/bdist_egg.py

GitHub Actions / pyright (3.12, ubuntu-latest)

No overloads for "join" match the provided arguments (reportCallIssue)
self.stubs.append(pyfile)
log.info("creating stub loader for %s", ext_name)
if not self.dry_run: