Skip to content

Commit

Permalink
Attempt to fix CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
hameerabbasi committed Dec 16, 2024
1 parent 8158401 commit d50abb5
Show file tree
Hide file tree
Showing 11 changed files with 10,970 additions and 68 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,15 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v2
- uses: prefix-dev/setup-pixi@v0.8.1
with:
environment-file: ci/environment.yml
init-shell: >-
bash
cache-environment: true
cache-downloads: true
post-cleanup: 'all'
create-args: >-
python=${{ matrix.python }}
${{ matrix.pip_opts }}
- name: Install package
run: |
pip install -e '.[tests]'
# micromamba remove numba
# micromamba install -c numba numba
pixi-version: v0.39.2
cache: true
- name: Run tests
run: |
SPARSE_BACKEND=Numba pytest --pyargs sparse --doctest-modules --cov-report=xml:coverage_Numba.xml -n0 -vvv
SPARSE_BACKEND=Finch pytest --pyargs sparse/tests --cov-report=xml:coverage_Finch.xml -n0 -vvv
SPARSE_BACKEND=MLIR pytest --pyargs sparse/mlir_backend --cov-report=xml:coverage_MLIR.xml -n0 -vvv
pixi run -e test test --cov-report=xml:coverage_Numba.xml -vvv
pixi run -e finch-dev test-finch --cov-report=xml:coverage_Finch.xml -vvv
pixi run -e mlir-dev test-mlir --cov-report=xml:coverage_MLIR.xml -vvv
- uses: codecov/codecov-action@v5
if: always()
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,3 @@ docs/examples_ipynb/

# Pixi envs
.pixi/
pixi.lock
19 changes: 0 additions & 19 deletions ci/environment.yml

This file was deleted.

20 changes: 17 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import pathlib

import sparse

import pytest


Expand All @@ -7,8 +11,18 @@ def add_doctest_modules(doctest_namespace):

import numpy as np

if sparse._BackendType.Numba != sparse._BACKEND:
pass # TODO: pytest.skip() skips Finch and MLIR tests

doctest_namespace["np"] = np
doctest_namespace["sparse"] = sparse


def pytest_ignore_collect(collection_path: pathlib.Path, config: pytest.Config) -> bool | None:
if "numba_backend" in collection_path.parts and sparse._BackendType.Numba != sparse._BACKEND:
return True

if "mlir_backend" in collection_path.parts and sparse._BackendType.MLIR != sparse._BACKEND:
return True

if "finch_backend" in collection_path.parts and sparse._BackendType.Finch != sparse._BACKEND:
return True

return None
Loading

0 comments on commit d50abb5

Please sign in to comment.