Skip to content

Commit 6a30b07

Browse files
Merge branch 'main' into fix-windows-manifest-download-button
2 parents 431447e + 4b35a98 commit 6a30b07

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
tox -e py
3232
3333
- name: Upload coverage
34-
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
34+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
3535
with:
3636
token: ${{ secrets.CODECOV_ORG_TOKEN }}

‎run_release.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,10 @@ def wait_until_all_files_are_in_folder(db: ReleaseShelf) -> None:
10391039
raise FileNotFoundError(
10401040
f"The release folder in {destination} has not been created"
10411041
) from None
1042-
are_windows_files_there = f"python-{release}.exe" in all_files
1042+
if db["release"].as_tuple() >= (3, 16):
1043+
are_windows_files_there = f"windows-{release}.json" in all_files
1044+
else:
1045+
are_windows_files_there = f"python-{release}.exe" in all_files
10431046
are_macos_files_there = f"python-{release}-macos11.pkg" in all_files
10441047
are_linux_files_there = f"Python-{release}.tgz" in all_files
10451048

‎tests/test_run_release.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from contextlib import nullcontext as does_not_raise
77
from pathlib import Path
88
from typing import Any, cast
9+
from unittest.mock import Mock
910

1011
import pytest
1112

@@ -258,3 +259,33 @@ def test_update_whatsnew_toctree(tmp_path: Path) -> None:
258259
# Assert
259260
new_contents = toctree__file.read_text()
260261
assert " 3.15.rst\n 3.14.rst\n" in new_contents
262+
263+
264+
@pytest.mark.parametrize(
265+
("version", "windows_file"),
266+
[
267+
("3.15.0a1", "python-3.15.0a1.exe"),
268+
("3.16.0a1", "windows-3.16.0a1.json"),
269+
],
270+
)
271+
def test_wait_until_all_files_are_in_folder_windows(
272+
monkeypatch: pytest.MonkeyPatch, version: str, windows_file: str
273+
) -> None:
274+
files = [f"Python-{version}.tgz", f"python-{version}-macos11.pkg"]
275+
client = Mock()
276+
ftp_client = client.open_sftp.return_value
277+
ftp_client.listdir.side_effect = [files, [*files, windows_file]]
278+
monkeypatch.setattr("run_release.paramiko.SSHClient", lambda: client)
279+
sleep = Mock()
280+
monkeypatch.setattr("run_release.time.sleep", sleep)
281+
db = {
282+
"release": Tag(version),
283+
"security_release": False,
284+
"ssh_user": "release-manager",
285+
"ssh_key": None,
286+
}
287+
288+
run_release.wait_until_all_files_are_in_folder(cast(ReleaseShelf, db))
289+
290+
assert ftp_client.listdir.call_count == 2
291+
sleep.assert_called_once_with(1)

0 commit comments

Comments
 (0)