Skip to content

Commit 9849b8f

Browse files
authored
Use requirements.txt _and_ pyproject.toml when testing lowest dependency versions (#530)
* test-lowest-version will use requirements.txt file if it exists. * The initial change did not actually do what we thought, this seems to be correct.
1 parent 21fb9ea commit 9849b8f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

python-project-template/.github/workflows/testing-and-coverage.yml.jinja

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ jobs:
5353
uv venv venv
5454
source venv/bin/activate
5555
{%- if test_lowest_version == 'direct' %}
56-
uv pip compile --resolution=lowest-direct -o requirements_lowest.txt pyproject.toml
56+
if [ -f requirements.txt ]; then
57+
uv pip compile --resolution=lowest-direct pyproject.toml requirements.txt -o requirements_lowest.txt
58+
else
59+
uv pip compile --resolution=lowest-direct pyproject.toml -o requirements_lowest.txt
5760
{%- elif test_lowest_version == 'all' %}
58-
uv pip compile --resolution=lowest -o requirements_lowest.txt pyproject.toml
61+
if [ -f requirements.txt ]; then
62+
uv pip compile --resolution=lowest pyproject.toml requirements.txt -o requirements_lowest.txt
63+
else
64+
uv pip compile --resolution=lowest pyproject.toml -o requirements_lowest.txt
65+
fi
5966
{%- endif %}
6067
uv pip install --constraint=requirements_lowest.txt -e .[dev]
6168
- name: Run unit tests with pytest

0 commit comments

Comments
 (0)