Repository navigation
Add Python Support; New RateBackends, Performance improvements, AIQI - V1.1.0 #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python CI | |
| on: | |
| push: | |
| branches: ["github"] | |
| pull_request: | |
| branches: ["github"] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Python tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install Linux build deps | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends clang lld cmake pkg-config libseccomp-dev | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Build extension (Linux) | |
| if: runner.os == 'Linux' | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| run: uv run maturin develop --release | |
| - name: Build extension (macOS/Windows) | |
| if: runner.os != 'Linux' | |
| run: uv run maturin develop --release | |
| - name: Run tests | |
| run: uv run pytest --cov=infotheory_rs --cov-report=term-missing --cov-report=xml:target/python-coverage.xml --cov-fail-under=100 python/tests | |
| - name: Upload Python coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-coverage-${{ matrix.os }} | |
| path: target/python-coverage.xml | |
| if-no-files-found: error | |
| - name: Build sdist | |
| run: uv run maturin sdist | |
| - name: Build wheel | |
| run: uv run maturin build --release | |
| - name: Install built wheel and import | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| wheel="$(ls target/wheels/*.whl | head -n1)" | |
| uv run pip install "$wheel" | |
| uv run python -c "import infotheory_rs; print('ok')" | |
| test-vm-linux: | |
| name: Python VM smoke (Linux) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install Linux build deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends clang lld cmake pkg-config libseccomp-dev | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Build extension with VM feature | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| run: uv run maturin develop --release --features python-extension,backend-rosa,backend-rwkv,backend-zpaq,vm | |
| - name: Run VM-featured Python smoke tests | |
| run: uv run pytest -q python/tests/test_vm.py |