diff --git a/pyproject.toml b/pyproject.toml index 00e7ee169f..0709c0b143 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,16 @@ classifiers = [ ] keywords = ["CPAN PyPI distutils eggs package management"] requires-python = ">=3.8" -dependencies = [] +dependencies = [ + "packaging>=24", + "ordered-set>=3.1.1", + "more_itertools>=8.8", + "jaraco.text>=3.7", + "importlib_resources>=5.10.2", + "importlib_metadata>=6", + "tomli>=2.0.1", + "wheel>=0.43.0", +] [project.urls] Source = "https://github.com/pypa/setuptools" diff --git a/setuptools/_vendor/vendored.txt b/setuptools/_vendor/vendored.txt deleted file mode 100644 index c981dde807..0000000000 --- a/setuptools/_vendor/vendored.txt +++ /dev/null @@ -1,12 +0,0 @@ -packaging==24 -ordered-set==3.1.1 -more_itertools==8.8.0 -jaraco.text==3.7.0 -importlib_resources==5.10.2 -importlib_metadata==6.0.0 -# required for importlib_resources and _metadata on older Pythons -zipp==3.7.0 -tomli==2.0.1 -# required for jaraco.context on older Pythons -backports.tarfile -wheel==0.43.0 diff --git a/setuptools/extern/__init__.py b/setuptools/extern/__init__.py index f9b6eea70d..18ca1e2428 100644 --- a/setuptools/extern/__init__.py +++ b/setuptools/extern/__init__.py @@ -77,14 +77,17 @@ def install(self): # cog.outl(f"names = (\n{names}\n)") # ]]] names = ( - 'backports', + 'autocommand', 'importlib_metadata', 'importlib_resources', + 'inflect', 'jaraco', 'more_itertools', 'ordered_set', 'packaging', 'tomli', + 'typeguard', + 'typing_extensions', 'wheel', 'zipp', ) diff --git a/tools/vendored.py b/tools/vendored.py index edc9195f3c..29457720b6 100644 --- a/tools/vendored.py +++ b/tools/vendored.py @@ -4,6 +4,7 @@ import subprocess from textwrap import dedent +from jaraco.packaging import metadata from path import Path @@ -13,7 +14,7 @@ def remove_all(paths): def update_vendored(): - update_pkg_resources() + # update_pkg_resources() update_setuptools() @@ -207,19 +208,37 @@ def update_pkg_resources(): rewrite_platformdirs(vendor / "platformdirs") +def load_deps(): + """ + Read the dependencies from `.`. + """ + return metadata.load('.').get_all('Requires-Dist') + + +def install_deps(deps, vendor): + """ + Install the deps to vendor. + """ + install_args = [ + sys.executable, + '-m', + 'pip', + 'install', + '--target', + str(vendor), + '--python-version', + '3.8', + '--only-binary', + ':all:', + ] + list(deps) + subprocess.check_call(install_args) + + def update_setuptools(): vendor = Path('setuptools/_vendor') - install(vendor) - rewrite_packaging(vendor / 'packaging', 'setuptools.extern') - repair_namespace(vendor / 'jaraco') - repair_namespace(vendor / 'backports') - rewrite_jaraco_text(vendor / 'jaraco/text', 'setuptools.extern') - rewrite_jaraco_functools(vendor / 'jaraco/functools', 'setuptools.extern') - rewrite_jaraco_context(vendor / 'jaraco', 'setuptools.extern') - rewrite_importlib_resources(vendor / 'importlib_resources', 'setuptools.extern') - rewrite_importlib_metadata(vendor / 'importlib_metadata', 'setuptools.extern') - rewrite_more_itertools(vendor / "more_itertools") - rewrite_wheel(vendor / "wheel") + deps = load_deps() + clean(vendor) + install_deps(deps, vendor) def yield_top_level(name): diff --git a/tox.ini b/tox.ini index 6b04ddb1cd..9ff4488cd3 100644 --- a/tox.ini +++ b/tox.ini @@ -75,6 +75,9 @@ allowlist_externals = git, sh deps = path cogapp + jaraco.packaging + # workaround for pypa/pyproject-hooks#192 + pyproject-hooks<1.1 commands = vendor: python -m tools.vendored sh -c "git grep -l -F '\[\[\[cog' | xargs -t cog -I {toxinidir} -r" # update `*.extern`