Skip to content

Commit

Permalink
Add _distutils.core
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jan 14, 2025
1 parent b5de0c4 commit ca83a0c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
1 change: 1 addition & 0 deletions stubs/setuptools/distutils/core.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from setuptools._distutils.core import *
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from abc import abstractmethod
from collections.abc import Sequence
from distutils.core import _SetupArgs as _DistutilsSetupArgs
from typing import Any, Literal, TypedDict, TypeVar, overload, type_check_only
from typing_extensions import NotRequired, Unpack

from ._distutils.cmd import Command as _Command
from ._distutils.core import _SetupArgs as _DistutilsSetupArgs
from .command.alias import alias
from .command.bdist_egg import bdist_egg
from .command.bdist_rpm import bdist_rpm
Expand Down
58 changes: 58 additions & 0 deletions stubs/setuptools/setuptools/_distutils/core.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from _typeshed import Incomplete, StrOrBytesPath
from collections.abc import Iterable, Mapping
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Final, TypedDict, type_check_only
from typing_extensions import Unpack

@type_check_only
class _SetupArgs(TypedDict, total=False): # total=False for custom Distributions that could accept more arguments
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

USAGE: Final[str]

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

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

def setup(**attrs: Unpack[_SetupArgs]) -> Distribution: ...
def run_setup(script_name: str, script_args: Iterable[str] | None = None, stop_after: str = "run") -> Distribution: ...

0 comments on commit ca83a0c

Please sign in to comment.