From d6c2b61263a7b56a0aeec4ad59d4896952e2d96d Mon Sep 17 00:00:00 2001 From: Ulysse DURAND Date: Wed, 3 Jun 2026 11:25:59 +0200 Subject: [PATCH 1/3] ci: fix failing deployment by updating the github workflow from cookiecutter's --- .github/workflows/test_and_release.yml | 55 ++++++++++++++++---------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test_and_release.yml b/.github/workflows/test_and_release.yml index 458113b..16a1e2d 100644 --- a/.github/workflows/test_and_release.yml +++ b/.github/workflows/test_and_release.yml @@ -9,18 +9,24 @@ on: jobs: pre-commit: runs-on: ubuntu-latest + env: + UV_PYTHON: "3.12" steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 + - uses: actions/checkout@v6 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: - python-version: "3.12" + version: "0.8.12" + enable-cache: true + + - name: Install the project + run: uv sync --all-extras --dev # Install and run pre-commit - run: | - pip install pre-commit - pre-commit install - pre-commit run --all-files + uv run pre-commit install + uv run pre-commit install --hook-type commit-msg + uv run pre-commit run --all-files pytest: name: Pytest ${{ matrix.config.name }} @@ -46,10 +52,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -61,11 +67,11 @@ jobs: # bash .fetch_externals.sh # ----------------------------------------------------------------------- - - name: Install dependencies - run: | - pip install .[dev] - pip install -r tests/requirements.txt - playwright install + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + version: "0.8.12" + enable-cache: true - name: Install OSMesa for Linux if: matrix.config.os == 'ubuntu-latest' @@ -73,12 +79,12 @@ jobs: sudo apt-get update sudo apt-get install -y libosmesa6-dev - - name: Run Tests + - name: Install and Run Tests run: | - # Run the tests with coverage so we get a coverage report too - coverage run --source . -m pytest ./tests - # Print the coverage report - coverage report -m + uv sync --dev + uv pip install -r tests/requirements.txt + uv run playwright install + uv run pytest -s ./tests --cov=src --cov-report=xml - name: Upload Coverage to Codecov uses: codecov/codecov-action@v3 @@ -107,7 +113,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 @@ -117,10 +123,17 @@ jobs: - name: Python Semantic Release id: release - uses: relekang/python-semantic-release@v9.15.2 + uses: python-semantic-release/python-semantic-release@v10.5.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Generate artifact attestation for sdist and wheel + if: steps.release.outputs.released == 'true' + uses: actions/attest-build-provenance@v4.1.0 + with: + subject-path: "dist/*" + + # https://docs.pypi.org/trusted-publishers/using-a-publisher/ - name: Publish package distributions to PyPI if: steps.release.outputs.released == 'true' uses: pypa/gh-action-pypi-publish@release/v1 From 440d1e4fc7eadf3338f8555ab1dcd247f0d0cde5 Mon Sep 17 00:00:00 2001 From: Ulysse DURAND Date: Wed, 3 Jun 2026 12:31:05 +0200 Subject: [PATCH 2/3] fix: put default value to parameter, volume rendering test fixed --- src/trame_vtk/modules/vtk/serializers/data.py | 2 +- tests/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trame_vtk/modules/vtk/serializers/data.py b/src/trame_vtk/modules/vtk/serializers/data.py index d951f38..1808d7b 100644 --- a/src/trame_vtk/modules/vtk/serializers/data.py +++ b/src/trame_vtk/modules/vtk/serializers/data.py @@ -135,7 +135,7 @@ def imagedata_serializer( dataset_id, context, _depth, - requested_fields, # noqa: ARG001 + requested_fields=None, # noqa: ARG001 ): if hasattr(dataset, "GetDirectionMatrix"): direction = [dataset.GetDirectionMatrix().GetElement(0, i) for i in range(9)] diff --git a/tests/requirements.txt b/tests/requirements.txt index b8ae6a2..3cb02a7 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,6 @@ coverage pytest-asyncio +pytest-cov pytest-playwright pyvista[all]==0.47.3 trame From b78ba9ce070b3a2b9f74e7b5101370bcf2706910 Mon Sep 17 00:00:00 2001 From: Ulysse DURAND Date: Wed, 3 Jun 2026 15:34:26 +0200 Subject: [PATCH 3/3] ci: fix missing uv for build semantic release --- .github/workflows/test_and_release.yml | 1 + pyproject.toml | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_and_release.yml b/.github/workflows/test_and_release.yml index 16a1e2d..397dd1d 100644 --- a/.github/workflows/test_and_release.yml +++ b/.github/workflows/test_and_release.yml @@ -110,6 +110,7 @@ jobs: permissions: id-token: write # IMPORTANT: mandatory for trusted publishing contents: write # IMPORTANT: mandatory for making GitHub Releases + attestations: write # IMPORTANT: mandatory for attest build provenance steps: - name: Checkout diff --git a/pyproject.toml b/pyproject.toml index 746f569..e111a1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,10 +97,8 @@ version_variables = [ ] build_command = """ - python -m pip install -e '.[build]' - uv lock --upgrade-package "$PACKAGE_NAME" - git add uv.lock - uv build + pip install build + python -m build """ [tool.ruff.lint.pycodestyle]