summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-03-13 13:04:04 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-03-13 13:04:04 -0400
commit04f6a194c4acf810d4f3ca3c901d6cc1cc955db1 (patch)
treedf52c74dcfea7240770063ef1084b5c7b0fb4a53 /tools
parentcb229fa27a86fc48bd40340eacbec60fe5aa609b (diff)
downloadpython-setuptools-git-04f6a194c4acf810d4f3ca3c901d6cc1cc955db1.tar.gz
Vendor nspektr. Utilize it in Distribution._install_dependencies.
Diffstat (limited to 'tools')
-rw-r--r--tools/vendored.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/vendored.py b/tools/vendored.py
index 8a122ad7..cd15adbf 100644
--- a/tools/vendored.py
+++ b/tools/vendored.py
@@ -89,6 +89,16 @@ def rewrite_more_itertools(pkg_files: Path):
more_file.write_text(text)
+def rewrite_nspektr(pkg_files: Path, new_root):
+ for file in pkg_files.glob('*.py'):
+ text = file.read_text()
+ text = re.sub(r' (more_itertools)', rf' {new_root}.\1', text)
+ text = re.sub(r' (jaraco\.\w+)', rf' {new_root}.\1', text)
+ text = re.sub(r' (packaging)', rf' {new_root}.\1', text)
+ text = re.sub(r' (importlib_metadata)', rf' {new_root}.\1', text)
+ file.write_text(text)
+
+
def clean(vendor):
"""
Remove all files out of the vendor directory except the meta
@@ -133,6 +143,7 @@ def update_setuptools():
rewrite_importlib_resources(vendor / 'importlib_resources', 'setuptools.extern')
rewrite_importlib_metadata(vendor / 'importlib_metadata', 'setuptools.extern')
rewrite_more_itertools(vendor / "more_itertools")
+ rewrite_nspektr(vendor / "nspektr", 'setuptools.extern')
__name__ == '__main__' and update_vendored()