Skip to content

Update build system #248

Update build system

Update build system #248

Workflow file for this run

name: Python Build
"on":
push:
branches: ["main"]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
pull_request:
jobs:
from-sdist:
name: python source distribution
runs-on: ubuntu-latest
steps:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.5"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version-file: "pyproject.toml"
- name: Install pyssht
run: uv sync --all-extras --dev
- name: run pytest
run: uv run pytest tests/test_pyssht.py
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: macos-latest
steps:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.5"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Build wheels
run: uv build --wheel
- name: install wheel
run: "pip install dist/*.whl"
- name: run pytests
run: uv pip install pytest && pytest tests
publication:
name: publish to pypi
if: ${{ startsWith(github.ref, 'refs/tags') }}
runs-on: macos-latest
steps:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.5"
- name: Publish distribution 📦 to Test PyPI
if: ${{ github.ref != 'refs/tags/v1.5.2' }}
run: "uv publish --publish-url https://test.pypi.org/legacy --token ${{ secrets.TEST_PYPI_TOKEN }}"
- name: Publish distribution 📦 to PyPI
if: ${{ github.ref == 'refs/tags/v1.5.2' }}
run: "uv publish --token ${{ secrets.TEST_PYPI_TOKEN }}"