Prepare Release 0.1.2 (And Release Helper)#110
Conversation
This is not necessary but bumping the example uv.lock files felt a bit annoying, so I decided to script it. The pre-release -> release instructions in our notes were also missing, so I added that in.
If the examples dependencies haven't been already pulled in by another command, lint can fail. Run our ruff checks with those extra bits in the environment explicitly.
Using the fancy helper.
erikrose
left a comment
There was a problem hiding this comment.
Could you remove the lookbehind? Then we're ready to rock.
| 5. (Pending) If the release is built successfully, it will make its way to PyPI | ||
| via trusted publishing. | ||
|
|
||
| 5. If the release workflow succeeds, a new pre-release will be avilable on |
| via trusted publishing. | ||
|
|
||
| 5. If the release workflow succeeds, a new pre-release will be avilable on | ||
| Github. Afer review and update of the generated changelog, use the |
| cargo_path = root_dir / "crates" / "fastly-compute-py" / "Cargo.toml" | ||
|
|
||
| # pyrpoject.toml: Matches `version = "X.Y.Z"` under [project] | ||
| update_file_version(pyproject_path, r'(?<=^version = ")[^"]+', new_version) |
There was a problem hiding this comment.
I imagine (though didn't measure) that the lookbehind is less efficient than doing this…
# pyrpoject.toml: Matches `version = "X.Y.Z"` under [project]
update_file_version(pyproject_path, r'^version = "[^"]+', 'version = "' + new_version)
# Cargo.toml: Matches `version = "X.Y.Z"` under [package]
update_file_version(cargo_path, r'^version = "[^"]+', 'version = "' + new_version)…since it has to find every instance of a run of non-quote chars and then look behind it to see if it's preceded by "version = ". The forward-looking version shouldn't do any unnecessary work.
Okay, I couldn't help myself. I measured. Before:
100,000 iterations in 2.436s — 24.358 µs/iter
After:
100,000 iterations in 0.013s — 0.134 µs/iter
:-)
There was a problem hiding this comment.
I can remove the lookbehind; N here (the size of the file) will never be large enough for it to matter at all and this is a utility running on a controlled input run in a context that is not performance sensitive in the least.
There was a problem hiding this comment.
True, it's just that it hurts my soul. :-)
Release bump; so I don't forget the steps I added a helper with a Make target for doing the bumps a little bit easier. Mostly just wanted to be a bit more competent in getting all the uv.lock updates for the examples as they exist currently.
The docs were also updated to reference this and added the pre-release -> release step to get things on to PyPI.