Skip to content

BUILD: Move to Poetry #433

BUILD: Move to Poetry

BUILD: Move to Poetry #433

Workflow file for this run

jobs:
test:
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
os: [ubuntu-latest]
python: ['3.9', '3.10', '3.11']
numba_boundscheck: [0]
include:
- os: macos-latest
python: '3.9'
- os: windows-latest
python: '3.9'
- os: ubuntu-latest
python: '3.9'
numba_boundscheck: 1
fail-fast: false
runs-on: ${{ matrix.os }}
env:
PYTHON_VERSION: ${{ matrix.python }}
NUMBA_BOUNDSCHECK: ${{ matrix.numba_boundscheck }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
# - name: Cache conda
# uses: actions/cache@v4
# env:
# # Increase this value to reset cache if ci/environment.yml has not changed
# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key:
# test-${{ matrix.os }}-conda-py${{ matrix.python }}-${{ env.CACHE_NUMBER }}-${{
# hashFiles('ci/environment.yml') }}
# - uses: conda-incubator/setup-miniconda@v3
# with:
# activate-environment: sparse-dev
# allow-softlinks: true
# environment-file: ci/environment.yml
# python-version: ${{ matrix.python }}
# miniforge-version: latest
# - name: Install julia and numba
# run: |
# conda install conda-forge::numba
# conda install conda-forge::julia
# - uses: julia-actions/setup-julia@v1.9
# with:
# version: '1.10'
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install package
run: |
poetry install --with tests,finch
# - name: Install package
# run: |
# pip install -e .[tests,finch]
- name: Run tests
run: |
poetry run pytest tests/test_backends.py
# pytest --pyargs sparse/tests/test_backends.py
- uses: codecov/codecov-action@v4
if: always()
# - name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action/composite@v2
# if: always()
# with:
# files: "**/test-*.xml"
docs:
defaults:
run:
shell: bash -el {0}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if ci/environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
docs-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yml') }}
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: sparse-dev
allow-softlinks: true
environment-file: ci/environment.yml
python-version: '3.10'
miniforge-version: latest
- name: Install package
run: |
pip install -e .[docs]
- name: Run tests
run: |
sphinx-build -W -b html docs/ _build/html
- uses: actions/upload-artifact@v4
with:
name: Documentation
path: _build/html
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
- vnext
pull_request:
branches:
- main
- vnext
# Also trigger on page_build, as well as release created events
page_build:
release:
types: # This configuration does not affect the page_build event above
- created