Skip to content
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

setuptools & distutils: ClassVar mutables (and tuples) #12403

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 10 additions & 8 deletions stdlib/distutils/command/bdist.pyi
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
from typing import Any
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar

from ..cmd import Command

def show_formats() -> None: ...

class bdist(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
no_format_option: Any
default_format: Any
format_commands: Any
format_command: Any
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]]]]
no_format_option: ClassVar[tuple[str, ...]]
default_format: ClassVar[dict[str, str]]
format_commands: ClassVar[list[str]]
format_command: ClassVar[dict[str, tuple[str, str]]]
bdist_base: Any
plat_name: Any
formats: Any
Expand Down
8 changes: 4 additions & 4 deletions stdlib/distutils/command/bdist_dumb.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command

class bdist_dumb(Command):
description: str
user_options: Any
boolean_options: Any
default_format: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
default_format: ClassVar[dict[str, str]]
bdist_dir: Any
plat_name: Any
format: Any
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/bdist_msi.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from typing import Any, Literal
from typing import Any, ClassVar, Literal

from ..cmd import Command

Expand All @@ -16,8 +16,8 @@ if sys.platform == "win32":

class bdist_msi(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
all_versions: Any
other_version: str
if sys.version_info >= (3, 9):
Expand Down
8 changes: 4 additions & 4 deletions stdlib/distutils/command/bdist_rpm.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command

class bdist_rpm(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
bdist_base: Any
rpm_base: Any
dist_dir: Any
Expand Down
4 changes: 2 additions & 2 deletions stdlib/distutils/command/bdist_wininst.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from _typeshed import StrOrBytesPath
from distutils.cmd import Command
from typing import Any, ClassVar
from typing import ClassVar

class bdist_wininst(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[Any, ...]]]
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]

def initialize_options(self) -> None: ...
Expand Down
7 changes: 4 additions & 3 deletions stdlib/distutils/command/build.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar

Expand All @@ -7,9 +8,9 @@ def show_compilers() -> None: ...

class build(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
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: Any
build_platlib: Any
Expand Down
10 changes: 6 additions & 4 deletions stdlib/distutils/command/build_clib.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
from typing import Any
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar

from ..cmd import Command

def show_compilers() -> None: ...

class build_clib(Command):
description: str
user_options: Any
boolean_options: Any
help_options: Any
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: Any
build_temp: Any
libraries: Any
Expand Down
10 changes: 6 additions & 4 deletions stdlib/distutils/command/build_ext.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import Any
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar

from ..cmd import Command

Expand All @@ -9,9 +11,9 @@ def show_compilers() -> None: ...
class build_ext(Command):
description: str
sep_by: Any
user_options: Any
boolean_options: Any
help_options: Any
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: Any
build_lib: Any
plat_name: Any
Expand Down
8 changes: 4 additions & 4 deletions stdlib/distutils/command/build_py.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import Any, Literal
from typing import Any, ClassVar, Literal

from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3

class build_py(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
build_lib: Any
py_modules: Any
package: Any
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/build_scripts.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3
Expand All @@ -7,8 +7,8 @@ first_line_re: Any

class build_scripts(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
build_dir: Any
scripts: Any
force: Any
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/check.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Literal
from typing import Any, ClassVar, Literal
from typing_extensions import TypeAlias

from ..cmd import Command
Expand Down Expand Up @@ -26,8 +26,8 @@ HAS_DOCUTILS: bool

class check(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
restructuredtext: int
metadata: int
strict: int
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/clean.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command

class clean(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
build_base: Any
build_lib: Any
build_temp: Any
Expand Down
4 changes: 2 additions & 2 deletions stdlib/distutils/command/config.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import StrOrBytesPath
from collections.abc import Sequence
from re import Pattern
from typing import Any, Literal
from typing import Any, ClassVar, Literal

from ..ccompiler import CCompiler
from ..cmd import Command
Expand All @@ -11,7 +11,7 @@ LANG_EXT: dict[str, str]
class config(Command):
description: str
# Tuple is full name, short name, description
user_options: Sequence[tuple[str, str | None, str]]
user_options: ClassVar[list[tuple[str, str | None, str]]]
compiler: str | CCompiler
cc: str | None
include_dirs: Sequence[str] | None
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/install.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ INSTALL_SCHEMES: dict[str, dict[Any, Any]]

class install(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
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: Any
home: str | None
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/install_data.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command

class install_data(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
outfiles: Any
root: Any
Expand Down
2 changes: 1 addition & 1 deletion stdlib/distutils/command/install_egg_info.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from ..cmd import Command

class install_egg_info(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[str, str | None, str]]]
user_options: ClassVar[list[tuple[str, str, str]]]
install_dir: Any
def initialize_options(self) -> None: ...
target: Any
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/install_headers.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command

class install_headers(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
force: int
outfiles: Any
Expand Down
8 changes: 4 additions & 4 deletions stdlib/distutils/command/install_lib.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command

PYTHON_SOURCE_EXTENSION: str

class install_lib(Command):
description: str
user_options: Any
boolean_options: Any
negative_opt: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
negative_opt: ClassVar[dict[str, str]]
install_dir: Any
build_dir: Any
force: int
Expand Down
6 changes: 3 additions & 3 deletions stdlib/distutils/command/install_scripts.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, ClassVar

from ..cmd import Command

class install_scripts(Command):
description: str
user_options: Any
boolean_options: Any
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
install_dir: Any
force: int
build_dir: Any
Expand Down
11 changes: 6 additions & 5 deletions stdlib/distutils/command/sdist.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Unused
from collections.abc import Callable
from typing import Any, ClassVar

Expand All @@ -8,13 +9,13 @@ def show_formats() -> None: ...
class sdist(Command):
description: str
def checking_metadata(self): ...
user_options: Any
boolean_options: Any
help_options: Any
negative_opt: Any
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]]
# Any to work around variance issues
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
READMES: Any
READMES: ClassVar[tuple[str, ...]]
template: Any
manifest: Any
use_defaults: int
Expand Down
4 changes: 3 additions & 1 deletion stubs/libsass/sassutils/distutils.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from typing import ClassVar

from sassutils.builder import Manifest as Manifest
from setuptools import Command, Distribution

def validate_manifests(dist: Distribution, attr: str, value: object) -> None: ...

class build_sass(Command):
description: str
user_options: list[tuple[str, str, str]]
user_options: ClassVar[list[tuple[str, str, str]]]
package_dir: dict[str, str] | None
output_style: str
def initialize_options(self) -> None: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/setuptools/setuptools/_distutils/command/bdist.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Unused
from collections.abc import Callable
from typing import ClassVar
from typing_extensions import deprecated

Expand All @@ -14,7 +15,7 @@ class bdist(Command):
description: ClassVar[str]
user_options: ClassVar[list[tuple[str | None, str | None, str | None]]]
boolean_options: ClassVar[list[str]]
help_options: ClassVar[list[tuple[str | None, ...]]]
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]
Expand Down
7 changes: 4 additions & 3 deletions stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from _typeshed import Incomplete
from typing import ClassVar

from ..cmd import Command

class bdist_rpm(Command):
description: str
user_options: Incomplete
boolean_options: Incomplete
negative_opt: Incomplete
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
Expand Down
Loading
Loading