Skip to content

build!: update dependencies - #265

Merged
uniqueg merged 5 commits into
devfrom
build/update-deps
Oct 17, 2026
Merged

uniqueg merged 5 commits into
devfrom
build/update-deps

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

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:

Package Before After Why
connexion ~=2.11 >=2.15.1,<3 makes explicit what already resolved: 2.15 is the only 2.x line compatible with Werkzeug 3 (2.11–2.14 cap werkzeug<3)
Flask ~=2.2 (resolved 2.3.3) >=3.1.3,<4 CVE-2026-27205; Flask 2.x is unmaintained
Flask-PyMongo ~=2.3 >=3.0,<4 Flask 3 support
cryptography ~=44.0.1 >=50 six advisories in 44.x; also unblocks Dependabot
flask-authz ~=2.5.1 >=2.5.1,<2.8 2.8+ hard-pins a vulnerable Flask
swagger-ui-bundle ~=0.0 >=1.1,<2 Swagger UI 4; required by connexion 2.15's swagger-ui extra
others ~= pins >= floor, < next major celery, Flask-Cors, PyJWT, pydantic, pymongo, PyYAML, requests, Werkzeug, typing_extensions
dev / docs old floors current floors coverage, flake8, mongomock, mypy, pytest, Sphinx >=8, sphinx-rtd-theme >=3

Images and docs build:

  • Docker default base python:3.13-slim-trixie; CI builds trixie-based images; Dockerfile lint fixes (AS, ENV K=V)
  • examples: MongoDB 8.0, Python 3.13 images, obsolete compose version key removed
  • Read the Docs: Ubuntu 24.04, Python 3.13, docs extra only

Breaking 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:

  • Python 3.13 and 3.10: 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.0
  • pip-audit: no known vulnerabilities (7 before)
  • flake8: clean; mypy foca: no issues (3.10 and 3.13)
  • pytest unit 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 >=8
  • python:{3.10,3.11,3.12,3.13}-slim-trixie tags exist on Docker Hub

Not 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:

  • Update runtime and development dependencies to current compatible releases, including Flask 3 support and vulnerability remediation.
  • Refresh Docker, CI, example, and documentation environments to Python 3.13, Debian Trixie, MongoDB 8, and current Read the Docs tooling.

Build:

  • Modernize dependency version constraints and upgrade documentation and development tool requirements.

CI:

  • Run CI matrices against Debian Trixie-based Python images.

Documentation:

  • Update the Read the Docs build environment to Ubuntu 24.04 and Python 3.13 using only documentation dependencies.

Chores:

  • Apply current Dockerfile syntax and remove obsolete Compose version declarations.

uniqueg and others added 4 commits October 17, 2026 18:05
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]>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 16:10
@sourcery-ai

sourcery-ai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The 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

Change Details Files
Modernize Python packaging and consolidate runtime, development, and documentation dependency constraints.
  • Replace setup.py, requirements files, and setup.cfg metadata with pyproject.toml using setuptools.
  • Raise supported dependency floors and cap major versions, including the Flask 3/Connexion 2 compatibility set and security updates.
  • Move tooling configuration for mypy and pytest into pyproject.toml while retaining flake8 configuration.
pyproject.toml
requirements.txt
requirements_dev.txt
requirements_docs.txt
setup.py
setup.cfg
Update CI and documentation builds for the newer Python and Debian environments.
  • Replace Python 3.9/bookworm CI combinations with Python 3.10–3.12/trixie combinations.
  • Use Ubuntu 24.04 and Python 3.13 for Read the Docs, installing only the docs extra.
  • Adjust the package manifest for the new build layout.
.github/workflows/checks.yml
.readthedocs.yaml
MANIFEST.in
Refresh container images and example service definitions for the upgraded platform stack.
  • Default Docker builds to Python 3.13 slim-trixie and update Dockerfile stage and ENV syntax.
  • Install the application directly from pyproject.toml rather than a requirements file.
  • Update examples to Python 3.13/trixie and MongoDB 8.0, and remove obsolete Compose version declarations.
docker/Dockerfile
examples/petstore-access-control/docker-compose.yaml
examples/petstore/docker-compose.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#216 Upgrade Werkzeug to a current version that addresses the cited security vulnerability. ✅
#216 Upgrade Flask to a current version. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bd10f74) to head (19915e1).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #265   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1113      1113           
=========================================
  Hits          1113      1113           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 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

@uniqueg
uniqueg marked this pull request as ready for review October 17, 2026 16:21

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread pyproject.toml Resolved
# Conflicts:
#	.github/workflows/checks.yml
#	pyproject.toml
@uniqueg
uniqueg merged commit 7969cc6 into dev Oct 17, 2026
19 checks passed
@uniqueg
uniqueg deleted the build/update-deps branch October 17, 2026 22:54
uniqueg added a commit that referenced this pull request Oct 17, 2026
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]>
uniqueg added a commit that referenced this pull request Oct 17, 2026
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]>
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.

build: upgrade Werkzeug & Flask

2 participants