Skip to content

fix: sync uv.lock with pyproject.toml after python-deps bump#226

Merged
caitlon merged 3 commits into
developfrom
fix/uv-lock-sync
Jun 5, 2026
Merged

fix: sync uv.lock with pyproject.toml after python-deps bump#226
caitlon merged 3 commits into
developfrom
fix/uv-lock-sync

Conversation

@caitlon

@caitlon caitlon commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Greptile Summary

This PR syncs uv.lock with pyproject.toml after a dependency bump and makes two related cleanups: the CI lock-file assertion is tightened from --frozen to --locked, and both MemberRole and AccessLevel enums are migrated from the older (str, Enum) mixin pattern to StrEnum.

  • CI (ci.yml): All four uv sync --frozen calls are replaced with uv sync --locked. --frozen only requires the lockfile to exist; --locked additionally asserts it is consistent with pyproject.toml, so future dep bumps without a corresponding lockfile regeneration will now fail fast in CI.
  • api/db/models.py & api/dependencies.py: MemberRole and AccessLevel are rewritten as enum.StrEnum / StrEnum, the idiomatic form since Python 3.11. Serialisation via Pydantic/SQLModel is unaffected because both forms expose the same .value strings to the ORM and JSON serialiser.

Confidence Score: 5/5

Safe to merge — all changes are additive improvements with no behavioral regressions on the API or data layer.

The CI change tightens lockfile enforcement without breaking any existing workflow. The StrEnum migration uses stdlib semantics that are identical to the old (str, Enum) mixin for Pydantic/SQLModel serialisation purposes; the only observable difference (str() representation) is not exercised anywhere in the changed or adjacent code. No logic, schema, or auth contract is altered.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Replaces --frozen with --locked in all four uv sync invocations, making CI verify lockfile/pyproject.toml consistency instead of silently using a potentially stale lockfile.
api/db/models.py Migrates MemberRole from (str, enum.Enum) to enum.StrEnum — idiomatic for Python 3.11+ and consistent with how Pydantic/SQLModel serialise enum values.
api/dependencies.py Migrates AccessLevel from (str, Enum) to StrEnum; mirrors the models.py change and keeps the two enums consistent in style.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[uv sync in CI] --> B{flag used}
    B -- "--frozen (before)" --> C[Lockfile exists?\nYes → install from lockfile\nNo → fail]
    B -- "--locked (after)" --> D[Lockfile exists AND\nmatches pyproject.toml?\nYes → install\nNo → fail]

    E[Enum base class] --> F{pattern}
    F -- "str, Enum (before)" --> G["str(member) → 'ClassName.MEMBER'\nmember == 'value' → True\n.value → 'value'"]
    F -- "StrEnum (after)" --> H["str(member) → 'value'\nmember == 'value' → True\n.value → 'value'"]
Loading

Reviews (1): Last reviewed commit: "ci: enforce uv sync --locked to catch lo..." | Re-trigger Greptile

@caitlon caitlon added this to the v1.0-thesis milestone Jun 4, 2026
@caitlon caitlon added type:bug Something is broken area:api FastAPI backend area:infra CI/CD, Docker dependencies Dependency updates labels Jun 4, 2026
@caitlon caitlon self-assigned this Jun 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@caitlon caitlon merged commit 53b2702 into develop Jun 5, 2026
8 checks passed
@caitlon caitlon deleted the fix/uv-lock-sync branch June 5, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api FastAPI backend area:infra CI/CD, Docker dependencies Dependency updates type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant