| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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].
- 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.
There was a problem hiding this comment.
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:
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.
Sorry, something went wrong.
…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.
| Back | FazBrowse Home | New Git URL |
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:
Pre-commit, linting, and workflow enhancements:
API field naming and serialization improvements:
General codebase modernization:
Documentation and template improvements:
These updates collectively modernize the project's tooling, improve consistency and clarity in the API, and streamline the developer workflow.