Skip to content

Commit

Permalink
Merge pull request #199 from neutrinoceros/tst/dep_locking
Browse files Browse the repository at this point in the history
TST: rewrite testing workflows around `uv.lock`
  • Loading branch information
neutrinoceros authored Dec 9, 2024
2 parents f17fff2 + 891cc28 commit ad5acb2
Show file tree
Hide file tree
Showing 3 changed files with 702 additions and 35 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/bleeding-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,13 @@ jobs:

- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
python-version: '3.13'

- name: Install dependencies
- name: Configure uv
run: |
uv venv -p 3.13
uv pip install --pre --no-build numpy matplotlib \
--extra-index-url \
https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
--index-strategy=unsafe-best-match
- name: Build library
run: uv pip install .
echo "UV_PRERELEASE=allow" >> $GITHUB_ENV
echo "UV_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" >> $GITHUB_ENV
echo "UV_INDEX_STRATEGY=unsafe-best-match" >> $GITHUB_ENV
- name: Run test suite
# forcing bytecode compilation for colorspacious
Expand Down
34 changes: 11 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,18 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
- name: Build library
run: |
uv venv -p ${{ matrix.python-version }}
uv pip install . ${{ matrix.install-args }}
- run: uv pip list
python-version: ${{ matrix.python-version }}

- name: Run test suite
shell: bash # for windows compat
# forcing bytecode compilation for colorspacious
# see https://github.com/astral-sh/uv/issues/4758
#
# Cannot use --frozen here because it overrides options like --resolution
run: |
uv run --no-editable --compile-bytecode --group test ${{ matrix.install-args }} \
uv run --no-editable --compile-bytecode \
--group test ${{ matrix.install-args }} \
pytest --color yes -ra
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: failure()
with:
Expand All @@ -76,15 +69,13 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
python-version: '3.13'

- name: Run Image Tests
# forcing bytecode compilation for colorspacious
# see https://github.com/astral-sh/uv/issues/4758
run: |
uv run -p 3.13 --no-editable --compile-bytecode --group test \
uv run --frozen --no-editable --compile-bytecode --group test \
pytest --color=yes --mpl -m mpl_image_compare \
--mpl-generate-summary=html \
--mpl-results-path=pytest_mpl_results \
Expand All @@ -93,7 +84,7 @@ jobs:
- name: Generate new image baseline
if: failure()
run: |
uv run --no-editable --group test \
uv run --frozen --no-editable --group test \
pytest --color=yes --mpl -m mpl_image_compare \
--mpl-generate-path=pytest_mpl_new_baseline \
--last-failed
Expand Down Expand Up @@ -134,10 +125,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
python-version: ${{ matrix.python-version }}

- name: Run mypy
run: |
uv run -p ${{ matrix.python-version }} --no-editable --group typecheck \
mypy cmyt
run: uv run --frozen --no-editable --group typecheck mypy cmyt
Loading

0 comments on commit ad5acb2

Please sign in to comment.