Skip to content

Add pagerank example #696

Add pagerank example

Add pagerank example #696

Workflow file for this run

defaults:
run:
shell: bash -leo pipefail {0}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
python: ['3.10', '3.11', '3.12']
pip_opts: ['']
numba_boundscheck: [0]
include:
- os: macos-latest
python: '3.10'
- os: windows-latest
python: '3.10'
- os: ubuntu-latest
python: '3.10'
numba_boundscheck: 1
- os: ubuntu-latest
python: '3.10'
pip_opts: "--pre -U"
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: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install package
run: |
pip install -e .[tests]
pip install ${{ matrix.pip_opts }} numpy numba
- name: Run tests
run: |
SPARSE_BACKEND=Numba pytest --pyargs sparse --cov-report=xml:coverage_Numba.xml -n 4 -vvv
SPARSE_BACKEND=Finch pytest --pyargs sparse/tests --cov-report=xml:coverage_Finch.xml -n 4 -vvv
- uses: codecov/codecov-action@v4
if: always()
with:
files: ./**/coverage*.xml
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- 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
benchmarks:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install asv
run: |
pip install asv
asv machine --yes
- name: Run benchmarks
run: |
asv run --quick
examples:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Build and install Sparse
run: |
pip install -U setuptools wheel
python -m pip install '.[finch]' scipy networkx
- name: Run examples
run: |
source ci/test_examples.sh
array_api_tests:
strategy:
matrix:
backend: ['Numba', 'Finch']
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Checkout array-api-tests
uses: actions/checkout@v4
with:
repository: data-apis/array-api-tests
ref: '33f2d2ea2f3dd2b3ceeeb4519d55e08096184149' # Latest commit as of 2024-05-29
submodules: 'true'
path: 'array-api-tests'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install build and test dependencies from PyPI
run: |
python -m pip install pytest-xdist -r array-api-tests/requirements.txt
- name: Build and install Sparse
run: |
python -m pip install '.[finch]'
- name: Run the test suite
env:
ARRAY_API_TESTS_MODULE: sparse
SPARSE_BACKEND: ${{ matrix.backend }}
run: |
cd ${GITHUB_WORKSPACE}/array-api-tests
pytest array_api_tests -v -c pytest.ini -n 4 --max-examples=2 --derandomize --disable-deadline -o xfail_strict=True --xfails-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}-array-api-xfails.txt --skips-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}-array-api-skips.txt
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