Skip to content

Commit 90c90a3

Browse files
committed
Statically alias distutils-stubs to setuptools._distutils
1 parent 4d4efe5 commit 90c90a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+137
-0
lines changed

tools/update_distutils_stubs.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
import shutil
3+
from pathlib import Path
4+
5+
_vendored_distutils_path = Path(__file__).parent.parent / "setuptools" / "_distutils"
6+
_distutils_stubs_path = Path(__file__).parent.parent / "typings" / "distutils-stubs"
7+
8+
DONT_TOUCH_COMMENT = "# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py\n"
9+
10+
11+
def main():
12+
if _distutils_stubs_path.exists():
13+
shutil.rmtree(_distutils_stubs_path)
14+
_distutils_stubs_path.mkdir(parents=True)
15+
(_distutils_stubs_path / "ruff.toml").write_text(
16+
f'{DONT_TOUCH_COMMENT}[lint]\nignore = ["F403"]'
17+
)
18+
for path in _vendored_distutils_path.rglob("*.py"):
19+
relative_path = path.relative_to(_vendored_distutils_path)
20+
if relative_path.parts[0] == "tests":
21+
continue
22+
stub_path = (_distutils_stubs_path / relative_path).with_suffix(".pyi")
23+
stub_path.parent.mkdir(exist_ok=True)
24+
module = (
25+
"setuptools._distutils."
26+
+ str(relative_path.with_suffix("")).replace(os.sep, ".")
27+
).removesuffix(".__init__")
28+
stub_path.write_text(f"{DONT_TOUCH_COMMENT}from {module} import *\n")
29+
30+
31+
if __name__ == "__main__":
32+
main()

typings/distutils-stubs/__init__.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils import *

typings/distutils-stubs/_log.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils._log import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils._macos_compat import *

typings/distutils-stubs/_modified.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils._modified import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils._msvccompiler import *
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.archive_util import *

typings/distutils-stubs/ccompiler.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.ccompiler import *

typings/distutils-stubs/cmd.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.cmd import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command._framework_compat import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.bdist import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.bdist_dumb import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.bdist_rpm import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.build import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.build_clib import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.build_ext import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.build_py import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.build_scripts import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.check import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.clean import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.config import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.install import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.install_data import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.install_egg_info import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.install_headers import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.install_lib import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.install_scripts import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.command.sdist import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.compat import *
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.compat.py38 import *
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.compat.py39 import *

typings/distutils-stubs/core.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.core import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.cygwinccompiler import *

typings/distutils-stubs/debug.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.debug import *

typings/distutils-stubs/dep_util.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.dep_util import *

typings/distutils-stubs/dir_util.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.dir_util import *

typings/distutils-stubs/dist.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.dist import *

typings/distutils-stubs/errors.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.errors import *

typings/distutils-stubs/extension.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.extension import *
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.fancy_getopt import *

typings/distutils-stubs/file_util.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.file_util import *

typings/distutils-stubs/filelist.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.filelist import *

typings/distutils-stubs/log.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.log import *

typings/distutils-stubs/ruff.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
[lint]
3+
ignore = ["F403"]

typings/distutils-stubs/spawn.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.spawn import *

typings/distutils-stubs/sysconfig.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.sysconfig import *

typings/distutils-stubs/text_file.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.text_file import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.unixccompiler import *

typings/distutils-stubs/util.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.util import *

typings/distutils-stubs/version.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.version import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.versionpredicate import *
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT MODIFY ! This file was automatically generated by tools/update_distutils_stubs.py
2+
from setuptools._distutils.zosccompiler import *

0 commit comments

Comments
 (0)