From 2771d3181f49285aca641b0c2d5f5aec61adfdec Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 18 Jul 2022 15:39:13 +0900 Subject: [PATCH] Imported Upstream version 63.0.0 --- CHANGES.rst | 25 +++- PKG-INFO | 2 +- docs/references/keywords.rst | 4 +- docs/userguide/development_mode.rst | 4 +- docs/userguide/extension.rst | 2 +- docs/userguide/index.rst | 10 +- docs/userguide/package_discovery.rst | 39 +++--- docs/userguide/pyproject_config.rst | 3 + setup.cfg | 2 +- setuptools.egg-info/PKG-INFO | 2 +- setuptools.egg-info/SOURCES.txt | 3 - .../_vendor/nspektr-0.3.0.dist-info/top_level.txt | 1 - setuptools/_vendor/nspektr/__init__.py | 145 --------------------- setuptools/_vendor/nspektr/_compat.py | 21 --- setuptools/_vendor/vendored.txt | 1 - setuptools/command/egg_info.py | 1 - setuptools/dist.py | 12 -- setuptools/extern/__init__.py | 2 +- setuptools/tests/test_easy_install.py | 77 ++++++++++- tools/vendored.py | 11 -- 20 files changed, 130 insertions(+), 237 deletions(-) delete mode 100644 setuptools/_vendor/nspektr-0.3.0.dist-info/top_level.txt delete mode 100644 setuptools/_vendor/nspektr/__init__.py delete mode 100644 setuptools/_vendor/nspektr/_compat.py diff --git a/CHANGES.rst b/CHANGES.rst index 368b0aa..eeab4a2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,26 @@ +v63.0.0 +------- + + +Breaking Changes +^^^^^^^^^^^^^^^^ +* #3421: Drop setuptools' support for installing an entrypoint extra requirements at load time: + - the functionality has been broken since v60.8.0. + - the mechanism to do so is deprecated (`fetch_build_eggs`). + - that use case (e.g. a custom command class entrypoint) is covered by making sure the necessary build requirements are declared. + +Documentation changes +^^^^^^^^^^^^^^^^^^^^^ +* #3305: Updated the example pyproject.toml -- by :user:`jacalata` +* #3394: This updates the documentation for the ``file_finders`` hook so that + the logging recommendation aligns with the suggestion to not use + ``distutils`` directly. +* #3397: Fix reference for ``keywords`` to point to the Core Metadata Specification + instead of PEP 314 (the live standard is kept always up-to-date and + consolidates several PEPs together in a single document). +* #3402: Reordered the User Guide's Table of Contents -- by :user:`codeandfire` + + v62.6.0 ------- @@ -18,7 +41,7 @@ v62.5.0 Changes ^^^^^^^ * #3347: Changed warnings and documentation notes about *experimental* aspect of ``pyproject.toml`` configuration: - now ``[pyproject]`` is a fully supported configuration interface, but the ``[tool.setuptools]`` table + now ``[project]`` is a fully supported configuration interface, but the ``[tool.setuptools]`` table and sub-tables are still considered to be in **beta** stage. * #3383: In _distutils_hack, suppress/undo the use of local distutils when select tests are imported in CPython. diff --git a/PKG-INFO b/PKG-INFO index 106c53b..63b039d 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: setuptools -Version: 62.6.0 +Version: 63.0.0 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://github.com/pypa/setuptools Author: Python Packaging Authority diff --git a/docs/references/keywords.rst b/docs/references/keywords.rst index a66d503..cf8fe41 100644 --- a/docs/references/keywords.rst +++ b/docs/references/keywords.rst @@ -167,9 +167,7 @@ extensions). ``keywords`` A list of strings or a comma-separated string providing descriptive - meta-data. See: `PEP 0314`_. - -.. _PEP 0314: https://www.python.org/dev/peps/pep-0314/ + meta-data. See: :ref:`Core Metadata Specifications`. .. _keyword/platforms: diff --git a/docs/userguide/development_mode.rst b/docs/userguide/development_mode.rst index fafcc52..4130ab7 100644 --- a/docs/userguide/development_mode.rst +++ b/docs/userguide/development_mode.rst @@ -1,5 +1,5 @@ -"Development Mode" -================== +Development Mode +================ Under normal circumstances, the ``setuptools`` assume that you are going to build a distribution of your project, not use it in its "raw" or "unbuilt" diff --git a/docs/userguide/extension.rst b/docs/userguide/extension.rst index f1dce94..0008b6c 100644 --- a/docs/userguide/extension.rst +++ b/docs/userguide/extension.rst @@ -276,7 +276,7 @@ A few important points for writing revision control file finders: * Your finder function SHOULD NOT raise any errors, and SHOULD deal gracefully with the absence of needed programs (i.e., ones belonging to the revision - control system itself. It *may*, however, use ``distutils.log.warn()`` to + control system itself. It *may*, however, use ``logging.warning()`` to inform the user of the missing program(s). diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst index c928f02..d631c5d 100644 --- a/docs/userguide/index.rst +++ b/docs/userguide/index.rst @@ -12,7 +12,7 @@ This document contains information to help Python developers through this process. Please check the :doc:`/userguide/quickstart` for an overview of the workflow. -Also note that ``setuptools`` is what is know in the community as :pep:`build +Also note that ``setuptools`` is what is known in the community as :pep:`build backend <517#terminology-and-goals>`, user facing interfaces are provided by tools such as :pypi:`pip` and :pypi:`build`. To use ``setuptools``, one must explicitly create a ``pyproject.toml`` file as described :doc:`/build_meta`. @@ -26,16 +26,16 @@ Contents quickstart package_discovery - entry_point dependency_management - ext_modules - datafiles development_mode + entry_point + datafiles + ext_modules distribution + miscellaneous extension declarative_config pyproject_config - miscellaneous --- diff --git a/docs/userguide/package_discovery.rst b/docs/userguide/package_discovery.rst index 5732b6b..2efc62b 100644 --- a/docs/userguide/package_discovery.rst +++ b/docs/userguide/package_discovery.rst @@ -8,12 +8,11 @@ Package Discovery and Namespace Packages a full specification for the keywords supplied to ``setup.cfg`` or ``setup.py`` can be found at :doc:`keywords reference ` -.. note:: - the examples provided here are only to demonstrate the functionality +.. important:: + The examples provided here are only to demonstrate the functionality introduced. More metadata and options arguments need to be supplied if you want to replicate them on your system. If you are completely - new to setuptools, the :doc:`quickstart section ` is a good - place to start. + new to setuptools, the :doc:`quickstart` section is a good place to start. ``Setuptools`` provides powerful tools to handle package discovery, including support for namespace packages. @@ -128,9 +127,8 @@ the following sections. Automatic discovery =================== -.. warning:: Automatic discovery is an **beta** feature and might change - (or be completely removed) in the future. - See :ref:`custom-discovery` for a stable way of configuring ``setuptools``. +.. warning:: Automatic discovery is a **beta** feature and might change in the future. + See :ref:`custom-discovery` for other methods of discovery. By default ``setuptools`` will consider 2 popular project layouts, each one with its own set of advantages and disadvantages [#layout1]_ [#layout2]_ as @@ -158,8 +156,7 @@ all modules and packages meant for distribution are placed inside this directory:: project_root_directory - ├── pyproject.toml - ├── setup.cfg # or setup.py + ├── pyproject.toml # AND/OR setup.cfg, setup.py ├── ... └── src/ └── mypkg/ @@ -192,8 +189,7 @@ flat-layout The package folder(s) are placed directly under the project root:: project_root_directory - ├── pyproject.toml - ├── setup.cfg # or setup.py + ├── pyproject.toml # AND/OR setup.cfg, setup.py ├── ... └── mypkg/ ├── __init__.py @@ -242,8 +238,7 @@ A standalone module is placed directly under the project root, instead of inside a package folder:: project_root_directory - ├── pyproject.toml - ├── setup.cfg # or setup.py + ├── pyproject.toml # AND/OR setup.cfg, setup.py ├── ... └── single_file_lib.py @@ -295,7 +290,7 @@ then returns a list of ``str`` representing the packages it could find. To use it, consider the following directory:: mypkg - ├── setup.cfg # and/or setup.py, pyproject.toml + ├── pyproject.toml # AND/OR setup.cfg, setup.py └── src ├── pkg1 │   └── __init__.py @@ -322,7 +317,7 @@ in ``src`` that start with the name ``pkg`` and not ``additional``: [options.packages.find] where = src include = pkg* - exclude = additional + # alternatively: `exclude = additional*` .. note:: ``pkg`` does not contain an ``__init__.py`` file, therefore @@ -336,8 +331,7 @@ in ``src`` that start with the name ``pkg`` and not ``additional``: # ... packages=find_packages( where='src', - include=['pkg*'], - exclude=['additional'], + include=['pkg*'], # alternatively: `exclude=['additional*']` ), package_dir={"": "src"} # ... @@ -355,8 +349,7 @@ in ``src`` that start with the name ``pkg`` and not ``additional``: [tool.setuptools.packages.find] where = ["src"] - include = ["pkg*"] - exclude = ["additional"] + include = ["pkg*"] # alternatively: `exclude = ["additional*"]` namespaces = false .. note:: @@ -414,7 +407,7 @@ Now, suppose you decide to package the ``foo`` part for distribution and start by creating a project directory organized as follows:: foo - ├── setup.cfg # and/or setup.py, pyproject.toml + ├── pyproject.toml # AND/OR setup.cfg, setup.py └── src └── timmins └── foo @@ -519,7 +512,7 @@ to `PEP 420 `_. It used to be more cumbersome to accomplish the same result. Historically, there were two methods to create namespace packages. One is the ``pkg_resources`` style supported by ``setuptools`` and the other one being ``pkgutils`` style offered by -``pkgutils`` module in Python. Both are now considered deprecated despite the +``pkgutils`` module in Python. Both are now considered *deprecated* despite the fact they still linger in many existing packages. These two differ in many subtle yet significant aspects and you can find out more on `Python packaging user guide `_. @@ -559,7 +552,7 @@ And your directory should look like this .. code-block:: bash foo - ├── setup.cfg # and/or setup.py, pyproject.toml + ├── pyproject.toml # AND/OR setup.cfg, setup.py └── src └── timmins ├── __init__.py @@ -579,7 +572,7 @@ file contains the following: __path__ = __import__('pkgutil').extend_path(__path__, __name__) -The project layout remains the same and ``setup.cfg`` remains the same. +The project layout remains the same and ``pyproject.toml/setup.cfg`` remains the same. ---- diff --git a/docs/userguide/pyproject_config.rst b/docs/userguide/pyproject_config.rst index 9ce983b..28eb39d 100644 --- a/docs/userguide/pyproject_config.rst +++ b/docs/userguide/pyproject_config.rst @@ -44,6 +44,7 @@ The ``project`` table contains metadata fields as described by name = "my_package" description = "My package description" readme = "README.rst" + requires-python = ">=3.7" keywords = ["one", "two"] license = {text = "BSD 3-Clause License"} classifiers = [ @@ -63,6 +64,8 @@ The ``project`` table contains metadata fields as described by [project.scripts] my-script = "my_package.module:function" + # ... other project metadata fields as specified in: + # https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ .. _setuptools-table: diff --git a/setup.cfg b/setup.cfg index 71c4144..4936078 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools -version = 62.6.0 +version = 63.0.0 author = Python Packaging Authority author_email = distutils-sig@python.org description = Easily download, build, install, upgrade, and uninstall Python packages diff --git a/setuptools.egg-info/PKG-INFO b/setuptools.egg-info/PKG-INFO index 106c53b..63b039d 100644 --- a/setuptools.egg-info/PKG-INFO +++ b/setuptools.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: setuptools -Version: 62.6.0 +Version: 63.0.0 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://github.com/pypa/setuptools Author: Python Packaging Authority diff --git a/setuptools.egg-info/SOURCES.txt b/setuptools.egg-info/SOURCES.txt index 830c2dd..4f4e951 100644 --- a/setuptools.egg-info/SOURCES.txt +++ b/setuptools.egg-info/SOURCES.txt @@ -368,9 +368,6 @@ setuptools/_vendor/more_itertools/__init__.py setuptools/_vendor/more_itertools/more.py setuptools/_vendor/more_itertools/recipes.py setuptools/_vendor/more_itertools-8.8.0.dist-info/top_level.txt -setuptools/_vendor/nspektr/__init__.py -setuptools/_vendor/nspektr/_compat.py -setuptools/_vendor/nspektr-0.3.0.dist-info/top_level.txt setuptools/_vendor/ordered_set-3.1.1.dist-info/top_level.txt setuptools/_vendor/packaging/__about__.py setuptools/_vendor/packaging/__init__.py diff --git a/setuptools/_vendor/nspektr-0.3.0.dist-info/top_level.txt b/setuptools/_vendor/nspektr-0.3.0.dist-info/top_level.txt deleted file mode 100644 index b10ef50..0000000 --- a/setuptools/_vendor/nspektr-0.3.0.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -nspektr diff --git a/setuptools/_vendor/nspektr/__init__.py b/setuptools/_vendor/nspektr/__init__.py deleted file mode 100644 index 938bbdb..0000000 --- a/setuptools/_vendor/nspektr/__init__.py +++ /dev/null @@ -1,145 +0,0 @@ -import itertools -import functools -import contextlib - -from setuptools.extern.packaging.requirements import Requirement -from setuptools.extern.packaging.version import Version -from setuptools.extern.more_itertools import always_iterable -from setuptools.extern.jaraco.context import suppress -from setuptools.extern.jaraco.functools import apply - -from ._compat import metadata, repair_extras - - -def resolve(req: Requirement) -> metadata.Distribution: - """ - Resolve the requirement to its distribution. - - Ignore exception detail for Python 3.9 compatibility. - - >>> resolve(Requirement('pytest<3')) # doctest: +IGNORE_EXCEPTION_DETAIL - Traceback (most recent call last): - ... - importlib.metadata.PackageNotFoundError: No package metadata was found for pytest<3 - """ - dist = metadata.distribution(req.name) - if not req.specifier.contains(Version(dist.version), prereleases=True): - raise metadata.PackageNotFoundError(str(req)) - dist.extras = req.extras # type: ignore - return dist - - -@apply(bool) -@suppress(metadata.PackageNotFoundError) -def is_satisfied(req: Requirement): - return resolve(req) - - -unsatisfied = functools.partial(itertools.filterfalse, is_satisfied) - - -class NullMarker: - @classmethod - def wrap(cls, req: Requirement): - return req.marker or cls() - - def evaluate(self, *args, **kwargs): - return True - - -def find_direct_dependencies(dist, extras=None): - """ - Find direct, declared dependencies for dist. - """ - simple = ( - req - for req in map(Requirement, always_iterable(dist.requires)) - if NullMarker.wrap(req).evaluate(dict(extra=None)) - ) - extra_deps = ( - req - for req in map(Requirement, always_iterable(dist.requires)) - for extra in always_iterable(getattr(dist, 'extras', extras)) - if NullMarker.wrap(req).evaluate(dict(extra=extra)) - ) - return itertools.chain(simple, extra_deps) - - -def traverse(items, visit): - """ - Given an iterable of items, traverse the items. - - For each item, visit is called to return any additional items - to include in the traversal. - """ - while True: - try: - item = next(items) - except StopIteration: - return - yield item - items = itertools.chain(items, visit(item)) - - -def find_req_dependencies(req): - with contextlib.suppress(metadata.PackageNotFoundError): - dist = resolve(req) - yield from find_direct_dependencies(dist) - - -def find_dependencies(dist, extras=None): - """ - Find all reachable dependencies for dist. - - dist is an importlib.metadata.Distribution (or similar). - TODO: create a suitable protocol for type hint. - - >>> deps = find_dependencies(resolve(Requirement('nspektr'))) - >>> all(isinstance(dep, Requirement) for dep in deps) - True - >>> not any('pytest' in str(dep) for dep in deps) - True - >>> test_deps = find_dependencies(resolve(Requirement('nspektr[testing]'))) - >>> any('pytest' in str(dep) for dep in test_deps) - True - """ - - def visit(req, seen=set()): - if req in seen: - return () - seen.add(req) - return find_req_dependencies(req) - - return traverse(find_direct_dependencies(dist, extras), visit) - - -class Unresolved(Exception): - def __iter__(self): - return iter(self.args[0]) - - -def missing(ep): - """ - Generate the unresolved dependencies (if any) of ep. - """ - return unsatisfied(find_dependencies(ep.dist, repair_extras(ep.extras))) - - -def check(ep): - """ - >>> ep, = metadata.entry_points(group='console_scripts', name='pip') - >>> check(ep) - >>> dist = metadata.distribution('nspektr') - - Since 'docs' extras are not installed, requesting them should fail. - - >>> ep = metadata.EntryPoint( - ... group=None, name=None, value='nspektr [docs]')._for(dist) - >>> check(ep) - Traceback (most recent call last): - ... - nspektr.Unresolved: [...] - """ - missed = list(missing(ep)) - if missed: - raise Unresolved(missed) diff --git a/setuptools/_vendor/nspektr/_compat.py b/setuptools/_vendor/nspektr/_compat.py deleted file mode 100644 index 3278379..0000000 --- a/setuptools/_vendor/nspektr/_compat.py +++ /dev/null @@ -1,21 +0,0 @@ -import contextlib -import sys - - -if sys.version_info >= (3, 10): - import importlib.metadata as metadata -else: - import setuptools.extern.importlib_metadata as metadata # type: ignore # noqa: F401 - - -def repair_extras(extras): - """ - Repair extras that appear as match objects. - - python/importlib_metadata#369 revealed a flaw in the EntryPoint - implementation. This function wraps the extras to ensure - they are proper strings even on older implementations. - """ - with contextlib.suppress(AttributeError): - return list(item.group(0) for item in extras) - return extras diff --git a/setuptools/_vendor/vendored.txt b/setuptools/_vendor/vendored.txt index 95de2dc..84c4006 100644 --- a/setuptools/_vendor/vendored.txt +++ b/setuptools/_vendor/vendored.txt @@ -5,7 +5,6 @@ more_itertools==8.8.0 jaraco.text==3.7.0 importlib_resources==5.4.0 importlib_metadata==4.11.1 -nspektr==0.3.0 # required for importlib_metadata on older Pythons typing_extensions==4.0.1 # required for importlib_resources and _metadata on older Pythons diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index c37ab81..42a0178 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -296,7 +296,6 @@ class egg_info(InfoCommon, Command): self.mkpath(self.egg_info) os.utime(self.egg_info, None) for ep in metadata.entry_points(group='egg_info.writers'): - self.distribution._install_dependencies(ep) writer = ep.load() writer(self, ep.name, os.path.join(self.egg_info, ep.name)) diff --git a/setuptools/dist.py b/setuptools/dist.py index c1ad300..8242354 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -30,7 +30,6 @@ from distutils.util import rfc822_escape from setuptools.extern import packaging from setuptools.extern import ordered_set from setuptools.extern.more_itertools import unique_everseen, partition -from setuptools.extern import nspektr from ._importlib import metadata @@ -918,18 +917,8 @@ class Distribution(_Distribution): for ep in metadata.entry_points(group='distutils.setup_keywords'): value = getattr(self, ep.name, None) if value is not None: - self._install_dependencies(ep) ep.load()(self, ep.name, value) - def _install_dependencies(self, ep): - """ - Given an entry point, ensure that any declared extras for - its distribution are installed. - """ - for req in nspektr.missing(ep): - # fetch_build_egg expects pkg_resources.Requirement - self.fetch_build_egg(pkg_resources.Requirement(str(req))) - def get_egg_cache_dir(self): egg_cache_dir = os.path.join(os.curdir, '.eggs') if not os.path.exists(egg_cache_dir): @@ -962,7 +951,6 @@ class Distribution(_Distribution): eps = metadata.entry_points(group='distutils.commands', name=command) for ep in eps: - self._install_dependencies(ep) self.cmdclass[command] = cmdclass = ep.load() return cmdclass else: diff --git a/setuptools/extern/__init__.py b/setuptools/extern/__init__.py index 192e55f..d3a6dc9 100644 --- a/setuptools/extern/__init__.py +++ b/setuptools/extern/__init__.py @@ -71,6 +71,6 @@ class VendorImporter: names = ( 'packaging', 'pyparsing', 'ordered_set', 'more_itertools', 'importlib_metadata', - 'zipp', 'importlib_resources', 'jaraco', 'typing_extensions', 'nspektr', 'tomli', + 'zipp', 'importlib_resources', 'jaraco', 'typing_extensions', 'tomli', ) VendorImporter(__name__, names, 'setuptools._vendor').install() diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 246d634..d102e58 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -846,9 +846,11 @@ class TestSetupRequires: def test_setup_requires_with_transitive_extra_dependency( self, monkeypatch): - # Use case: installing a package with a build dependency on - # an already installed `dep[extra]`, which in turn depends - # on `extra_dep` (whose is not already installed). + ''' + Use case: installing a package with a build dependency on + an already installed `dep[extra]`, which in turn depends + on `extra_dep` (whose is not already installed). + ''' with contexts.save_pkg_resources_state(): with contexts.tempdir() as temp_dir: # Create source distribution for `extra_dep`. @@ -890,6 +892,75 @@ class TestSetupRequires: monkeypatch.setenv(str('PIP_TIMEOUT'), str('0')) run_setup(test_setup_py, [str('--version')]) + def test_setup_requires_with_distutils_command_dep(self, monkeypatch): + ''' + Use case: ensure build requirements' extras + are properly installed and activated. + ''' + with contexts.save_pkg_resources_state(): + with contexts.tempdir() as temp_dir: + # Create source distribution for `extra_dep`. + make_sdist(os.path.join(temp_dir, 'extra_dep-1.0.tar.gz'), [ + ('setup.py', + DALS(""" + import setuptools + setuptools.setup( + name='extra_dep', + version='1.0', + py_modules=['extra_dep'], + ) + """)), + ('setup.cfg', ''), + ('extra_dep.py', ''), + ]) + # Create source tree for `epdep`. + dep_pkg = os.path.join(temp_dir, 'epdep') + os.mkdir(dep_pkg) + path.build({ + 'setup.py': + DALS(""" + import setuptools + setuptools.setup( + name='dep', version='2.0', + py_modules=['epcmd'], + extras_require={'extra': ['extra_dep']}, + entry_points=''' + [distutils.commands] + epcmd = epcmd:epcmd [extra] + ''', + ) + """), + 'setup.cfg': '', + 'epcmd.py': DALS(""" + from distutils.command.build_py import build_py + + import extra_dep + + class epcmd(build_py): + pass + """), + }, prefix=dep_pkg) + # "Install" dep. + run_setup( + os.path.join(dep_pkg, 'setup.py'), [str('dist_info')]) + working_set.add_entry(dep_pkg) + # Create source tree for test package. + test_pkg = os.path.join(temp_dir, 'test_pkg') + test_setup_py = os.path.join(test_pkg, 'setup.py') + os.mkdir(test_pkg) + with open(test_setup_py, 'w') as fp: + fp.write(DALS( + ''' + from setuptools import installer, setup + setup(setup_requires='dep[extra]') + ''')) + # Check... + monkeypatch.setenv(str('PIP_FIND_LINKS'), str(temp_dir)) + monkeypatch.setenv(str('PIP_NO_INDEX'), str('1')) + monkeypatch.setenv(str('PIP_RETRIES'), str('0')) + monkeypatch.setenv(str('PIP_TIMEOUT'), str('0')) + run_setup(test_setup_py, ['epcmd']) + def make_trivial_sdist(dist_path, distname, version): """ diff --git a/tools/vendored.py b/tools/vendored.py index cd15adb..8a122ad 100644 --- a/tools/vendored.py +++ b/tools/vendored.py @@ -89,16 +89,6 @@ 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 @@ -143,7 +133,6 @@ 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() -- 2.7.4