polars support #23
This file contains 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: Test and Deploy | |
on: [pull_request, push] | |
jobs: | |
windows-build-test: | |
strategy: | |
matrix: | |
pyversion: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
runs-on: "windows-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install latests stable Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
architecture: x64 | |
- name: Install deps | |
run: pip install numpy pandas seaborn scikit-learn toml ucimlrepo | |
- run: | | |
cp README.md python-package/README.md | |
cp LICENSE python-package/LICENSE | |
- name: Build test data | |
run: | | |
cd python-package | |
python -m pip install -e .[dev] | |
cd .. | |
python scripts/make_resources.py | |
- name: Build wheels with maturin | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: x86_64 | |
command: build | |
args: --release --strip --interpreter python --manifest-path python-package/Cargo.toml --out dist | |
- name: Install wheel | |
run: pip install perpetual --no-index --find-links dist --no-deps --force-reinstall | |
- name: Run Package Tests | |
run: | | |
pip install pytest pytest-cov black ruff setuptools --upgrade | |
cd python-package | |
ruff check . | |
black --check . | |
pytest --cov-fail-under=90 tests | |
cd .. | |
- name: Save Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-dists | |
path: dist | |
macos-build-test: | |
strategy: | |
matrix: | |
pyversion: ["3.11", "3.12"] | |
platform: [x64, arm64] | |
runs-on: "macos-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install latest stable Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
- name: Install deps | |
run: pip install numpy pandas seaborn scikit-learn toml ucimlrepo | |
- run: | | |
cp README.md python-package/README.md | |
cp LICENSE python-package/LICENSE | |
- name: Build test data | |
run: | | |
cd python-package | |
python -m pip install -e .[dev] | |
cd .. | |
python scripts/make_resources.py | |
- name: Build wheels with maturin | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: build | |
args: --release --strip --interpreter python --manifest-path python-package/Cargo.toml --out dist | |
- name: Install wheel | |
run: pip install perpetual --no-index --find-links dist --no-deps --force-reinstall | |
- name: Run Package Tests | |
run: | | |
pip install pytest pytest-cov black ruff setuptools --upgrade | |
cd python-package | |
ruff check . | |
black --check . | |
pytest --cov-fail-under=90 tests | |
cd .. | |
- name: Save Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-dists | |
path: dist | |
linux-build-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pyversion: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install latests stable Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
architecture: x64 | |
- name: Install deps | |
run: pip install numpy pandas seaborn scikit-learn toml ucimlrepo | |
- run: | | |
cp README.md python-package/README.md | |
cp LICENSE python-package/LICENSE | |
- name: Build test data | |
run: | | |
cd python-package | |
python -m pip install -e .[dev] | |
cd .. | |
python scripts/make_resources.py | |
- name: Build wheels with maturin | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: x86_64 | |
manylinux: auto | |
command: build | |
args: --release --strip --interpreter python${{ matrix.pyversion }} --manifest-path python-package/Cargo.toml --out dist | |
- name: Install wheel | |
run: pip install perpetual --no-index --find-links dist --no-deps --force-reinstall | |
- name: Run Package Tests | |
run: | | |
pip install pytest pytest-cov black ruff setuptools --upgrade | |
cd python-package | |
ruff check . | |
black --check . | |
pytest --cov-fail-under=90 tests | |
cd .. | |
- name: Save Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-dists | |
path: dist | |
cargo-build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install latest stable Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
architecture: x64 | |
- name: Install deps | |
run: pip install numpy pandas seaborn scikit-learn toml ucimlrepo | |
- run: | | |
cp README.md python-package/README.md | |
cp LICENSE python-package/LICENSE | |
- name: Build test data | |
run: | | |
cd python-package | |
python -m pip install -e .[dev] | |
cd .. | |
python scripts/make_resources.py | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Publish Crate | |
run: cargo publish --token ${CRATES_TOKEN} --allow-dirty | |
env: | |
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} | |
pypi-publish: | |
runs-on: ubuntu-latest | |
needs: ["windows-build-test", "macos-build-test", "linux-build-test"] | |
environment: | |
name: Test and Deploy | |
url: https://pypi.org/p/perpetual | |
permissions: | |
id-token: write | |
steps: | |
- name: Retrieve release distributions | |
uses: actions/download-artifact@v3 | |
with: | |
name: release-dists | |
path: dist/ | |
- name: Publish release distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |