Skip to content

Fix repo check: b1 is special and still made from main, not 3.x#379

Merged
hugovk merged 4 commits intopython:mainfrom
hugovk:special-b1
May 8, 2026
Merged

Fix repo check: b1 is special and still made from main, not 3.x#379
hugovk merged 4 commits intopython:mainfrom
hugovk:special-b1

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented May 7, 2026

Fix the check added in #334:

❯ .venv/bin/python run_release.py --repository ../cpython-3.15 --ssh-user hugovk --release 3.15.0b1
Release data:
- Branch: 3.15
- Release tag: 3.15.0b1
- Normalized release tag: 3.15.0
- Git repo: ../cpython-3.15
- SSH username: hugovk
- SSH key: Default
- Sign with GPG: False
- Security release: False

✅  Checking gh is available
✅  Checking Git is available
✅  Checking make is available
✅  Checking blurb is available
✅  Checking Docker is available
✅  Checking Docker is running
✅  Checking autoconf is available
✅  Validating ssh connection to downloads.nyc1.psf.io and docs.nyc1.psf.io
✅  Checking Sigstore CLI
💥  Checking CPython repository branch
Traceback (most recent call last):
  File "/Users/hugo/github/release-tools/run_release.py", line 1483, in <module>
    main()
    ~~~~^^
  File "/Users/hugo/github/release-tools/run_release.py", line 1479, in main
    automata.run()
    ~~~~~~~~~~~~^^
  File "/Users/hugo/github/release-tools/run_release.py", line 281, in run
    raise e from None
  File "/Users/hugo/github/release-tools/run_release.py", line 278, in run
    self.current_task(self.db)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/hugo/github/release-tools/release.py", line 151, in __call__
    return getattr(self, "function")(db)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
  File "/Users/hugo/github/release-tools/run_release.py", line 433, in check_cpython_repo_branch
    raise ReleaseException(
    ...<2 lines>...
    )
ReleaseException: CPython repository is on main branch, expected 3.15

Beta 1 is special: like all alphas, we start from the main branch. At the end of b1, the next 3.x branch is created, and then that will be used for b2 and later.

Copy link
Copy Markdown
Member

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A stylistic nit which you can take or leave as is, but this looks right to me!

Comment thread release.py Outdated
@hugovk
Copy link
Copy Markdown
Member Author

hugovk commented May 7, 2026

Two new commits, followup bug when trying to make the new 3.15 branch:

✅  Merge the tag into the release branch
Already on 'main'
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)
fatal: a branch named 'main' already exists
💥  Branch out new versions and prepare main branch
Traceback (most recent call last):
  File "/Users/hugo/github/release-tools/run_release.py", line 1483, in <module>
    main()
    ~~~~^^
  File "/Users/hugo/github/release-tools/run_release.py", line 1479, in main
    automata.run()
    ~~~~~~~~~~~~^^
  File "/Users/hugo/github/release-tools/run_release.py", line 281, in run
    raise e from None
  File "/Users/hugo/github/release-tools/run_release.py", line 278, in run
    self.current_task(self.db)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/hugo/github/release-tools/release.py", line 151, in __call__
    return getattr(self, "function")(db)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
  File "/Users/hugo/github/release-tools/run_release.py", line 1247, in branch_new_versions
    subprocess.check_call(
    ~~~~~~~~~~~~~~~~~~~~~^
        ["git", "checkout", "-b", release_tag.branch],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        cwd=db["git_repo"],
        ^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/subprocess.py", line 420, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'checkout', '-b', 'main']' returned non-zero exit status 128.

From here:

def branch_new_versions(db: ReleaseShelf) -> None:
    release_tag: release_mod.Tag = db["release"]

    if not release_tag.is_feature_freeze_release:
        return

    subprocess.check_call(["git", "checkout", "main"], cwd=db["git_repo"])

    subprocess.check_call(
        ["git", "checkout", "-b", release_tag.branch],
        cwd=db["git_repo"],
    )

This is a feature freeze, we don't return early. But the new branch should be x.y (basic_version), not main (release_tag.branch).

And a similar change in post_release_tagging: switch to x.y branch not main.

@hugovk hugovk merged commit e7515f5 into python:main May 8, 2026
18 checks passed
@hugovk hugovk deleted the special-b1 branch May 8, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants