Skip to content

Commit 1790f17

Browse files
Introduced a hardcoded list of project to include as plugins beyond those found by their names. (#11077)
1 parent ee8baa2 commit 1790f17

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

scripts/update-plugin-list.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
===========
1818
1919
PyPI projects that match "pytest-\*" are considered plugins and are listed
20-
automatically. Packages classified as inactive are excluded.
20+
automatically together with a manually-maintained list in `the source
21+
code <https://github.com/pytest-dev/pytest/blob/main/scripts/update-plugin-list.py>`_.
22+
Packages classified as inactive are excluded.
2123
2224
.. The following conditional uses a different format for this list when
2325
creating a PDF, because otherwise the table gets far too wide for the
@@ -33,6 +35,9 @@
3335
"Development Status :: 6 - Mature",
3436
"Development Status :: 7 - Inactive",
3537
)
38+
ADDITIONAL_PROJECTS = { # set of additional projects to consider as plugins
39+
"logassert",
40+
}
3641

3742

3843
def escape_rst(text: str) -> str:
@@ -52,18 +57,18 @@ def iter_plugins():
5257
regex = r">([\d\w-]*)</a>"
5358
response = requests.get("https://pypi.org/simple")
5459

55-
matches = list(
56-
match
57-
for match in re.finditer(regex, response.text)
58-
if match.groups()[0].startswith("pytest-")
59-
)
60+
match_names = (match.groups()[0] for match in re.finditer(regex, response.text))
61+
plugin_names = [
62+
name
63+
for name in match_names
64+
if name.startswith("pytest-") or name in ADDITIONAL_PROJECTS
65+
]
6066

61-
for match in tqdm(matches, smoothing=0):
62-
name = match.groups()[0]
67+
for name in tqdm(plugin_names, smoothing=0):
6368
response = requests.get(f"https://pypi.org/pypi/{name}/json")
6469
if response.status_code == 404:
65-
# Some packages, like pytest-azurepipelines42, are included in https://pypi.org/simple but
66-
# return 404 on the JSON API. Skip.
70+
# Some packages, like pytest-azurepipelines42, are included in https://pypi.org/simple
71+
# but return 404 on the JSON API. Skip.
6772
continue
6873
response.raise_for_status()
6974
info = response.json()["info"]

0 commit comments

Comments
 (0)