feat!: migrate API response keys to camelCase and mark v3.0.0 release#151
Merged
aditeyabaral merged 23 commits intoMay 24, 2026
Merged
Conversation
Replaces pip + requirements.txt with uv multi-stage build: - builder: ghcr.io/astral-sh/uv:python3.12-bookworm-slim - runtime: python:3.12-slim-bookworm (no uv in final image) - UV_COMPILE_BYTECODE=1 for faster startup - UV_LINK_MODE=copy for cross-stage compatibility - uv.lock as source of truth Image size: 285 MB (pip) → 231 MB (uv multi-stage), 54 MB reduction
… scripts - lint and pre-commit CI: remove multi-version matrix, pin to Python 3.12 (ruff and pre-commit hooks don't require multi-version runs) - scripts/benchmark/util.py: add know_your_class_and_section param to make_request - scripts/benchmark/benchmark_requests.py: add --know-your-class-and-section flag
ZoneInfo (Python 3.9+) is a drop-in replacement for pytz.timezone(). Removes pytz as a runtime dependency.
[dependency-groups] (PEP 735) is the correct home for dev-only tools that are never published as package extras. Updates pre-commit CI to install via uv sync instead of pip install .[dev].
36 tasks
achyu-dev
requested changes
May 23, 2026
- Upgrade Dockerfile base images from python3.12 to python3.14 - Update ruff target-version from py312 to py314 - Fix ruff pre-commit hook id from legacy alias `ruff` to `ruff-check` - Fix stale Python 3.11 references in README to 3.12 (matching requires-python)
Reduces image size from ~150MB to ~117MB. Both builder and runtime use Alpine to ensure musl-compatible wheels are installed for compiled extensions (pydantic-core, selectolax).
Move AsyncIterator and Request to TYPE_CHECKING in app.py (annotation-only uses); add from __future__ import annotations to keep them lazy on Python <3.14. Configure runtime-evaluated-base-classes for pydantic.BaseModel to suppress false positives in Pydantic model files where field types must remain available at runtime.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR delivers a breaking v3.0.0 update that standardizes the FastAPI /authenticate API contract to camelCase keys, modernizes the runtime/tooling (Python 3.12+, uv), and adjusts Docker/CI/docs/tests to match.
Changes:
- Migrated request/response models to camelCase serialization via Pydantic
alias_generator=to_camel, updated app logic to emit camelCase keys, and tightened request validation (extra="forbid"). - Upgraded project metadata/tooling: Python
>=3.12, version bump to3.0.0,uv-based dependency management, and refreshed CI/pre-commit configuration. - Updated Docker build to a multi-stage
uvflow and adjusted benchmarks/docs/tests to reflect the new API surface.
Reviewed changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
app/app.py |
Uses ZoneInfo and switches response dumping to camelCase aliases; app version now pulled from package metadata. |
app/pesu.py |
Updates default field names and response payload keys (e.g., campusCode, knowYourClassAndSection). |
app/models/request.py |
Enforces camelCase request aliases and forbids unknown request fields. |
app/models/response.py |
Enables camelCase aliases for response serialization. |
app/models/profile.py |
Enables camelCase aliases for profile serialization. |
app/models/kycas.py |
Enables camelCase aliases for KYCAS serialization. |
app/docs/authenticate.py |
Updates OpenAPI examples to camelCase keys. |
Dockerfile |
Moves to uv-based builder image and Python 3.14 Alpine runtime. |
pyproject.toml |
Bumps version to 3.0.0, Python to >=3.12, and adopts uv dependency groups. |
requirements.txt |
Regenerated lock output for updated dependency set. |
README.md |
Updates setup instructions and API docs/examples to camelCase and Python 3.12+. |
.github/CONTRIBUTING.md |
Updates contributor setup to Python 3.12+ and uv workflows. |
.github/workflows/pre-commit.yaml |
Uses uv sync --all-groups and updates Python matrix. |
.github/workflows/lint.yaml |
Updates Python matrix to 3.12–3.14. |
.pre-commit-config.yaml |
Updates ruff hook configuration and adds markdown formatting/size checks. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates benchmark script paths referenced by the template. |
scripts/benchmark/util.py |
Adds KYCAS flag support and sends camelCase request key. |
scripts/benchmark/benchmark_requests.py |
Adds CLI flag to include KYCAS in benchmark requests. |
tests/unit/test_request_model.py |
Updates request validation tests for camelCase + forbidding deprecated keys. |
tests/unit/test_pesu.py |
Updates response assertions for camelCase keys and adds CSRF client lifecycle test. |
tests/unit/test_app_unit.py |
Adds unit test for CSRF refresh loop error logging. |
tests/integration/test_app_integration.py |
Updates integration assertions for camelCase and adds deprecated/extra key rejection coverage. |
tests/functional/test_authenticate_functional.py |
Updates functional assertions for camelCase response keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ields Define ProfileField as a Literal type alias in pesu.py and derive DEFAULT_FIELDS from it via get_args(). Replace Literal[*PESUAcademy.DEFAULT_FIELDS] in RequestModel with list[ProfileField], removing the PESUAcademy import from the model entirely.
achyu-dev
approved these changes
May 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several significant improvements to the codebase, focusing on modernizing the Python environment, updating dependencies and tooling, standardizing API field naming to camelCase, and enhancing documentation and workflow automation. The changes ensure better consistency, improved developer experience, and alignment with current best practices.
Key changes:
Python version and dependency management updates:
uvtool for dependency management and virtual environment creation throughout the project. [1] [2] [3] [4] [5]uvand Python 3.14, improving image size and reproducibility.Pre-commit, linting, and workflow enhancements:
ruff-checkandmdformat, removedblacken-docsandpyupgrade, and added new formatting checks such ascheck-added-large-files. Updated pre-commit workflow to useuvfor installing and running hooks. [1] [2] [3].github/CONTRIBUTING.mdto reflect these changes. [1] [2] [3]API field naming and serialization improvements:
knowYourClassAndSection,campusCode,instituteName) in the models, documentation, and usage examples. Updated theKYCASModelto use an alias generator for camelCase, and ensured output serialization uses these aliases. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]General codebase modernization:
pytzwith the standard library'szoneinfofor timezone handling inapp/app.py.Documentation and template improvements:
These updates collectively modernize the project's tooling, improve consistency and clarity in the API, and streamline the developer workflow.