Skip to content

Commit

Permalink
Poetry setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiewior committed Dec 16, 2024
1 parent 3531dda commit 3664e69
Show file tree
Hide file tree
Showing 8 changed files with 589 additions and 342 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ permissions:

# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"
RUSTFLAGS: "-Dwarnings -Ctarget-cpu=native"
POETRY_VERSION: 1.8.4

jobs:
linux_tests:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:

python-version: ${{ matrix.python-version }}


- uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Set up Rust
run: rustup show
- uses: mozilla-actions/sccache-action@v0.0.3
Expand All @@ -56,6 +57,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -80,9 +84,10 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.10'

architecture: ${{ matrix.target }}

- uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -108,12 +113,13 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:

target: ${{ matrix.target }}

args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
Expand All @@ -128,6 +134,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repos:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --show-fixes, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ SHELL=/bin/bash

venv: ## Set up virtual environment
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
poetry lock --no-update
poetry install

install: venv
unset CONDA_PREFIX && \
Expand All @@ -17,7 +18,6 @@ pre-commit: venv
cargo fmt --all && cargo clippy --all-features
.venv/bin/python -m ruff check polars_bio tests --fix --exit-non-zero-on-fix
.venv/bin/python -m ruff format polars_bio tests
.venv/bin/python -m mypy polars_bio tests

test: venv
.venv/bin/python -m pytest tests
Expand Down
Loading

0 comments on commit 3664e69

Please sign in to comment.