Skip to content

Commit 83db53f

Browse files
authored
Merge pull request #357 from Avasam/Add-attribute-types-for-setuptools
Add attribute types for setuptools type-checking
2 parents 2f6da7c + 73b2405 commit 83db53f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

distutils/command/install.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ def initialize_options(self) -> None:
264264
# supplied by the user, they are filled in using the installation
265265
# scheme implied by prefix/exec-prefix/home and the contents of
266266
# that installation scheme.
267-
self.install_purelib = None # for pure module distributions
268-
self.install_platlib = None # non-pure (dists w/ extensions)
269-
self.install_headers = None # for C/C++ headers
267+
self.install_purelib: str | None = None # for pure module distributions
268+
self.install_platlib: str | None = None # non-pure (dists w/ extensions)
269+
self.install_headers: str | None = None # for C/C++ headers
270270
self.install_lib: str | None = None # set to either purelib or platlib
271-
self.install_scripts = None
272-
self.install_data = None
271+
self.install_scripts: str | None = None
272+
self.install_data: str | None = None
273273
self.install_userbase = USER_BASE
274274
self.install_usersite = USER_SITE
275275

distutils/dist.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
# type-only import because of mutual dependence between these modules
4747
from .cmd import Command
48+
from .extension import Extension
4849

4950
_CommandT = TypeVar("_CommandT", bound="Command")
5051
_OptionsList: TypeAlias = list[
@@ -220,18 +221,18 @@ def __init__(self, attrs: MutableMapping[str, Any] | None = None) -> None: # no
220221
# These options are really the business of various commands, rather
221222
# than of the Distribution itself. We provide aliases for them in
222223
# Distribution as a convenience to the developer.
223-
self.packages = None
224+
self.packages: list[str] | None = None
224225
self.package_data: dict[str, list[str]] = {}
225-
self.package_dir = None
226-
self.py_modules = None
226+
self.package_dir: dict[str, str] | None = None
227+
self.py_modules: list[str] | None = None
227228
self.libraries = None
228229
self.headers = None
229-
self.ext_modules = None
230+
self.ext_modules: list[Extension] | None = None
230231
self.ext_package = None
231232
self.include_dirs = None
232233
self.extra_path = None
233234
self.scripts = None
234-
self.data_files = None
235+
self.data_files: list[str | tuple] | None = None
235236
self.password = ''
236237

237238
# And now initialize bookkeeping stuff that can't be supplied by

0 commit comments

Comments
 (0)