From: JinWang An Date: Mon, 27 Mar 2023 08:02:46 +0000 (+0900) Subject: Imported Upstream version 60.9.1 X-Git-Tag: upstream/60.9.1^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7af304fb5e1d2e3e48c2ae8635d75e0cce772713;p=platform%2Fupstream%2Fpython-setuptools.git Imported Upstream version 60.9.1 --- diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 93624e4..7f5864f 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 60.9.0 +current_version = 60.9.1 commit = True tag = True diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6237373..c985f85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,6 @@ jobs: strategy: matrix: distutils: - - stdlib - local python: - pypy-3.7 @@ -23,6 +22,10 @@ jobs: - ubuntu-latest - macos-latest - windows-latest + include: + - platform: ubuntu-latest + python: "3.10" + distutils: stdlib runs-on: ${{ matrix.platform }} env: SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }} @@ -46,14 +49,7 @@ jobs: ${{ matrix.python }} test_cygwin: - strategy: - matrix: - distutils: - - stdlib - - local runs-on: windows-latest - env: - SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }} steps: - uses: actions/checkout@v2 - name: Install Cygwin with Python @@ -76,11 +72,6 @@ jobs: tox -- --cov-report xml integration-test: - strategy: - matrix: - distutils: - - stdlib - - local needs: test if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) # To avoid long times and high resource usage, we assume that: @@ -91,8 +82,6 @@ jobs: # "integration") # With that in mind, the integration tests can run for a single setup runs-on: ubuntu-latest - env: - SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils }} steps: - uses: actions/checkout@v2 - name: Install OS-level dependencies diff --git a/CHANGES.rst b/CHANGES.rst index dc1fac3..efe34d3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,14 @@ +v60.9.1 +------- + + +Misc +^^^^ +* #3102: Prevent vendored importlib_metadata from loading distributions from older importlib_metadata. +* #3103: Fixed issue where string-based entry points would be omitted. +* #3107: Bump importlib_metadata to 4.11.1 addressing issue with parsing requirements in egg-info as found in PyPy. + + v60.9.0 ------- diff --git a/setup.cfg b/setup.cfg index 59999cc..555038c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools -version = 60.9.0 +version = 60.9.1 author = Python Packaging Authority author_email = distutils-sig@python.org description = Easily download, build, install, upgrade, and uninstall Python packages diff --git a/setuptools/_entry_points.py b/setuptools/_entry_points.py index 0cf2691..f087681 100644 --- a/setuptools/_entry_points.py +++ b/setuptools/_entry_points.py @@ -53,7 +53,16 @@ def load(eps): @load.register(str) def _(eps): - return validate(metadata.EntryPoints._from_text(eps)) + r""" + >>> ep, = load('[console_scripts]\nfoo=bar') + >>> ep.group + 'console_scripts' + >>> ep.name + 'foo' + >>> ep.value + 'bar' + """ + return validate(metadata.EntryPoints(metadata.EntryPoints._from_text(eps))) load.register(type(None), lambda x: x) diff --git a/setuptools/_importlib.py b/setuptools/_importlib.py index c529ccd..c1ac137 100644 --- a/setuptools/_importlib.py +++ b/setuptools/_importlib.py @@ -1,8 +1,31 @@ import sys +def disable_importlib_metadata_finder(metadata): + """ + Ensure importlib_metadata doesn't provide older, incompatible + Distributions. + + Workaround for #3102. + """ + try: + import importlib_metadata + except ImportError: + return + if importlib_metadata is metadata: + return + to_remove = [ + ob + for ob in sys.meta_path + if isinstance(ob, importlib_metadata.MetadataPathFinder) + ] + for item in to_remove: + sys.meta_path.remove(item) + + if sys.version_info < (3, 10): from setuptools.extern import importlib_metadata as metadata + disable_importlib_metadata_finder(metadata) else: import importlib.metadata as metadata # noqa: F401 diff --git a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/INSTALLER b/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip diff --git a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/LICENSE b/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/LICENSE deleted file mode 100644 index be7e092..0000000 --- a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2017-2019 Jason R. Coombs, Barry Warsaw - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/METADATA b/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/METADATA deleted file mode 100644 index 7327b88..0000000 --- a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/METADATA +++ /dev/null @@ -1,118 +0,0 @@ -Metadata-Version: 2.1 -Name: importlib-metadata -Version: 4.10.1 -Summary: Read metadata from Python packages -Home-page: https://github.com/python/importlib_metadata -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 :: Apache Software License -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3 :: Only -Requires-Python: >=3.7 -License-File: LICENSE -Requires-Dist: zipp (>=0.5) -Requires-Dist: typing-extensions (>=3.6.4) ; python_version < "3.8" -Provides-Extra: docs -Requires-Dist: sphinx ; extra == 'docs' -Requires-Dist: jaraco.packaging (>=8.2) ; extra == 'docs' -Requires-Dist: rst.linker (>=1.9) ; extra == 'docs' -Provides-Extra: perf -Requires-Dist: ipython ; extra == 'perf' -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: packaging ; extra == 'testing' -Requires-Dist: pyfakefs ; extra == 'testing' -Requires-Dist: flufl.flake8 ; extra == 'testing' -Requires-Dist: pytest-perf (>=0.9.2) ; extra == 'testing' -Requires-Dist: pytest-black (>=0.3.7) ; (platform_python_implementation != "PyPy") and extra == 'testing' -Requires-Dist: pytest-mypy ; (platform_python_implementation != "PyPy") and extra == 'testing' -Requires-Dist: importlib-resources (>=1.3) ; (python_version < "3.9") and extra == 'testing' - -.. image:: https://img.shields.io/pypi/v/importlib_metadata.svg - :target: `PyPI link`_ - -.. image:: https://img.shields.io/pypi/pyversions/importlib_metadata.svg - :target: `PyPI link`_ - -.. _PyPI link: https://pypi.org/project/importlib_metadata - -.. image:: https://github.com/python/importlib_metadata/workflows/tests/badge.svg - :target: https://github.com/python/importlib_metadata/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/importlib-metadata/badge/?version=latest - :target: https://importlib-metadata.readthedocs.io/en/latest/?badge=latest - -.. image:: https://img.shields.io/badge/skeleton-2021-informational - :target: https://blog.jaraco.com/skeleton - - -Library to access the metadata for a Python package. - -This package supplies third-party access to the functionality of -`importlib.metadata `_ -including improvements added to subsequent Python versions. - - -Compatibility -============= - -New features are introduced in this third-party library and later merged -into CPython. The following table indicates which versions of this library -were contributed to different versions in the standard library: - -.. list-table:: - :header-rows: 1 - - * - importlib_metadata - - stdlib - * - 4.8 - - 3.11 - * - 4.4 - - 3.10 - * - 1.4 - - 3.8 - - -Usage -===== - -See the `online documentation `_ -for usage details. - -`Finder authors -`_ can -also add support for custom package installers. See the above documentation -for details. - - -Caveats -======= - -This project primarily supports third-party packages installed by PyPA -tools (or other conforming packages). It does not support: - -- Packages in the stdlib. -- Packages installed without metadata. - -Project details -=============== - - * Project home: https://github.com/python/importlib_metadata - * Report bugs at: https://github.com/python/importlib_metadata/issues - * Code hosting: https://github.com/python/importlib_metadata - * Documentation: https://importlib_metadata.readthedocs.io/ - - diff --git a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/RECORD b/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/RECORD deleted file mode 100644 index ebedf90..0000000 --- a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/RECORD +++ /dev/null @@ -1,24 +0,0 @@ -importlib_metadata-4.10.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -importlib_metadata-4.10.1.dist-info/LICENSE,sha256=wNe6dAchmJ1VvVB8D9oTc-gHHadCuaSBAev36sYEM6U,571 -importlib_metadata-4.10.1.dist-info/METADATA,sha256=-HDYj3iK6bcjwN5MAoO58Op6WQIYQfbhl6ZaPqL0IZI,3989 -importlib_metadata-4.10.1.dist-info/RECORD,, -importlib_metadata-4.10.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -importlib_metadata-4.10.1.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92 -importlib_metadata-4.10.1.dist-info/top_level.txt,sha256=CO3fD9yylANiXkrMo4qHLV_mqXL2sC5JFKgt1yWAT-A,19 -importlib_metadata/__init__.py,sha256=7WxDdbPPu4Wy3VeMTApd-JlPQoENgVDyDH6aqyE7acE,30175 -importlib_metadata/__pycache__/__init__.cpython-310.pyc,, -importlib_metadata/__pycache__/_adapters.cpython-310.pyc,, -importlib_metadata/__pycache__/_collections.cpython-310.pyc,, -importlib_metadata/__pycache__/_compat.cpython-310.pyc,, -importlib_metadata/__pycache__/_functools.cpython-310.pyc,, -importlib_metadata/__pycache__/_itertools.cpython-310.pyc,, -importlib_metadata/__pycache__/_meta.cpython-310.pyc,, -importlib_metadata/__pycache__/_text.cpython-310.pyc,, -importlib_metadata/_adapters.py,sha256=B6fCi5-8mLVDFUZj3krI5nAo-mKp1dH_qIavyIyFrJs,1862 -importlib_metadata/_collections.py,sha256=CJ0OTCHIjWA0ZIVS4voORAsn2R4R2cQBEtPsZEJpASY,743 -importlib_metadata/_compat.py,sha256=EU2XCFBPFByuI0Of6XkAuBYbzqSyjwwwwqmsK4ccna0,1826 -importlib_metadata/_functools.py,sha256=PsY2-4rrKX4RVeRC1oGp1lB1pmC9eKN88_f-bD9uOoA,2895 -importlib_metadata/_itertools.py,sha256=cvr_2v8BRbxcIl5x5ldfqdHjhI8Yi8s8yk50G_nm6jQ,2068 -importlib_metadata/_meta.py,sha256=_F48Hu_jFxkfKWz5wcYS8vO23qEygbVdF9r-6qh-hjE,1154 -importlib_metadata/_text.py,sha256=HCsFksZpJLeTP3NEk_ngrAeXVRRtTrtyh9eOABoRP4A,2166 -importlib_metadata/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/REQUESTED b/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/REQUESTED deleted file mode 100644 index e69de29..0000000 diff --git a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/WHEEL b/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/WHEEL deleted file mode 100644 index becc9a6..0000000 --- a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/WHEEL +++ /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/importlib_metadata-4.10.1.dist-info/top_level.txt b/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/top_level.txt deleted file mode 100644 index bbb0754..0000000 --- a/setuptools/_vendor/importlib_metadata-4.10.1.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -importlib_metadata diff --git a/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/INSTALLER b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/INSTALLER new file mode 100644 index 0000000..a1b589e --- /dev/null +++ b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/LICENSE b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/LICENSE new file mode 100644 index 0000000..be7e092 --- /dev/null +++ b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/LICENSE @@ -0,0 +1,13 @@ +Copyright 2017-2019 Jason R. Coombs, Barry Warsaw + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/METADATA b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/METADATA new file mode 100644 index 0000000..fda4bc7 --- /dev/null +++ b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/METADATA @@ -0,0 +1,118 @@ +Metadata-Version: 2.1 +Name: importlib-metadata +Version: 4.11.1 +Summary: Read metadata from Python packages +Home-page: https://github.com/python/importlib_metadata +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 :: Apache Software License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Requires-Python: >=3.7 +License-File: LICENSE +Requires-Dist: zipp (>=0.5) +Requires-Dist: typing-extensions (>=3.6.4) ; python_version < "3.8" +Provides-Extra: docs +Requires-Dist: sphinx ; extra == 'docs' +Requires-Dist: jaraco.packaging (>=8.2) ; extra == 'docs' +Requires-Dist: rst.linker (>=1.9) ; extra == 'docs' +Provides-Extra: perf +Requires-Dist: ipython ; extra == 'perf' +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: packaging ; extra == 'testing' +Requires-Dist: pyfakefs ; extra == 'testing' +Requires-Dist: flufl.flake8 ; extra == 'testing' +Requires-Dist: pytest-perf (>=0.9.2) ; 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' +Requires-Dist: importlib-resources (>=1.3) ; (python_version < "3.9") and extra == 'testing' + +.. image:: https://img.shields.io/pypi/v/importlib_metadata.svg + :target: `PyPI link`_ + +.. image:: https://img.shields.io/pypi/pyversions/importlib_metadata.svg + :target: `PyPI link`_ + +.. _PyPI link: https://pypi.org/project/importlib_metadata + +.. image:: https://github.com/python/importlib_metadata/workflows/tests/badge.svg + :target: https://github.com/python/importlib_metadata/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/importlib-metadata/badge/?version=latest + :target: https://importlib-metadata.readthedocs.io/en/latest/?badge=latest + +.. image:: https://img.shields.io/badge/skeleton-2022-informational + :target: https://blog.jaraco.com/skeleton + + +Library to access the metadata for a Python package. + +This package supplies third-party access to the functionality of +`importlib.metadata `_ +including improvements added to subsequent Python versions. + + +Compatibility +============= + +New features are introduced in this third-party library and later merged +into CPython. The following table indicates which versions of this library +were contributed to different versions in the standard library: + +.. list-table:: + :header-rows: 1 + + * - importlib_metadata + - stdlib + * - 4.8 + - 3.11 + * - 4.4 + - 3.10 + * - 1.4 + - 3.8 + + +Usage +===== + +See the `online documentation `_ +for usage details. + +`Finder authors +`_ can +also add support for custom package installers. See the above documentation +for details. + + +Caveats +======= + +This project primarily supports third-party packages installed by PyPA +tools (or other conforming packages). It does not support: + +- Packages in the stdlib. +- Packages installed without metadata. + +Project details +=============== + + * Project home: https://github.com/python/importlib_metadata + * Report bugs at: https://github.com/python/importlib_metadata/issues + * Code hosting: https://github.com/python/importlib_metadata + * Documentation: https://importlib_metadata.readthedocs.io/ + + diff --git a/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/RECORD b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/RECORD new file mode 100644 index 0000000..d8c2dff --- /dev/null +++ b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/RECORD @@ -0,0 +1,24 @@ +importlib_metadata-4.11.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +importlib_metadata-4.11.1.dist-info/LICENSE,sha256=wNe6dAchmJ1VvVB8D9oTc-gHHadCuaSBAev36sYEM6U,571 +importlib_metadata-4.11.1.dist-info/METADATA,sha256=XNgM09x6V8tbt6ugvKjiUxH9yB7pBdILWuWE5YNWHRw,3999 +importlib_metadata-4.11.1.dist-info/RECORD,, +importlib_metadata-4.11.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +importlib_metadata-4.11.1.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92 +importlib_metadata-4.11.1.dist-info/top_level.txt,sha256=CO3fD9yylANiXkrMo4qHLV_mqXL2sC5JFKgt1yWAT-A,19 +importlib_metadata/__init__.py,sha256=Wkh_tb0u0Ds_615ByV9VLLjqgoOWirwMY8EW40oO3nM,30122 +importlib_metadata/__pycache__/__init__.cpython-310.pyc,, +importlib_metadata/__pycache__/_adapters.cpython-310.pyc,, +importlib_metadata/__pycache__/_collections.cpython-310.pyc,, +importlib_metadata/__pycache__/_compat.cpython-310.pyc,, +importlib_metadata/__pycache__/_functools.cpython-310.pyc,, +importlib_metadata/__pycache__/_itertools.cpython-310.pyc,, +importlib_metadata/__pycache__/_meta.cpython-310.pyc,, +importlib_metadata/__pycache__/_text.cpython-310.pyc,, +importlib_metadata/_adapters.py,sha256=B6fCi5-8mLVDFUZj3krI5nAo-mKp1dH_qIavyIyFrJs,1862 +importlib_metadata/_collections.py,sha256=CJ0OTCHIjWA0ZIVS4voORAsn2R4R2cQBEtPsZEJpASY,743 +importlib_metadata/_compat.py,sha256=EU2XCFBPFByuI0Of6XkAuBYbzqSyjwwwwqmsK4ccna0,1826 +importlib_metadata/_functools.py,sha256=PsY2-4rrKX4RVeRC1oGp1lB1pmC9eKN88_f-bD9uOoA,2895 +importlib_metadata/_itertools.py,sha256=cvr_2v8BRbxcIl5x5ldfqdHjhI8Yi8s8yk50G_nm6jQ,2068 +importlib_metadata/_meta.py,sha256=_F48Hu_jFxkfKWz5wcYS8vO23qEygbVdF9r-6qh-hjE,1154 +importlib_metadata/_text.py,sha256=HCsFksZpJLeTP3NEk_ngrAeXVRRtTrtyh9eOABoRP4A,2166 +importlib_metadata/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/REQUESTED b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/REQUESTED new file mode 100644 index 0000000..e69de29 diff --git a/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/WHEEL b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/WHEEL new file mode 100644 index 0000000..becc9a6 --- /dev/null +++ b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.37.1) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/top_level.txt b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/top_level.txt new file mode 100644 index 0000000..bbb0754 --- /dev/null +++ b/setuptools/_vendor/importlib_metadata-4.11.1.dist-info/top_level.txt @@ -0,0 +1 @@ +importlib_metadata diff --git a/setuptools/_vendor/importlib_metadata/__init__.py b/setuptools/_vendor/importlib_metadata/__init__.py index 4554117..292e0c6 100644 --- a/setuptools/_vendor/importlib_metadata/__init__.py +++ b/setuptools/_vendor/importlib_metadata/__init__.py @@ -283,6 +283,8 @@ class DeprecatedList(list): 1 """ + __slots__ = () + _warn = functools.partial( warnings.warn, "EntryPoints list interface is deprecated. Cast to list if needed.", @@ -295,21 +297,15 @@ class DeprecatedList(list): self._warn() return getattr(super(), method_name)(*args, **kwargs) - return wrapped - - for method_name in [ - '__setitem__', - '__delitem__', - 'append', - 'reverse', - 'extend', - 'pop', - 'remove', - '__iadd__', - 'insert', - 'sort', - ]: - locals()[method_name] = _wrap_deprecated_method(method_name) + return method_name, wrapped + + locals().update( + map( + _wrap_deprecated_method, + '__setitem__ __delitem__ append reverse extend pop remove ' + '__iadd__ insert sort'.split(), + ) + ) def __add__(self, other): if not isinstance(other, tuple): @@ -663,7 +659,7 @@ class Distribution: def _read_egg_info_reqs(self): source = self.read_text('requires.txt') - return source and self._deps_from_requires_text(source) + return pass_none(self._deps_from_requires_text)(source) @classmethod def _deps_from_requires_text(cls, source): diff --git a/setuptools/_vendor/vendored.txt b/setuptools/_vendor/vendored.txt index 1dd32ef..db24b40 100644 --- a/setuptools/_vendor/vendored.txt +++ b/setuptools/_vendor/vendored.txt @@ -4,7 +4,7 @@ ordered-set==3.1.1 more_itertools==8.8.0 jaraco.text==3.7.0 importlib_resources==5.4.0 -importlib_metadata==4.10.1 +importlib_metadata==4.11.1 # 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/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 0f4a1a7..9270aa7 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -1,7 +1,9 @@ import os import shutil +import signal import tarfile import importlib +import contextlib from concurrent import futures import re @@ -11,6 +13,9 @@ from jaraco import path from .textwrap import DALS +TIMEOUT = int(os.getenv("TIMEOUT_BACKEND_TEST", "180")) # in seconds + + class BuildBackendBase: def __init__(self, cwd='.', env={}, backend_name='setuptools.build_meta'): self.cwd = cwd @@ -31,10 +36,23 @@ class BuildBackend(BuildBackendBase): def method(*args, **kw): root = os.path.abspath(self.cwd) caller = BuildBackendCaller(root, self.env, self.backend_name) - return self.pool.submit(caller, name, *args, **kw).result() + pid = None + try: + pid = self.pool.submit(os.getpid).result(TIMEOUT) + return self.pool.submit(caller, name, *args, **kw).result(TIMEOUT) + except futures.TimeoutError: + self.pool.shutdown(wait=False) # doesn't stop already running processes + self._kill(pid) + pytest.xfail(f"Backend did not respond before timeout ({TIMEOUT} s)") return method + def _kill(self, pid): + if pid is None: + return + with contextlib.suppress(ProcessLookupError, OSError): + os.kill(pid, signal.SIGTERM if os.name == "nt" else signal.SIGKILL) + class BuildBackendCaller(BuildBackendBase): def __init__(self, *args, **kwargs): diff --git a/tox.ini b/tox.ini index 4152c1b..6b587e2 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,7 @@ usedevelop = True extras = testing passenv = SETUPTOOLS_USE_DISTUTILS + TIMEOUT_BACKEND_TEST # timeout (in seconds) for test_build_meta windir # required for test_pkg_resources # honor git config in pytest-perf HOME