Skip to content

Commit d64fb2f

Browse files
authored
Merge pull request #3086 from pypa/debt/remove-pkg-resources
Remove reliance on ensure_directory and parse_requirements from pkg_resources
2 parents f1bb03e + 0e68232 commit d64fb2f

File tree

109 files changed

+5974
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5974
-21
lines changed

changelog.d/3085.change.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Setuptools now vendors importlib_resources and importlib_metadata and jaraco.text. Setuptools no longer relies on pkg_resources for ensure_directory nor parse_requirements.

setuptools/_importlib.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
3+
4+
if sys.version_info < (3, 10):
5+
from setuptools.extern import importlib_metadata as metadata
6+
else:
7+
import importlib.metadata as metadata # noqa: F401
8+
9+
10+
if sys.version_info < (3, 9):
11+
from setuptools.extern import importlib_resources as resources
12+
else:
13+
import importlib.resources as resources # noqa: F401

setuptools/_path.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import os
2+
3+
4+
def ensure_directory(path):
5+
"""Ensure that the parent directory of `path` exists"""
6+
dirname = os.path.dirname(path)
7+
os.makedirs(dirname, exist_ok=True)

setuptools/_reqs.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import setuptools.extern.jaraco.text as text
2+
3+
from pkg_resources import Requirement
4+
5+
6+
def parse_strings(strs):
7+
"""
8+
Yield requirement strings for each specification in `strs`.
9+
10+
`strs` must be a string, or a (possibly-nested) iterable thereof.
11+
"""
12+
return text.join_continuation(map(text.drop_comment, text.yield_lines(strs)))
13+
14+
15+
def parse(strs):
16+
"""
17+
Deprecated drop-in replacement for pkg_resources.parse_requirements.
18+
"""
19+
return map(Requirement, parse_strings(strs))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2017-2019 Jason R. Coombs, Barry Warsaw
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
Metadata-Version: 2.1
2+
Name: importlib-metadata
3+
Version: 4.10.1
4+
Summary: Read metadata from Python packages
5+
Home-page: https://github.com/python/importlib_metadata
6+
Author: Jason R. Coombs
7+
Author-email: [email protected]
8+
License: UNKNOWN
9+
Platform: UNKNOWN
10+
Classifier: Development Status :: 5 - Production/Stable
11+
Classifier: Intended Audience :: Developers
12+
Classifier: License :: OSI Approved :: Apache Software License
13+
Classifier: Programming Language :: Python :: 3
14+
Classifier: Programming Language :: Python :: 3 :: Only
15+
Requires-Python: >=3.7
16+
License-File: LICENSE
17+
Requires-Dist: zipp (>=0.5)
18+
Requires-Dist: typing-extensions (>=3.6.4) ; python_version < "3.8"
19+
Provides-Extra: docs
20+
Requires-Dist: sphinx ; extra == 'docs'
21+
Requires-Dist: jaraco.packaging (>=8.2) ; extra == 'docs'
22+
Requires-Dist: rst.linker (>=1.9) ; extra == 'docs'
23+
Provides-Extra: perf
24+
Requires-Dist: ipython ; extra == 'perf'
25+
Provides-Extra: testing
26+
Requires-Dist: pytest (>=6) ; extra == 'testing'
27+
Requires-Dist: pytest-checkdocs (>=2.4) ; extra == 'testing'
28+
Requires-Dist: pytest-flake8 ; extra == 'testing'
29+
Requires-Dist: pytest-cov ; extra == 'testing'
30+
Requires-Dist: pytest-enabler (>=1.0.1) ; extra == 'testing'
31+
Requires-Dist: packaging ; extra == 'testing'
32+
Requires-Dist: pyfakefs ; extra == 'testing'
33+
Requires-Dist: flufl.flake8 ; extra == 'testing'
34+
Requires-Dist: pytest-perf (>=0.9.2) ; extra == 'testing'
35+
Requires-Dist: pytest-black (>=0.3.7) ; (platform_python_implementation != "PyPy") and extra == 'testing'
36+
Requires-Dist: pytest-mypy ; (platform_python_implementation != "PyPy") and extra == 'testing'
37+
Requires-Dist: importlib-resources (>=1.3) ; (python_version < "3.9") and extra == 'testing'
38+
39+
.. image:: https://img.shields.io/pypi/v/importlib_metadata.svg
40+
:target: `PyPI link`_
41+
42+
.. image:: https://img.shields.io/pypi/pyversions/importlib_metadata.svg
43+
:target: `PyPI link`_
44+
45+
.. _PyPI link: https://pypi.org/project/importlib_metadata
46+
47+
.. image:: https://github.com/python/importlib_metadata/workflows/tests/badge.svg
48+
:target: https://github.com/python/importlib_metadata/actions?query=workflow%3A%22tests%22
49+
:alt: tests
50+
51+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
52+
:target: https://github.com/psf/black
53+
:alt: Code style: Black
54+
55+
.. image:: https://readthedocs.org/projects/importlib-metadata/badge/?version=latest
56+
:target: https://importlib-metadata.readthedocs.io/en/latest/?badge=latest
57+
58+
.. image:: https://img.shields.io/badge/skeleton-2021-informational
59+
:target: https://blog.jaraco.com/skeleton
60+
61+
62+
Library to access the metadata for a Python package.
63+
64+
This package supplies third-party access to the functionality of
65+
`importlib.metadata <https://docs.python.org/3/library/importlib.metadata.html>`_
66+
including improvements added to subsequent Python versions.
67+
68+
69+
Compatibility
70+
=============
71+
72+
New features are introduced in this third-party library and later merged
73+
into CPython. The following table indicates which versions of this library
74+
were contributed to different versions in the standard library:
75+
76+
.. list-table::
77+
:header-rows: 1
78+
79+
* - importlib_metadata
80+
- stdlib
81+
* - 4.8
82+
- 3.11
83+
* - 4.4
84+
- 3.10
85+
* - 1.4
86+
- 3.8
87+
88+
89+
Usage
90+
=====
91+
92+
See the `online documentation <https://importlib_metadata.readthedocs.io/>`_
93+
for usage details.
94+
95+
`Finder authors
96+
<https://docs.python.org/3/reference/import.html#finders-and-loaders>`_ can
97+
also add support for custom package installers. See the above documentation
98+
for details.
99+
100+
101+
Caveats
102+
=======
103+
104+
This project primarily supports third-party packages installed by PyPA
105+
tools (or other conforming packages). It does not support:
106+
107+
- Packages in the stdlib.
108+
- Packages installed without metadata.
109+
110+
Project details
111+
===============
112+
113+
* Project home: https://github.com/python/importlib_metadata
114+
* Report bugs at: https://github.com/python/importlib_metadata/issues
115+
* Code hosting: https://github.com/python/importlib_metadata
116+
* Documentation: https://importlib_metadata.readthedocs.io/
117+
118+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
importlib_metadata-4.10.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2+
importlib_metadata-4.10.1.dist-info/LICENSE,sha256=wNe6dAchmJ1VvVB8D9oTc-gHHadCuaSBAev36sYEM6U,571
3+
importlib_metadata-4.10.1.dist-info/METADATA,sha256=-HDYj3iK6bcjwN5MAoO58Op6WQIYQfbhl6ZaPqL0IZI,3989
4+
importlib_metadata-4.10.1.dist-info/RECORD,,
5+
importlib_metadata-4.10.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6+
importlib_metadata-4.10.1.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
7+
importlib_metadata-4.10.1.dist-info/top_level.txt,sha256=CO3fD9yylANiXkrMo4qHLV_mqXL2sC5JFKgt1yWAT-A,19
8+
importlib_metadata/__init__.py,sha256=7WxDdbPPu4Wy3VeMTApd-JlPQoENgVDyDH6aqyE7acE,30175
9+
importlib_metadata/__pycache__/__init__.cpython-310.pyc,,
10+
importlib_metadata/__pycache__/_adapters.cpython-310.pyc,,
11+
importlib_metadata/__pycache__/_collections.cpython-310.pyc,,
12+
importlib_metadata/__pycache__/_compat.cpython-310.pyc,,
13+
importlib_metadata/__pycache__/_functools.cpython-310.pyc,,
14+
importlib_metadata/__pycache__/_itertools.cpython-310.pyc,,
15+
importlib_metadata/__pycache__/_meta.cpython-310.pyc,,
16+
importlib_metadata/__pycache__/_text.cpython-310.pyc,,
17+
importlib_metadata/_adapters.py,sha256=B6fCi5-8mLVDFUZj3krI5nAo-mKp1dH_qIavyIyFrJs,1862
18+
importlib_metadata/_collections.py,sha256=CJ0OTCHIjWA0ZIVS4voORAsn2R4R2cQBEtPsZEJpASY,743
19+
importlib_metadata/_compat.py,sha256=EU2XCFBPFByuI0Of6XkAuBYbzqSyjwwwwqmsK4ccna0,1826
20+
importlib_metadata/_functools.py,sha256=PsY2-4rrKX4RVeRC1oGp1lB1pmC9eKN88_f-bD9uOoA,2895
21+
importlib_metadata/_itertools.py,sha256=cvr_2v8BRbxcIl5x5ldfqdHjhI8Yi8s8yk50G_nm6jQ,2068
22+
importlib_metadata/_meta.py,sha256=_F48Hu_jFxkfKWz5wcYS8vO23qEygbVdF9r-6qh-hjE,1154
23+
importlib_metadata/_text.py,sha256=HCsFksZpJLeTP3NEk_ngrAeXVRRtTrtyh9eOABoRP4A,2166
24+
importlib_metadata/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0

setuptools/_vendor/importlib_metadata-4.10.1.dist-info/REQUESTED

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Wheel-Version: 1.0
2+
Generator: bdist_wheel (0.37.1)
3+
Root-Is-Purelib: true
4+
Tag: py3-none-any
5+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
importlib_metadata

0 commit comments

Comments
 (0)