Skip to content

Commit 66809b5

Browse files
zoobahugovk
andauthored
Allows windows-<VER>.json files to be added to pydotorg (python#255)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent d921f4e commit 66809b5

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

add_to_pydotorg.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,18 +271,12 @@ def list_files(release: str) -> Generator[tuple[str, str, int, bool, str], None,
271271
if rfile.endswith((".asc", ".sig", ".crt", ".sigstore", ".spdx.json")):
272272
continue
273273

274-
for prefix in ("python", "Python"):
275-
if rfile.startswith(prefix):
276-
break
277-
else:
274+
prefix, _, rest = rfile.partition("-")
275+
276+
if prefix.lower() not in ("python", "windows"):
278277
print(f" File {reldir}/{rfile} has wrong prefix")
279278
continue
280279

281-
try:
282-
prefix, rest = rfile.split("-", 1)
283-
except: # noqa: E722
284-
prefix, rest = rfile, ""
285-
286280
if not rest.startswith((release + "-", release + ".")):
287281
print(f" File {reldir}/{rfile} has a different version")
288282
continue

tests/test_add_to_pydotorg.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,11 @@ def test_list_files(fs: FakeFilesystem) -> None:
145145
"for macOS 10.13 and later",
146146
),
147147
("python-3.14.0b3.exe", "Windows installer (32-bit)", 1, False, ""),
148+
(
149+
"windows-3.14.0b3.json",
150+
"Windows release manifest",
151+
1,
152+
False,
153+
"Install with 'py install 3.14'",
154+
),
148155
]

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ deps =
1111
-r dev-requirements.txt
1212
-r requirements.txt
1313
commands =
14-
{envpython} -m pytest \
14+
{envpython} -m pytest -vv \
1515
tests/ \
1616
--cov . \
1717
--cov tests \

0 commit comments

Comments
 (0)