Repository navigation
build!: update dependencies - #265
Conversation
Replace setup.py and the requirements*.txt files with PEP 621 metadata in pyproject.toml (setuptools backend). Distribution name, import package and the `dev` and `docs` extras are unchanged. - declare `requires-python = ">=3.10"` (3.9 is end of life) - ship `py.typed` inside the package so the "Typed" classifier holds - package only `foca*`, so `tests` is no longer installed into site-packages; configure pytest `pythonpath` so tests still import - declare `typing_extensions` as a runtime dependency (it is imported by `foca.models.config`) - drop the obsolete `typing` backport and the unused `toml`, `mypy-extensions`, `types-urllib3`, `types-setuptools`, `pylint`, `python-semantic-release` and `readthedocs-sphinx-ext` - drop `setup_requires` and the setuptools-git based MANIFEST.in - remove the stale semantic-release config from setup.cfg; move the mypy config to pyproject.toml (flake8 config stays in setup.cfg until ruff replaces it) - install FOCA directly from the source tree in the Docker image Closes #232 Co-Authored-By: Claude Opus 5.5 <[email protected]>
FOCA now requires Python >= 3.10. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Update runtime, dev and docs dependencies while staying on Connexion 2. Ranges now allow minor/patch updates within the current major version. - connexion >=2.15.1,<3: makes explicit what was already resolved (2.15 is the only 2.x line compatible with Werkzeug 3) - Flask >=3.1.3,<4 (fixes CVE-2026-27205); Flask-PyMongo 3.x - cryptography >=50 (fixes six advisories in 44.x) - flask-authz <2.8 (2.8+ hard-pins a vulnerable Flask) - swagger-ui-bundle >=1.1 (Swagger UI 4; required by connexion 2.15) - raise floors of celery, Flask-Cors, PyJWT, requests and dev/docs tools (Sphinx >=8, sphinx-rtd-theme >=3) pip-audit reports no known vulnerabilities for the updated set. BREAKING CHANGE: FOCA now requires Flask 3. Apps using APIs removed in Flask 3 (e.g. `flask.Markup`, `_app_ctx_stack`, custom JSON encoders) need to be updated. Closes #216 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Docker: default to python:3.13-slim-trixie (Debian 13), use trixie-based images in CI, fix Dockerfile lint (`AS`, `ENV K=V`) - examples: MongoDB 8.0, Python 3.13 images, drop obsolete compose `version` key - Read the Docs: Ubuntu 24.04 and Python 3.13; install only the `docs` extra Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR completes the dependency and build-system modernization by moving packaging to pyproject.toml, requiring the Flask 3-compatible Connexion 2 dependency set with updated security floors, and aligning CI, documentation, Docker, and example environments with Python 3.13 and Debian trixie. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #265 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 1113 1113
=========================================
Hits 1113 1113
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
The breaking Flask upgrade and container changes need completed MongoDB and Docker integration checks plus final human review.
No open issues 🎉
What changed in this PR
Modernizes FOCA’s packaging and dependencies, building on #264 while retaining Connexion 2 and requiring Flask 3.
Changes:
- Consolidates packaging and dependency declarations in
pyproject.toml. - Updates runtime, development, and documentation dependencies.
- Refreshes Docker, example services, CI images, and Read the Docs environments.
| File | Description |
|---|---|
| setup.py | Removes legacy package setup. |
| setup.cfg | Retains only flake8 configuration. |
| requirements.txt | Moves runtime dependencies to project metadata. |
| requirements_docs.txt | Moves documentation dependencies to an extra. |
| requirements_dev.txt | Moves development dependencies to an extra. |
| pyproject.toml | Defines packaging, updated dependencies, and tool settings. |
| MANIFEST.in | Explicitly includes source-distribution resources. |
| foca/py.typed | Places the typing marker inside the package. |
| examples/petstore/docker-compose.yaml | Updates Python and MongoDB images. |
| examples/petstore-access-control/docker-compose.yaml | Updates Python and MongoDB images. |
| docker/Dockerfile | Updates the base image and installs from source metadata. |
| .readthedocs.yaml | Updates build environments and installs only the docs extra. |
| .github/workflows/checks.yml | Drops Python 3.9 and switches images to trixie. |
Review effort: Balanced
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="pyproject.toml" line_range="30-32" />
<code_context>
+ "Intended Audience :: System Administrators",
+ "Natural Language :: English",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Topic :: Internet :: WWW/HTTP",
+ "Topic :: System :: Systems Administration",
</code_context>
<issue_to_address>
**Python 3.13 packages go undiscovered**
When consumers or package indexes filter by Python-version classifiers, `pyproject.toml` stops listing Python classifiers at 3.12 even though the Docker default and Read the Docs build use Python 3.13, so consumers filtering for Python 3.13 do not see FOCA as compatible and can miss it in package searches.
Add the Python 3.13 classifier to `pyproject.toml`.
</issue_to_address>Sourcery assessment
Needs a human reviewer. The example Compose files switch a MongoDB service from 7.0 to 8.0 while keeping its persistent data directory, so starting the new image may change database state that a simple revert to 7.0 cannot necessarily reopen directly. The impact is limited to users of these examples and can be addressed with a backup or supported recovery path; the Python and base-image updates could also cause ordinary runtime issues.
# Conflicts: # .github/workflows/checks.yml # pyproject.toml
Resolve the conflict in the CI workflow in favour of this branch, which rewrites it and already includes the changes from #265. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve conflicts with the squash-merged #264, #265 and #266: - CI workflow: keep linting and format checks with ruff from this branch, take the commit-timestamp Docker tags from dev. - Release workflow: take the release commit check and skip-existing uploads from dev. - pyproject.toml: keep ruff and pre-commit instead of flake8 in the dev extra. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Second PR of the v0.14.0 maintenance series. Builds on #264 (only the last two commits are new here; review/merge #264 first).
Updates dependencies while staying on Connexion 2:
~=2.11>=2.15.1,<3werkzeug<3)~=2.2(resolved 2.3.3)>=3.1.3,<4~=2.3>=3.0,<4~=44.0.1>=50~=2.5.1>=2.5.1,<2.8~=0.0>=1.1,<2swagger-uiextra~=pins>=floor,<next majorImages and docs build:
python:3.13-slim-trixie; CI builds trixie-based images; Dockerfile lint fixes (AS,ENV K=V)versionkey removeddocsextra onlyBreaking change: Flask 3 is required. FOCA itself uses none of the APIs removed in Flask 3 (checked), and neither proTES nor cloud-registry pins Flask. Apps using
flask.Markup,_app_ctx_stack, custom JSON encoders etc. need to update. pymongo 4.8 (pinned exactly by proTES) still satisfies all constraints.Closes #216
Verification
Locally with uv:
pip install -e .[dev,docs]resolves to connexion 2.15.1, Flask 3.1.3, Werkzeug 3.1.9, cryptography 50.0.2, flask-authz 2.7.0, Flask-PyMongo 3.0.1, swagger-ui-bundle 1.1.0pip-audit: no known vulnerabilities (7 before)flake8: clean;mypy foca: no issues (3.10 and 3.13)pytestunit tests without MongoDB: 246 passed on 3.10 and 3.13 (remaining warnings come from connexion 2's use of deprecated jsonschema APIs)sphinx-build docs/api: succeeds with Sphinx >=8python:{3.10,3.11,3.12,3.13}-slim-trixietags exist on Docker HubNot run locally (no MongoDB/Docker access in my environment): MongoDB-dependent tests, Docker image build and petstore integration test; covered by CI.
CI: all checks pass (run): lint, mypy and unit tests incl. MongoDB-dependent tests on Python 3.10–3.12 × MongoDB 4.4–7.0 (trixie images), petstore integration tests, Docker builds, Codecov, Read the Docs.
Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Upgrade project dependencies and build environments to supported, secure versions while adopting Flask 3.
Enhancements:
Build:
CI:
Documentation:
Chores: