Skip to content

ci(version-check): require uv.lock sync alongside pyproject changes#82

Merged
lelia merged 2 commits into
mainfrom
erichibbs/ce-202-add-uvlock-sync-check-to-sdk
May 22, 2026
Merged

ci(version-check): require uv.lock sync alongside pyproject changes#82
lelia merged 2 commits into
mainfrom
erichibbs/ce-202-add-uvlock-sync-check-to-sdk

Conversation

@flowstate
Copy link
Copy Markdown
Contributor

Summary

Resolves CE-202. Mirrors the workflow + script changes from
socket-python-cli#204
so the SDK catches uv.lock drift the same way the CLI now does.

Changes

  • .github/workflows/version-check.yml — trigger paths drop the unused
    setup.py entry, add uv.lock. New CI step fails if pyproject.toml
    was modified without a matching uv.lock update.
  • .hooks/sync_version.py — new run_uv_lock() helper runs uv lock and detects whether the lockfile changed. Wired into all three exit paths (--dev auto-bump, normal auto-bump, already-bumped) so the hook either updates uv.lock for you or tells you to commit it.

No pyproject.toml or socketdev/** changes in this PR, so the version-check workflow won't fire on its own merge (no version bump needed).

Test plan

  • Manual smoke: ran .hooks/sync_version.py in three local states.

    • Versions matching (auto-bump path): bumped version files, ran uv lock, exited 1 with "Please git add and uv.lock + commit".
    • Versions already bumped, lockfile already in sync: ran uv lock, no changes, exited 0.
    • Lockfile-drift path is the same uv lock-changed branch covered above — single helper drives all three exits.

    ref: CE-202

Resolves CE-202. Mirrors the workflow + script changes from
socket-python-cli#204 so the SDK catches lockfile drift the same way
the CLI now does:

- workflow: trigger paths drop unused setup.py, add uv.lock; new step
  fails CI if pyproject.toml is modified without uv.lock.
- sync_version.py: new run_uv_lock() helper runs 'uv lock' and signals
  whether the lockfile changed. Wired into all three exit paths
  (--dev auto-bump, normal auto-bump, already-bumped) so the hook
  either updates uv.lock for you or tells you to commit it.
@flowstate Eric Hibbs (flowstate) requested a review from a team as a code owner May 21, 2026 20:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

🚀 Preview package published!

Install with:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketdev==3.1.0.dev5

Mirrors socket-python-cli's fix at 0462b77 (in PR #199). The workflow
previously only compared the PR version against main, which missed
the case where the same or newer version had already been published
to PyPI — that would slip through CI and either collide on publish
or leave PyPI ahead of the repo.

- workflow: hits pypi.org/pypi/socketdev/json, filters to stable
  (non-prerelease, non-devrelease), requires PR > max(main, PyPI).
- sync_version.py: splits PYPI_PROD_API vs PYPI_TEST_API. Stable
  auto-bumps now use prod PyPI as the floor via
  find_next_stable_patch_version(). The .devN flow keeps using
  TestPyPI. New 'already bumped but ≤ PyPI' path auto-corrects the
  version when somebody bumps to a stale number.
Copy link
Copy Markdown
Contributor

@lelia lelia left a comment

Choose a reason for hiding this comment

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

🤞🚀

@lelia lelia merged commit 8b668fd into main May 22, 2026
6 checks passed
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