Skip to content

Check subprocess exit and tidy command line generation #15

Check subprocess exit and tidy command line generation

Check subprocess exit and tidy command line generation #15

Workflow file for this run

name: Build and Test
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13","3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build pytest
- name: Build and install package
run: |
pip install .
- name: Verify binaries are bundled
run: |
python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('hetmers'))"
python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('extract_kmer_pairs'))"
- name: Test CLI
run: |
smudgeplot --version
smudgeplot -h
smudgeplot hetmers --help
smudgeplot extract --help
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-15-intel, macos-14] # macos-15-intel=x86, macos-14=arm64
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
# Config is read from pyproject.toml [tool.cibuildwheel]
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: |
pip install build
python -m build --sdist
- name: Verify sdist doesn't contain binaries
run: |
tar -tzf dist/*.tar.gz | grep -E 'bin/(hetmers|extract_kmer_pairs)$' && exit 1 || echo "Good: no binaries in sdist"
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
test-sdist:
name: Test sdist on ${{ matrix.os }}
needs: build-sdist
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install from sdist
run: |
pip install dist/*.tar.gz
- name: Verify binaries are compiled
run: |
python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('hetmers'))"
python -c "from smudgeplot.cli import get_binary_path; print(get_binary_path('extract_kmer_pairs'))"
- name: Test compiled binaries execute
run: |
smudgeplot hetmers --help
smudgeplot extract --help