Skip to content

fix: update prek rev in README.md during mirror - #172

Merged
MichaReiser merged 2 commits into
astral-sh:mainfrom
Anselmoo:fix/mirror-prek-rev
Jun 22, 2026
Merged

fix: update prek rev in README.md during mirror#172
MichaReiser merged 2 commits into
astral-sh:mainfrom
Anselmoo:fix/mirror-prek-rev

Conversation

@Anselmoo

Copy link
Copy Markdown
Contributor

Closes #171

Problem

mirror.py updates all pre-commit YAML-style rev: entries in README.md but silently skips the prek TOML-style rev = entry. After many mirror runs the prek block drifted 18 releases behind:

rev = "v0.15.0"  # ← never updated

while all pre-commit blocks showed the current version:

rev: v0.15.18  # ← correctly updated

Root cause

replace_readme_md matched rev: v\d+… (colon, no quotes) but not rev = "v\d+…" (equals + quotes).

Fix

One additional re.sub call in replace_readme_md:

content = re.sub(r'rev = "v\d+\.\d+\.\d+"', f'rev = "v{version}"', content)

The second commit also corrects the currently stale rev = "v0.15.0" in README.md to v0.15.18.


Note: Tools like repo-release-tools can help prevent this class of bug by declaring all version string locations as pin_targets in pyproject.toml — if a location is missing from the config, rrt release check flags it before it can drift.

Anselmoo and others added 2 commits June 21, 2026 22:38
Closes astral-sh#171

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 21, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you

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.

mirror.py does not update prek rev in README.md

3 participants