Transition to poetry
+ address numpy 2.0
and numba 0.60
related issues
#4
Workflow file for this run
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: ci | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -e {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
python: [3.8, 3.9, 3.10, 3.11, 3.12] | |
os: [ubuntu-latest, macos-latest] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python }} | |
MODULE: decoupler | |
steps: | |
- name: Check out main | |
uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: System dependencies Linux | |
if: ${{ matrix.os }} == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libcurl4-openssl-dev | |
- name: System dependencies OSX | |
if: ${{ matrix.os }} == 'macos-latest' | |
run: | | |
brew install openssl | |
export LDFLAGS="-L/usr/local/opt/openssl@3/lib" | |
export CPPFLAGS="-I/usr/local/opt/openssl@3/include" | |
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig" | |
- name: Load cached Poetry installation | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local | |
key: poetry-0 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Install library | |
run: poetry install --no-interaction | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
poetry run flake8 $MODULE --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
poetry run flake8 $MODULE --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Tests and test coverage | |
if: github.event_name == 'push' | |
run: | | |
poetry run pytest --cov --disable-warnings | |
- name: Tests | |
if: github.event_name == 'pull_request' | |
run: | | |
poetry run pytest --disable-warnings | |
- name: Upload coverage reports to Codecov | |
if: github.event_name == 'push' | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${CODECOV_TOKEN} |