Skip to content

Commit 6510d12

Browse files
authored
Update packaging to 23.0 (#3790)
2 parents 40911c1 + e48bbc6 commit 6510d12

File tree

109 files changed

+3709
-24132
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

+3709
-24132
lines changed

changelog.d/3790.breaking.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bump vendored version of :pypi:`packaging` to 23.0
2+
(:pypi:`pyparsing` is no longer required and was removed).
3+
As a consequence, users will experience a more strict parsing of requirements.
4+
Specifications that don't comply with :pep:`440` and :pep:`508` will result
5+
in build errors.

docs/userguide/declarative_config.rst

+10-8
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Key Type Minimum Version No
228228
======================= =================================== =============== ====================
229229
zip_safe bool
230230
setup_requires list-semi 36.7.0
231-
install_requires file:, list-semi **BETA** [#opt-6]_
231+
install_requires file:, list-semi **BETA** [#opt-2]_, [#opt-6]_
232232
extras_require file:, section **BETA** [#opt-2]_, [#opt-6]_
233233
python_requires str 34.4.0
234234
entry_points file:, section 51.0.0
@@ -251,17 +251,19 @@ data_files section 40.6.0 [#
251251
.. [#opt-1] In the ``package_data`` section, a key named with a single asterisk
252252
(``*``) refers to all packages, in lieu of the empty string used in ``setup.py``.
253253
254-
.. [#opt-2] In the ``extras_require`` section, values are parsed as ``list-semi``.
255-
This implies that in order to include markers, they **must** be *dangling*:
254+
.. [#opt-2] In ``install_requires`` and ``extras_require``, values are parsed as ``list-semi``.
255+
This implies that in order to include markers, each requirement **must** be *dangling*
256+
in a new line:
256257
257258
.. code-block:: ini
258259
260+
[options]
261+
install_requires =
262+
importlib-metadata; python_version<"3.8"
263+
259264
[options.extras_require]
260-
rest = docutils>=0.3; pack ==1.1, ==1.3
261-
pdf =
262-
ReportLab>=1.2
263-
RXP
264-
importlib-metadata; python_version < "3.8"
265+
all =
266+
importlib-metadata; python_version < "3.8"
265267
266268
.. [#opt-3] The ``find:`` and ``find_namespace:`` directive can be further configured
267269
in a dedicated subsection ``options.packages.find``. This subsection accepts the

pkg_resources/_vendor/jaraco.context-4.2.0.dist-info/RECORD

-8
This file was deleted.

pkg_resources/_vendor/jaraco.context-4.2.0.dist-info/METADATA renamed to pkg_resources/_vendor/jaraco.context-4.3.0.dist-info/METADATA

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: jaraco.context
3-
Version: 4.2.0
3+
Version: 4.3.0
44
Summary: Context managers by jaraco
55
Home-page: https://github.com/jaraco/jaraco.context
66
Author: Jason R. Coombs
@@ -17,16 +17,17 @@ Requires-Dist: sphinx (>=3.5) ; extra == 'docs'
1717
Requires-Dist: jaraco.packaging (>=9) ; extra == 'docs'
1818
Requires-Dist: rst.linker (>=1.9) ; extra == 'docs'
1919
Requires-Dist: furo ; extra == 'docs'
20+
Requires-Dist: sphinx-lint ; extra == 'docs'
2021
Requires-Dist: jaraco.tidelift (>=1.4) ; extra == 'docs'
2122
Provides-Extra: testing
2223
Requires-Dist: pytest (>=6) ; extra == 'testing'
2324
Requires-Dist: pytest-checkdocs (>=2.4) ; extra == 'testing'
24-
Requires-Dist: pytest-flake8 ; extra == 'testing'
2525
Requires-Dist: flake8 (<5) ; extra == 'testing'
2626
Requires-Dist: pytest-cov ; extra == 'testing'
2727
Requires-Dist: pytest-enabler (>=1.3) ; extra == 'testing'
2828
Requires-Dist: pytest-black (>=0.3.7) ; (platform_python_implementation != "PyPy") and extra == 'testing'
2929
Requires-Dist: pytest-mypy (>=0.9.1) ; (platform_python_implementation != "PyPy") and extra == 'testing'
30+
Requires-Dist: pytest-flake8 ; (python_version < "3.12") and extra == 'testing'
3031

3132
.. image:: https://img.shields.io/pypi/v/jaraco.context.svg
3233
:target: https://pypi.org/project/jaraco.context
@@ -44,7 +45,7 @@ Requires-Dist: pytest-mypy (>=0.9.1) ; (platform_python_implementation != "PyPy"
4445
.. image:: https://readthedocs.org/projects/jaracocontext/badge/?version=latest
4546
:target: https://jaracocontext.readthedocs.io/en/latest/?badge=latest
4647

47-
.. image:: https://img.shields.io/badge/skeleton-2022-informational
48+
.. image:: https://img.shields.io/badge/skeleton-2023-informational
4849
:target: https://blog.jaraco.com/skeleton
4950

5051
.. image:: https://tidelift.com/badges/package/pypi/jaraco.context
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
jaraco.context-4.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2+
jaraco.context-4.3.0.dist-info/LICENSE,sha256=2z8CRrH5J48VhFuZ_sR4uLUG63ZIeZNyL4xuJUKF-vg,1050
3+
jaraco.context-4.3.0.dist-info/METADATA,sha256=GqMykAm33E7Tt_t_MHc5O7GJN62Qwp6MEHX9WD-LPow,2958
4+
jaraco.context-4.3.0.dist-info/RECORD,,
5+
jaraco.context-4.3.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
6+
jaraco.context-4.3.0.dist-info/top_level.txt,sha256=0JnN3LfXH4LIRfXL-QFOGCJzQWZO3ELx4R1d_louoQM,7
7+
jaraco/__pycache__/context.cpython-38.pyc,,
8+
jaraco/context.py,sha256=vlyDzb_PvZ9H7R9bbTr_CMRnveW5Dc56eC7eyd_GfoA,7460

pkg_resources/_vendor/jaraco/context.py

+35
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@
55
import tempfile
66
import shutil
77
import operator
8+
import warnings
89

910

1011
@contextlib.contextmanager
1112
def pushd(dir):
13+
"""
14+
>>> tmp_path = getfixture('tmp_path')
15+
>>> with pushd(tmp_path):
16+
... assert os.getcwd() == os.fspath(tmp_path)
17+
>>> assert os.getcwd() != os.fspath(tmp_path)
18+
"""
19+
1220
orig = os.getcwd()
1321
os.chdir(dir)
1422
try:
@@ -29,6 +37,8 @@ def tarball_context(url, target_dir=None, runner=None, pushd=pushd):
2937
target_dir = os.path.basename(url).replace('.tar.gz', '').replace('.tgz', '')
3038
if runner is None:
3139
runner = functools.partial(subprocess.check_call, shell=True)
40+
else:
41+
warnings.warn("runner parameter is deprecated", DeprecationWarning)
3242
# In the tar command, use --strip-components=1 to strip the first path and
3343
# then
3444
# use -C to cause the files to be extracted to {target_dir}. This ensures
@@ -48,6 +58,15 @@ def tarball_context(url, target_dir=None, runner=None, pushd=pushd):
4858
def infer_compression(url):
4959
"""
5060
Given a URL or filename, infer the compression code for tar.
61+
62+
>>> infer_compression('http://foo/bar.tar.gz')
63+
'z'
64+
>>> infer_compression('http://foo/bar.tgz')
65+
'z'
66+
>>> infer_compression('file.bz')
67+
'j'
68+
>>> infer_compression('file.xz')
69+
'J'
5170
"""
5271
# cheat and just assume it's the last two characters
5372
compression_indicator = url[-2:]
@@ -61,6 +80,12 @@ def temp_dir(remover=shutil.rmtree):
6180
"""
6281
Create a temporary directory context. Pass a custom remover
6382
to override the removal behavior.
83+
84+
>>> import pathlib
85+
>>> with temp_dir() as the_dir:
86+
... assert os.path.isdir(the_dir)
87+
... _ = pathlib.Path(the_dir).joinpath('somefile').write_text('contents')
88+
>>> assert not os.path.exists(the_dir)
6489
"""
6590
temp_dir = tempfile.mkdtemp()
6691
try:
@@ -90,6 +115,12 @@ def repo_context(url, branch=None, quiet=True, dest_ctx=temp_dir):
90115

91116
@contextlib.contextmanager
92117
def null():
118+
"""
119+
A null context suitable to stand in for a meaningful context.
120+
121+
>>> with null() as value:
122+
... assert value is None
123+
"""
93124
yield
94125

95126

@@ -112,6 +143,10 @@ class ExceptionTrap:
112143
... raise ValueError("1 + 1 is not 3")
113144
>>> bool(trap)
114145
True
146+
>>> trap.value
147+
ValueError('1 + 1 is not 3')
148+
>>> trap.tb
149+
<traceback object at ...>
115150
116151
>>> with ExceptionTrap(ValueError) as trap:
117152
... raise Exception()

0 commit comments

Comments
 (0)