Skip to content

Commit

Permalink
feat: Run tests with direct dependencies resolved to their lowest ver…
Browse files Browse the repository at this point in the history
…sion

Issue-22: #22
  • Loading branch information
pawamoy committed Mar 28, 2024
1 parent e7806d9 commit 339e2c6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
16 changes: 15 additions & 1 deletion project/.github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ jobs:
{"python-version": "3.13"}
]' | tr -d '[:space:]' >> $GITHUB_OUTPUT
else
echo 'jobs=[]' >> $GITHUB_OUTPUT
echo 'jobs=[
{"os": "macos-latest", "resolution": "lowest-direct"},
{"os": "windows-latest", "resolution": "lowest-direct"}
]' | tr -d '[:space:]' >> $GITHUB_OUTPUT
fi

{% endif -%}
Expand All @@ -96,8 +99,17 @@ jobs:
- "3.11"
- "3.12"
- "3.13"
resolution:
- highest
- lowest-direct
{%- if insiders %}
exclude: {% raw %}${{ fromJSON(needs.exclude-test-jobs.outputs.jobs) }}{% endraw %}
{%- else %}
exclude:
- os: macos-latest
resolution: lowest-direct
- os: windows-latest
resolution: lowest-direct
{%- endif %}
runs-on: {% raw %}${{ matrix.os }}{% endraw %}
continue-on-error: {% raw %}${{ matrix.python-version == '3.13' }}{% endraw %}
Expand All @@ -116,6 +128,8 @@ jobs:
run: pip install uv

- name: Install dependencies
env:
UV_RESOLUTION: {% raw %}${{ matrix.resolution }}{% endraw %}
run: make setup

- name: Run the test suite
Expand Down
10 changes: 7 additions & 3 deletions project/scripts/make
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ prefix=""
# Install runtime and development dependencies,
# as well as current project in editable mode.
uv_install() {
uv pip compile pyproject.toml devdeps.txt | uv pip install -r -
local uv_opts
if [ -n "${UV_RESOLUTION}" ]; then
uv_opts="--resolution=${UV_RESOLUTION}"
fi
uv pip compile ${uv_opts} pyproject.toml devdeps.txt | uv pip install -r -
if [ -z "${CI}" ]; then
uv pip install -e .
uv pip install --no-deps -e .
else
uv pip install .
uv pip install --no-deps .
fi
}

Expand Down

0 comments on commit 339e2c6

Please sign in to comment.