Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions run_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import argparse
import asyncio
import contextlib
import datetime as dt
import functools
import getpass
import json
Expand Down Expand Up @@ -1110,38 +1109,6 @@ def purge_the_cdn(db: ReleaseShelf) -> None:
raise RuntimeError("Failed to purge the python.org/downloads CDN")


def modify_the_prereleases_page(db: ReleaseShelf) -> None:
if db["release"].is_final:
if not ask_question(
"Have you already removed the release from https://www.python.org/download/pre-releases/ ?"
):
raise ReleaseException(
"The release has not been removed from the pre-releases page"
)
else:
if not ask_question(
"Have you already added the release to https://www.python.org/download/pre-releases/ ?"
):
raise ReleaseException(
"The release has not been added to the pre-releases page"
)


def modify_the_docs_by_version_page(db: ReleaseShelf) -> None:
if db["release"].is_final:
version = db["release"]
date = dt.datetime.now().strftime("%d %B %Y")
if not ask_question(
"Have you already added the docs to https://www.python.org/doc/versions/ ?\n"
"For example:\n"
f"* `Python {version} <https://docs.python.org/release/{version}/>`_, "
f"documentation released on {date}."
):
raise ReleaseException(
"The docs have not been added to the docs by version page"
)


def announce_release(db: ReleaseShelf) -> None:
if not ask_question(
"Have you announced the release at https://discuss.python.org/c/core-dev/23 "
Expand Down Expand Up @@ -1478,8 +1445,6 @@ def _api_key(api_key: str) -> str:
Task(remove_temporary_branch, "Removing temporary release branch"),
Task(run_add_to_python_dot_org, "Add files to python.org download page"),
Task(purge_the_cdn, "Purge the CDN of python.org/downloads"),
Task(modify_the_prereleases_page, "Modify the pre-release page"),
Task(modify_the_docs_by_version_page, "Update docs by version page"),
Task(announce_release, "Announce the release"),
]
automata = ReleaseDriver(
Expand Down
84 changes: 0 additions & 84 deletions tests/test_run_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,90 +147,6 @@ def test_check_doc_unreleased_version_waived(monkeypatch, tmp_path: Path) -> Non
run_release.check_doc_unreleased_version(cast(ReleaseShelf, db))


@pytest.mark.parametrize(
["tag", "expected"],
[
("3.14.0a7", "Have you already added the release to "),
("3.13.3", "Have you already removed the release from "),
],
)
def test_modify_the_prerelease_page_yes(
capsys, monkeypatch, tag: str, expected: str
) -> None:
# Arrange
db = {"release": Tag(tag)}

# Act
with fake_answers(monkeypatch, ["yes"]):
run_release.modify_the_prereleases_page(cast(ReleaseShelf, db))

# Assert
assert expected in capsys.readouterr().out


@pytest.mark.parametrize(
["tag", "expected"],
[
("3.14.0a7", "The release has not been added to the pre-releases page"),
("3.13.3", "The release has not been removed from the pre-releases page"),
],
)
def test_modify_the_prerelease_page_no(monkeypatch, tag: str, expected: str) -> None:
# Arrange
db = {"release": Tag(tag)}

# Act
with (
fake_answers(monkeypatch, ["no"]),
pytest.raises(run_release.ReleaseException, match=expected),
):
run_release.modify_the_prereleases_page(cast(ReleaseShelf, db))


def test_modify_the_docs_by_version_page_prerelease(capsys) -> None:
# Arrange
db = {"release": Tag("3.14.0a7")}

# Act
run_release.modify_the_docs_by_version_page(cast(ReleaseShelf, db))

# Assert
assert capsys.readouterr().out == ""


def test_modify_the_docs_by_version_page_final_no(capsys, monkeypatch) -> None:
# Arrange
db = {"release": Tag("3.13.3")}

# Act
with (
fake_answers(monkeypatch, ["no"]),
pytest.raises(run_release.ReleaseException),
):
run_release.modify_the_docs_by_version_page(cast(ReleaseShelf, db))

# Assert
assert (
"* `Python 3.13.3 <https://docs.python.org/release/3.13.3/>`_, documentation released on"
in capsys.readouterr().out
)


def test_modify_the_docs_by_version_page_final_yes(capsys, monkeypatch) -> None:
# Arrange
db = {"release": Tag("3.13.3")}

# Act
with fake_answers(monkeypatch, ["yes"]):
run_release.modify_the_docs_by_version_page(cast(ReleaseShelf, db))

# Assert
assert (
"* `Python 3.13.3 <https://docs.python.org/release/3.13.3/>`_, documentation released on"
in capsys.readouterr().out
)


def test_update_whatsnew_toctree(tmp_path: Path) -> None:
# Arrange
# Only first beta triggers update
Expand Down