Skip to content

Commit 1f6fe1e

Browse files
committed
Merge branch 'main' into remove-distribution-local
2 parents 4a2f7d5 + 5ad9047 commit 1f6fe1e

File tree

11 files changed

+57
-21
lines changed

11 files changed

+57
-21
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@ jobs:
77
strategy:
88
matrix:
99
python:
10-
- 3.6
10+
- 3.7
1111
- 3.9
12-
- 3.10.0-alpha - 3.10.99
13-
platform: [ubuntu-latest, macos-latest, windows-latest]
12+
- "3.10"
13+
platform:
14+
- ubuntu-latest
15+
- macos-latest
16+
- windows-latest
1417
runs-on: ${{ matrix.platform }}
1518
steps:
1619
- uses: actions/checkout@v2
20+
with:
21+
# fetch all branches and tags (to get tags for versioning)
22+
# ref actions/checkout#448
23+
fetch-depth: 0
24+
1725
- name: Setup Python
1826
uses: actions/setup-python@v2
1927
with:
@@ -52,7 +60,7 @@ jobs:
5260
- name: Setup Python
5361
uses: actions/setup-python@v2
5462
with:
55-
python-version: 3.9
63+
python-version: "3.10"
5664
- name: Install tox
5765
run: |
5866
python -m pip install tox

CHANGES.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
v4.9.0
2-
======
1+
v4.10.0
2+
=======
33

44
* #354: Removed ``Distribution._local`` factory. This
55
functionality was created as a demonstration of the
@@ -8,6 +8,25 @@ v4.9.0
88
provides this functionality directly through
99
`pep517.meta.load <https://github.com/pypa/pep517/blob/a942316305395f8f757f210e2b16f738af73f8b8/pep517/meta.py#L63-L73>`_.
1010

11+
v4.9.0
12+
======
13+
14+
* Require Python 3.7 or later.
15+
16+
v4.8.3
17+
======
18+
19+
* #357: Fixed requirement generation from egg-info when a
20+
URL requirement is given.
21+
22+
v4.8.2
23+
======
24+
25+
v2.1.2
26+
======
27+
28+
* #353: Fixed discovery of distributions when path is empty.
29+
1130
v4.8.1
1231
======
1332

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ were contributed to different versions in the standard library:
4040

4141
* - importlib_metadata
4242
- stdlib
43+
* - 4.8
44+
- 3.11
4345
* - 4.4
4446
- 3.10
4547
* - 1.4

docs/using.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function::
236236
Package distributions
237237
---------------------
238238

239-
A convience method to resolve the distribution or
239+
A convenience method to resolve the distribution or
240240
distributions (in the case of a namespace package) for top-level
241241
Python packages or modules::
242242

importlib_metadata/__init__.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,16 +684,25 @@ def _convert_egg_info_reqs_to_simple_reqs(sections):
684684
def make_condition(name):
685685
return name and f'extra == "{name}"'
686686

687-
def parse_condition(section):
687+
def quoted_marker(section):
688688
section = section or ''
689689
extra, sep, markers = section.partition(':')
690690
if extra and markers:
691691
markers = f'({markers})'
692692
conditions = list(filter(None, [markers, make_condition(extra)]))
693693
return '; ' + ' and '.join(conditions) if conditions else ''
694694

695+
def url_req_space(req):
696+
"""
697+
PEP 508 requires a space between the url_spec and the quoted_marker.
698+
Ref python/importlib_metadata#357.
699+
"""
700+
# '@' is uniquely indicative of a url_req.
701+
return ' ' * ('@' in req)
702+
695703
for section in sections:
696-
yield section.value + parse_condition(section.name)
704+
space = url_req_space(section.value)
705+
yield section.value + space + quoted_marker(section.name)
697706

698707

699708
class DistributionFinder(MetaPathFinder):
@@ -748,6 +757,9 @@ class FastPath:
748757
"""
749758
Micro-optimized class for searching a path for
750759
children.
760+
761+
>>> FastPath('').children()
762+
['...']
751763
"""
752764

753765
@functools.lru_cache() # type: ignore
@@ -762,7 +774,7 @@ def joinpath(self, child):
762774

763775
def children(self):
764776
with suppress(Exception):
765-
return os.listdir(self.root or '')
777+
return os.listdir(self.root or '.')
766778
with suppress(Exception):
767779
return self.zip_children()
768780
return []

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=56", "wheel", "setuptools_scm[toml]>=3.4.1"]
2+
requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.black]

pytest.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
norecursedirs=dist build .tox .eggs
33
addopts=--doctest-modules
44
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
5-
# workaround for warning pytest-dev/pytest#6178
6-
junit_family=xunit2
75
filterwarnings=
86
# Suppress deprecation warning in flake8
97
ignore:SelectableGroups dict interface is deprecated::flake8
10-
# Suppress deprecation warning in pypa/packaging#433
11-
ignore:The distutils package is deprecated::packaging.tags

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ classifiers =
1515
[options]
1616
packages = find_namespace:
1717
include_package_data = true
18-
python_requires = >=3.6
18+
python_requires = >=3.7
1919
install_requires =
2020
zipp>=0.5
2121
typing-extensions>=3.6.4; python_version < "3.8"
@@ -31,7 +31,7 @@ exclude =
3131
[options.extras_require]
3232
testing =
3333
# upstream
34-
pytest >= 4.6
34+
pytest >= 6
3535
pytest-checkdocs >= 2.4
3636
pytest-flake8
3737
pytest-black >= 0.3.7; \

tests/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from typing import Dict, Union
1212

1313
try:
14-
from importlib import resources
14+
from importlib import resources # type: ignore
1515

1616
getattr(resources, 'files')
1717
getattr(resources, 'as_file')

tests/test_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def test_more_complex_deps_requires_text(self):
245245
246246
[extra1]
247247
dep4
248+
dep6@ git+https://example.com/python/[email protected]
248249
249250
[extra2:python_version < "3"]
250251
dep5
@@ -257,6 +258,7 @@ def test_more_complex_deps_requires_text(self):
257258
'dep3; python_version < "3"',
258259
'dep4; extra == "extra1"',
259260
'dep5; (python_version < "3") and extra == "extra2"',
261+
'dep6@ git+https://example.com/python/[email protected] ; extra == "extra1"',
260262
]
261263
# It's important that the environment marker expression be
262264
# wrapped in parentheses to avoid the following 'and' binding more

0 commit comments

Comments
 (0)