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
56 changes: 35 additions & 21 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}

Expand All @@ -61,24 +67,24 @@ 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'
run: |
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
Expand All @@ -104,10 +110,11 @@ 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
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -117,10 +124,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
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/trame_vtk/modules/vtk/serializers/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
coverage
pytest-asyncio
pytest-cov
pytest-playwright
pyvista[all]==0.47.3
trame
Expand Down
Loading