Skip to content

Replace uv version --no-sync with direct in-place file edits for version bumps#277

Closed
Copilot wants to merge 2 commits intoversion-orchestratorfrom
copilot/sub-pr-259
Closed

Replace uv version --no-sync with direct in-place file edits for version bumps#277
Copilot wants to merge 2 commits intoversion-orchestratorfrom
copilot/sub-pr-259

Conversation

Copy link

Copilot AI commented Mar 11, 2026

uv version --no-sync skips virtualenv sync but still runs the resolver, requiring network access and risking partial state (e.g. pyproject.toml rewritten, uv.lock not) on transient failures.

Changes

  • update_pyproject_version(path, target_version) — regex-patches the version field directly in the [project] section of pyproject.toml, anchored to that section to avoid false matches elsewhere:

    pattern = re.compile(r'(?ms)(\[project\](?:(?!\n\[).)*?\n)(version = ")([^"]+)(")')
  • update_uv_lock_version(path, package_name, target_version) — patches the version line in the matching [[package]] block of uv.lock using the invariant [[package]]\nname = "..."\nversion = "..." format generated by uv:

    pattern = re.compile(
        r'(?m)(^\[\[package\]\]\nname = "' + re.escape(package_name) + r'"\nversion = )"([^"]+)"'
    )
  • cmd_set / cmd_bump — both run_command(["uv", "version", ...]) calls replaced with the above functions. No uv subprocess is invoked; version bumps are now fully offline and atomic at the file level.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…dits

Co-authored-by: srozen <5946462+srozen@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on version orchestrator implementation Replace uv version --no-sync with direct in-place file edits for version bumps Mar 11, 2026
@srozen srozen closed this Mar 11, 2026
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.

2 participants