Imported Upstream version 63.0.0 upstream/63.0.0
authorJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:51 +0000 (17:02 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:51 +0000 (17:02 +0900)
26 files changed:
.bumpversion.cfg
.github/workflows/ci-sage.yml
.github/workflows/main.yml
CHANGES.rst
docs/references/keywords.rst
docs/userguide/development_mode.rst
docs/userguide/extension.rst
docs/userguide/index.rst
docs/userguide/package_discovery.rst
docs/userguide/pyproject_config.rst
setup.cfg
setuptools/_vendor/nspektr-0.3.0.dist-info/INSTALLER [deleted file]
setuptools/_vendor/nspektr-0.3.0.dist-info/LICENSE [deleted file]
setuptools/_vendor/nspektr-0.3.0.dist-info/METADATA [deleted file]
setuptools/_vendor/nspektr-0.3.0.dist-info/RECORD [deleted file]
setuptools/_vendor/nspektr-0.3.0.dist-info/REQUESTED [deleted file]
setuptools/_vendor/nspektr-0.3.0.dist-info/WHEEL [deleted file]
setuptools/_vendor/nspektr-0.3.0.dist-info/top_level.txt [deleted file]
setuptools/_vendor/nspektr/__init__.py [deleted file]
setuptools/_vendor/nspektr/_compat.py [deleted file]
setuptools/_vendor/vendored.txt
setuptools/command/egg_info.py
setuptools/dist.py
setuptools/extern/__init__.py
setuptools/tests/test_easy_install.py
tools/vendored.py

index f90cdd5ebc0e7fc54f51d2ea7ac6546e722c5a2a..0c090c7053bde47ab792bc1ea74085c245c7ccb4 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 62.6.0
+current_version = 63.0.0
 commit = True
 tag = True
 
index 425681d7c36a33e5c3e51135d2093254307d3400..2a91934d2f8912026792c3120967e85c64233a74 100644 (file)
@@ -92,7 +92,7 @@ jobs:
       fail-fast: false
       max-parallel: 32
       matrix:
-        tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-focal, ubuntu-hirsute, ubuntu-impish, ubuntu-jammy, debian-stretch, debian-buster, debian-bullseye, debian-bookworm, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, linuxmint-20.2, linuxmint-20.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, fedora-35, centos-7, centos-stream-8, centos-stream-9, gentoo-python3.9, archlinux-latest, opensuse-15, opensuse-15.3, opensuse-tumbleweed, slackware-14.2, ubuntu-bionic-i386, manylinux-2_24-i686, debian-buster-i386, centos-7-i386]
+        tox_system_factor: [ubuntu-trusty-toolchain-gcc_9, ubuntu-xenial-toolchain-gcc_9, ubuntu-bionic, ubuntu-focal, ubuntu-hirsute, ubuntu-impish, ubuntu-jammy, ubuntu-kinetic, debian-stretch, debian-buster, debian-bullseye, debian-bookworm, debian-sid, linuxmint-19, linuxmint-19.3, linuxmint-20.1, linuxmint-20.2, linuxmint-20.3, linuxmint-21, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, fedora-35, fedora-36, fedora-37, centos-7-devtoolset-gcc_11, centos-stream-8, gentoo-python3.9, gentoo-python3.10, archlinux-latest, opensuse-15.3, opensuse-tumbleweed, ubuntu-bionic-i386, manylinux-2_24-i686, debian-buster-i386, centos-7-i386-devtoolset-gcc_11]
         tox_packages_factor: [minimal, standard]
     env:
       TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
index 4a68822be298665ab84323acb22ddbc4bdfc393d..7bd0af44d4c0d67d7e8b3e8d436bcc86cb6a43d2 100644 (file)
@@ -105,7 +105,9 @@ jobs:
             git,
       - name: Run tests
         shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
-        run: tox
+        run: |
+          git config --global --add safe.directory "$(cygpath -u "$GITHUB_WORKSPACE")" # workaround for #3408
+          tox
 
   integration-test:
     needs: test
index 368b0aa2073246a382a0857c5221d29f71195eb5..eeab4a2f3e3f96cbf139e624dc2c9bdcd3528f54 100644 (file)
@@ -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.
 
index a66d503ea6e289e706ead1f524792171cc1356cd..cf8fe41cdef2d0264211a754a00a557ae505fcc9 100644 (file)
@@ -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<core-metadata-keywords>`.
 
 .. _keyword/platforms:
 
index fafcc5274d07d4e1ae523887d51eccfb8917c4dc..4130ab7329a4d08b3e2a27414d736062f3ab74e3 100644 (file)
@@ -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"
index f1dce94bf6d8cf2dabd11ae06630059c831664d2..0008b6c2fc57a20e234ec3b9f2769c545e87d828 100644 (file)
@@ -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).
 
 
index c928f02f722090f24e3565fff807b5c2ee330f09..d631c5d8ac966f3222d4e17f21b17852eb3d5fa4 100644 (file)
@@ -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
 
 ---
 
index 5732b6bcf24b334c81b2b08dc61b0fda95e7682f..2efc62b9ebc803cfe5f52a48507308a9b4e90785 100644 (file)
@@ -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 </references/keywords>`
 
-.. 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 <quickstart>` 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 <https://www.python.org/dev/peps/pep-0420/>`_. 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 <https://packaging.python.org/guides/packaging-namespace-packages/>`_.
@@ -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.
 
 
 ----
index 9ce983b45f1db21e5c8c5583915bfaf398803939..28eb39d1a30e6e6667379dc04231bd9516e259c3 100644 (file)
@@ -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:
 
index b8cb0407a48ec0912cca29d33fc36a3447457f32..f22457aa0d8ae354b8c27cf9b0213a98c5eb8d95 100644 (file)
--- 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/_vendor/nspektr-0.3.0.dist-info/INSTALLER b/setuptools/_vendor/nspektr-0.3.0.dist-info/INSTALLER
deleted file mode 100644 (file)
index a1b589e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/setuptools/_vendor/nspektr-0.3.0.dist-info/LICENSE b/setuptools/_vendor/nspektr-0.3.0.dist-info/LICENSE
deleted file mode 100644 (file)
index 353924b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright Jason R. Coombs
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
diff --git a/setuptools/_vendor/nspektr-0.3.0.dist-info/METADATA b/setuptools/_vendor/nspektr-0.3.0.dist-info/METADATA
deleted file mode 100644 (file)
index aadc374..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-Metadata-Version: 2.1
-Name: nspektr
-Version: 0.3.0
-Summary: package inspector
-Home-page: https://github.com/jaraco/nspektr
-Author: Jason R. Coombs
-Author-email: jaraco@jaraco.com
-License: UNKNOWN
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3 :: Only
-Requires-Python: >=3.7
-License-File: LICENSE
-Requires-Dist: jaraco.context
-Requires-Dist: jaraco.functools
-Requires-Dist: more-itertools
-Requires-Dist: packaging
-Requires-Dist: importlib-metadata (>=3.6) ; python_version < "3.10"
-Provides-Extra: docs
-Requires-Dist: sphinx ; extra == 'docs'
-Requires-Dist: jaraco.packaging (>=9) ; extra == 'docs'
-Requires-Dist: rst.linker (>=1.9) ; extra == 'docs'
-Provides-Extra: testing
-Requires-Dist: pytest (>=6) ; extra == 'testing'
-Requires-Dist: pytest-checkdocs (>=2.4) ; extra == 'testing'
-Requires-Dist: pytest-flake8 ; extra == 'testing'
-Requires-Dist: pytest-cov ; extra == 'testing'
-Requires-Dist: pytest-enabler (>=1.0.1) ; extra == 'testing'
-Requires-Dist: pytest-black (>=0.3.7) ; (platform_python_implementation != "PyPy") and extra == 'testing'
-Requires-Dist: pytest-mypy (>=0.9.1) ; (platform_python_implementation != "PyPy") and extra == 'testing'
-
-.. image:: https://img.shields.io/pypi/v/nspektr.svg
-   :target: `PyPI link`_
-
-.. image:: https://img.shields.io/pypi/pyversions/nspektr.svg
-   :target: `PyPI link`_
-
-.. _PyPI link: https://pypi.org/project/nspektr
-
-.. image:: https://github.com/jaraco/nspektr/workflows/tests/badge.svg
-   :target: https://github.com/jaraco/nspektr/actions?query=workflow%3A%22tests%22
-   :alt: tests
-
-.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
-   :target: https://github.com/psf/black
-   :alt: Code style: Black
-
-.. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest
-..    :target: https://skeleton.readthedocs.io/en/latest/?badge=latest
-
-.. image:: https://img.shields.io/badge/skeleton-2022-informational
-   :target: https://blog.jaraco.com/skeleton
-
-
diff --git a/setuptools/_vendor/nspektr-0.3.0.dist-info/RECORD b/setuptools/_vendor/nspektr-0.3.0.dist-info/RECORD
deleted file mode 100644 (file)
index 5e5de5e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-nspektr-0.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4\r
-nspektr-0.3.0.dist-info/LICENSE,sha256=2z8CRrH5J48VhFuZ_sR4uLUG63ZIeZNyL4xuJUKF-vg,1050\r
-nspektr-0.3.0.dist-info/METADATA,sha256=X0stV4vwFBDBxvzhBl4kAHVdGWPIjEitqAuTJItcQH0,2162\r
-nspektr-0.3.0.dist-info/RECORD,,\r
-nspektr-0.3.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0\r
-nspektr-0.3.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92\r
-nspektr-0.3.0.dist-info/top_level.txt,sha256=uEA20Ixo04XS3wOIt5-Jk5ZuMkBrtlleFipRr8Y1SjQ,8\r
-nspektr/__init__.py,sha256=d6-d-ZlGAQQP-MEi_NZMiyn2vLbq8Hw3HxICgm3X0Q8,3949\r
-nspektr/__pycache__/__init__.cpython-310.pyc,,\r
-nspektr/__pycache__/_compat.cpython-310.pyc,,\r
-nspektr/_compat.py,sha256=2QoozYhuhgow_NMUATmhoM-yppBV3jiZYQgdiP-ww0s,582\r
diff --git a/setuptools/_vendor/nspektr-0.3.0.dist-info/REQUESTED b/setuptools/_vendor/nspektr-0.3.0.dist-info/REQUESTED
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/setuptools/_vendor/nspektr-0.3.0.dist-info/WHEEL b/setuptools/_vendor/nspektr-0.3.0.dist-info/WHEEL
deleted file mode 100644 (file)
index becc9a6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.37.1)
-Root-Is-Purelib: true
-Tag: py3-none-any
-
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 (file)
index b10ef50..0000000
+++ /dev/null
@@ -1 +0,0 @@
-nspektr
diff --git a/setuptools/_vendor/nspektr/__init__.py b/setuptools/_vendor/nspektr/__init__.py
deleted file mode 100644 (file)
index 938bbdb..0000000
+++ /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 (file)
index 3278379..0000000
+++ /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
index 95de2dc52d53209233f68b8969e060462e23f400..84c4006cd68d0d9110c668872f6470b1feef3cc9 100644 (file)
@@ -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
index c37ab81fa6382a521c2bad8fbe1c885aeaf654c6..42a0178fce17de2c675ede623308912cdc97f6f3 100644 (file)
@@ -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))
 
index c1ad30080b4c19d5aa7bca148f5c7c3810f3544f..824235488666c6ecdb22240b08354806fadb58ca 100644 (file)
@@ -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:
index 192e55f6e06f77f8c6fa26da5fe7132eb0bbef8f..d3a6dc99fe175507a94e3440da1f637f318add2f 100644 (file)
@@ -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()
index 246d634f21bc9880144561399318ebb8353bdb70..d102e586b46d28d93ec0133613a56f665cebb606 100644 (file)
@@ -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):
     """
index cd15adbf21efc39d2f6e1af85f5d886e3898c17c..8a122ad7783fac479e8e04e73b27e6e2994dacf8 100644 (file)
@@ -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()