Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.28.x-0.49bx] Fix eachdist.py patch release to not add extra space #4289

Merged
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
Empty file modified .github/scripts/update-version-patch.sh
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions scripts/eachdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,9 @@ def update_patch_dependencies(targets, version, prev_version, packages):
operators_pattern = "|".join(re.escape(op) for op in operators)

for pkg in packages:
search = rf"({basename(pkg)}[^,]*)(\s?({operators_pattern})\s?)(.*{prev_version})"
replace = r"\1\2 " + version
search = rf"({basename(pkg)}[^,]*?)(\s?({operators_pattern})\s?)(.*{prev_version})"
Copy link
Member Author

Choose a reason for hiding this comment

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

For anyone reading this, I changed [^,]* to be lazy -> [^,]*? so the second group captures the whitespace. Then I remove the extra whitespace in the replace string

replace = r"\g<1>\g<2>" + version
print(f"{search=}\t{replace=}\t{pkg=}")
update_files(
targets,
"pyproject.toml",
Expand Down