Skip to content

Commit 1734e38

Browse files
committed
Statically alias distutils-stubs to setuptools._distutils
1 parent bf2ced2 commit 1734e38

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

Lines changed: 32 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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 *
Lines changed: 2 additions & 0 deletions
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)