Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ is automatically generated with `uv pip compile`, based on the dependencies spec
consistently across different environments.

`requirements-test.txt` does the same for the test dependencies, declared in the `test`
[dependency group] of `pyproject.toml`. It is compiled against the pins in `requirements.txt`,
so the test image can install just the test dependencies on top of the production image
and test the package exactly as it is deployed.
[dependency group] of `pyproject.toml`. It contains only the test dependencies, kept compatible
with the pins in `requirements.txt`, so the test image can install just them on top of the
production image and test the package exactly as it is deployed.
It doesn't repeat the production pins: those are compiled for the Docker image's Python version,
and the CI job on the next Python version installs the package with its own resolution.

Use `pyproject.toml` to define high-level dependencies with flexible version constraints
(e.g., `~=1.2`, `>=1.0`, `<2.0`, ...).
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ docker-shell: docker-volume
reqs:
docker compose run --rm ${DOCKER_AS_USER} ${DOCKER_DEV_NO_GCP_SERVICE} -c \
'${PIP_COMPILE} -o ${REQS_PROD} ${SETUP_FILE} -v && \
${PIP_COMPILE} --group test -c ${REQS_PROD} -o ${REQS_TEST} ${SETUP_FILE} -v'
${PIP_COMPILE} --group ${SETUP_FILE}:test -c ${REQS_PROD} -o ${REQS_TEST} -v'

.PHONY: reqs-upgrade ## Upgrades requirements.txt and requirements-test.txt with uv.
reqs-upgrade:
docker compose run --rm ${DOCKER_AS_USER} ${DOCKER_DEV_NO_GCP_SERVICE} -c \
'${PIP_COMPILE} -o ${REQS_PROD} ${SETUP_FILE} -U -v && \
${PIP_COMPILE} --group test -c ${REQS_PROD} -o ${REQS_TEST} ${SETUP_FILE} -U -v'
${PIP_COMPILE} --group ${SETUP_FILE}:test -c ${REQS_PROD} -o ${REQS_TEST} -U -v'

# ---------------------
# VIRTUAL ENVIRONMENT
Expand Down
39 changes: 1 addition & 38 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --group test -c requirements.txt -o requirements-test.txt pyproject.toml
# uv pip compile --group pyproject.toml:test -c requirements.txt -o requirements-test.txt
coverage==7.16.2
# via pytest-cov
gfw-common==0.20.3
# via
# -c requirements.txt
# python-app-template (pyproject.toml)
iniconfig==2.3.1
# via pytest
jinja2==3.1.6
# via
# -c requirements.txt
# gfw-common
markdown-it-py==4.2.0
# via
# -c requirements.txt
# rich
markupsafe==3.0.4
# via
# -c requirements.txt
# jinja2
mdurl==0.1.2
# via
# -c requirements.txt
# markdown-it-py
packaging==26.3
# via pytest
pluggy==1.7.0
Expand All @@ -34,7 +14,6 @@ pygments==2.21.0
# via
# -c requirements.txt
# pytest
# rich
pytest==9.1.1
# via
# python-app-template (pyproject.toml:test)
Expand All @@ -44,19 +23,3 @@ pytest-cov==7.1.0
# via python-app-template (pyproject.toml:test)
pytest-mock==3.16.0
# via python-app-template (pyproject.toml:test)
python-dateutil==2.9.0.post0
# via
# -c requirements.txt
# gfw-common
pyyaml==6.0.3
# via
# -c requirements.txt
# gfw-common
rich==14.3.4
# via
# -c requirements.txt
# gfw-common
six==1.17.0
# via
# -c requirements.txt
# python-dateutil
Loading