Repository navigation
build: declare dependencies in pyproject.toml - #142
Merged
Merged
Conversation
Move the runtime dependencies into `project.dependencies` and the development and documentation dependencies into the `dev` and `docs` extras, as FOCA does, and delete the three `requirements*.txt` files. The exact pins of the dev and docs dependencies become version ranges. The image installs the dependencies from `pyproject.toml` before the code, so that code changes still do not reinstall them, and CI installs the build requirements to compute the version of dev images. Dependabot reads `pyproject.toml` and ignores minor and major updates of `foca`, as for the base image, so that both are bumped together; a test checks that the base image satisfies the `foca` requirement. Closes #135 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Install setuptools-scm for the version of dev images as FOCA does, set Dependabot's versioning strategy of FOCA, note that the bounds of the docs dependencies allow minor releases, and make the base image test report mismatches clearly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR consolidates dependency management in pyproject.toml, replaces requirements-file installations with project extras throughout CI, Docker, documentation hosting, and developer instructions, and adds a consistency check between the Docker base image and the declared FOCA requirement. Sequence diagram for Docker dependency-layer cachingsequenceDiagram
participant Docker as Docker build
participant Project as pyproject.toml
participant Python as Base image Python
participant Pip as pip
participant App as Application source
Docker->>Project: COPY pyproject.toml
Docker->>Python: tomllib.load(project)
Python-->>Docker: project.dependencies
Docker->>Pip: pip install -r /tmp/src/requirements.txt
Docker->>App: Install application with --no-deps
Flow diagram for dependency consistency validationflowchart LR
B[FOCA base image version]
P[pyproject.toml foca requirement]
T[test_base_image_foca]
V{Version satisfies requirement?}
Pass[Check passes]
Fail[Check fails]
B --> T
P --> T
T --> V
V -->|yes| Pass
V -->|no| Fail
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 #142 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 737 737
=========================================
Hits 737 737 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
October 21, 2026 17:41
3 tasks
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.
Summary
Closes #135.
pyproject.toml: the runtime dependencies are in[project] dependencies, the development and documentation dependencies in thedevanddocsextras ([project.optional-dependencies]), as in FOCA. The exact pins ofrequirements_dev.txtandrequirements_docs.txtbecome ranges: lower bounds at the versions pinned so far; upper bounds (next major) for the runtime and docs dependencies, as FOCA has them; the environment marker oftomlistays.dynamicis now only["version"].requirements.txt,requirements_dev.txt,requirements_docs.txt: deleted; nothing refers to them any more.Dockerfile(and.dockerignore): the dependency layer copies onlypyproject.tomland installsproject.dependencies(read withtomllib), so that code changes still do not reinstall the dependencies; the app is installed with--no-depsas before.checks.yaml):pip install -e ".[dev]"(lint, tests, Helm) andpip install -e ".[docs]"(docs); the pip cache is keyed onpyproject.toml. The publish job installedsetuptools-scmwithrequirements_dev.txtas a constraint; it now runspip install "setuptools-scm>=8"(the bound ofbuild-system.requires), as FOCA's workflow does.release.yamlused none of the files.docsextra.pipentry now readspyproject.toml, uses FOCA'sversioning-strategy: increase-if-necessary, and ignores minor and major updates offoca, like thedockerentry forelixircloud/foca, so that the base image and thefocarequirement are bumped together by hand; comments updated.pyproject.toml(setuptools-scmnote),.pre-commit-config.yaml(local hooks),.github/dependabot.yml.docs/development.mdthat named the requirements files (nowpip install -e ".[dev]"andpip install -e ".[docs]") and the wording "dev dependencies" next to them; no other prose.test_base_image_focachecks that the FOCA version of the base image satisfies thefocarequirement (written first; it failed ondev, wherepyproject.tomlhas nodependencies).Trade-off: with lower-bound-only ranges, Dependabot no longer opens pull requests for the dev dependencies (any new version already satisfies them), and CI installs their latest versions, as in FOCA, so a new release of e.g. mypy or setuptools-scm can change CI results without a commit. The docs dependencies are bounded by major version only, so a minor release that adds a warning can fail the strict build. Locked, hash-checked installs stay out of scope (#125).
How it was verified
Locally (Python 3.12 venv with pip 24.0, as in CI; MkDocs on 3.12; Docker is not available here, so the image build and the smoke test ran only in CI):
pip install -e ".[dev,docs]": installs every package of the three old files, at the versions pinned so far (pip freeze);python -m build: wheel metadata lists the runtime dependencies and both extrasuv pip install -e ".[dev]"): installstomli;pytest tests/test_config.py tests/test_version.py: passedcoverage run --source=cloud_registry -m pytest -W ignore::DeprecationWarning(with Helm): 727 passed, coverage 100%test_base_image_foca: failed before the change (KeyError: 'dependencies') and with a mismatchingfocarange, passes nowcheck,format --check),mypy,ast-grep scan,ast-grep test --skip-snapshot-tests,actionlint: passmkdocs build --strict: passestomllibone-liner of theDockerfilerun withsh -c: prints the four runtime dependenciesCI (run 39645264472): all checks pass, including the Docker Compose smoke test (image build), the docs build, Read the Docs, codecov/patch and codecov/project.
Declined review findings
project.dependenciesin a separate build stage, so that edits of other sections ofpyproject.tomlkeep the dependency layer cached: moreDockerfilemachinery for a cache that CI builds don't have; the base image is pinned and has Python 3.12 (tomllib), noted in the comment.pyproject.tomland theDockerfile: each note points to.github/dependabot.yml, where the rule is.test_base_image_foca: checked by hand with a mismatching range (see above).Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Centralize dependency declarations in
pyproject.tomland migrate packaging, container builds, automation, and documentation to use the new dependency extras.New Features:
pyproject.tomlwith appropriate version ranges and extras.Bug Fixes:
Enhancements:
CI:
pyproject.tomlextras.setuptools-scmrange.Deployment:
pyproject.toml.Documentation:
devanddocspackage extras.Tests:
Chores: