Skip to content

Bump version to 0.5.0 for major restructuring release #47

Bump version to 0.5.0 for major restructuring release

Bump version to 0.5.0 for major restructuring release #47

Workflow file for this run

name: CI
on:
push:
branches: [ master, main ]
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches: [ master, main ]
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
test:
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11', '3.12', '3.13']
exclude:
# Skip some combinations to reduce build time
- os: windows-latest
python-version: '3.11'
- os: windows-latest
python-version: '3.13'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install maturin pytest numpy scipy scikit-learn ripser
- name: Build and install package
shell: bash
run: |
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
pip install -e .
- name: Verify installation
run: |
python -c "
try:
import canns_lib
from canns_lib.ripser import ripser
import canns_lib._ripser_core
print('Package installed successfully')
print('Ripser module found')
print('Core module found')
except ImportError as e:
print('Import failed:', e)
exit(1)
"
- name: Run tests
run: |
pytest tests -v
lint:
name: Lint and format check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check Rust formatting
run: cargo fmt --all -- --check
- name: Run Clippy (default features)
run: |
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
cargo clippy --lib
- name: Run Clippy (with parallel features)
run: |
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
cargo clippy --lib --features parallel
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Python linting tools
run: |
python -m pip install --upgrade pip
pip install black isort flake8
# TODO: Re-enable Python formatting checks after fixing formatting
# - name: Check Python formatting with black
# run: black --check python/ tests/ benchmarks/
#
# - name: Check Python imports with isort
# run: isort --check-only python/ tests/ benchmarks/
#
# - name: Run flake8
# run: flake8 python/ tests/ benchmarks/ --max-line-length=100 --extend-ignore=E203,W503