Skip to content
Closed
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
29 changes: 16 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@ jobs:
package_and_release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v5
- uses: actions/checkout@v4

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
python-version: "3.12"
cache: pip
- name: Install build dependencies
run: python -m pip install --upgrade pip wheel twine build
pixi-version: v0.34.0
cache: true

- name: Build package
run: python -m build
run: |
pixi run -e dev-py313 python -m build

- name: Check package
run: twine check --strict dist/*.whl
- name: Install hatch
run: pip install hatch
- name: Build project for distribution
run: hatch build
run: |
pixi run -e dev-py313 twine check --strict dist/*.whl

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
41 changes: 13 additions & 28 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,46 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0} # -e to fail on error
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
python: ["3.10", "3.12"]
os: [ubuntu-latest]
python: ["3.11", "3.13"]
os: [ubuntu-latest, macos-latest]

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Restore pip cache
uses: actions/cache@v3
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: pip-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-${{ runner.os }}-${{ env.pythonLocation }}-
- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
pip install pytest-cov
- name: Install dependencies
run: |
pip install numpy
pip install --pre -e ".[dev,test,pre]"
- name: Test
pixi-version: v0.34.0
cache: true

- name: Install dependencies and run tests
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
pytest -v --cov --color=yes --cov-report=xml
pixi run -e dev-py${{ matrix.python }} test
- name: Archive figures generated during testing
if: always()
uses: actions/upload-artifact@v4
with:
name: visual_test_results_${{ matrix.os }}-python${{ matrix.python }}
path: /home/runner/work/spatialdata-plot/spatialdata-plot/tests/figures/*
path: tests/figures/*

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: coverage
verbose: true
file: ./coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------
from __future__ import annotations

import sys
from datetime import datetime
from importlib.metadata import metadata
Expand Down
Loading
Loading