Skip to content

Commit

Permalink
Remove style checks from main CI tests; rely on pre-commit (python-gr…
Browse files Browse the repository at this point in the history
…aphblas#359)

* Remove style checks from main CI tests; rely on pre-commit

* Randomly run notebook checks 1/3 of the time

* Some github action cleanup
  • Loading branch information
eriknw authored Jan 1, 2023
1 parent 5cb766e commit 704a81d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 31 deletions.
57 changes: 27 additions & 30 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,30 @@ jobs:
miniforge-version: latest
use-mamba: true
python-version: ${{ matrix.cfg.pyver }}
channels: conda-forge,defaults
channels: conda-forge,nodefaults
channel-priority: strict
activate-environment: graphblas
auto-activate-base: false
- name: Update env
run: |
mamba install -c conda-forge pytest coverage black flake8 \
coveralls=3.3.1 pytest-randomly flake8-comprehensions flake8-bugbear
mamba install pytest coverage coveralls=3.3.1 pytest-randomly black \
pandas numba scipy networkx cffi donfig pyyaml awkward
- name: Build extension module
run: |
mamba install -c conda-forge pandas numba scipy networkx cffi donfig pyyaml awkward
if [[ ${{ matrix.cfg.sourcetype }} == "wheel" ]]; then
pip install suitesparse-graphblas
else
mamba install -c conda-forge "graphblas>=7.4.0"
mamba install "graphblas>=7.4.0"
fi
if [[ ${{ matrix.cfg.sourcetype }} == "source" ]]; then
pip install --no-binary=all suitesparse-graphblas
elif [[ ${{ matrix.cfg.sourcetype }} == "upstream" ]]; then
# I can't get pip install from git to work, so git clone instead.
# pip install git+https://github.com/GraphBLAS/python-suitesparse-graphblas.git@main#egg=suitesparse-graphblas
mamba install -c conda-forge cython
git clone --depth=1 https://github.com/GraphBLAS/python-suitesparse-graphblas.git ssgb
pushd ssgb
python setup.py install # deprecated?
# pip install . # doesn't work
popd
mamba install cython
pip install --no-deps git+https://github.com/GraphBLAS/python-suitesparse-graphblas.git@main#egg=suitesparse-graphblas
elif [[ ${{ matrix.cfg.sourcetype }} == "conda-forge" ]]; then
mamba install -c conda-forge python-suitesparse-graphblas
mamba install python-suitesparse-graphblas
fi
python setup.py develop --no-deps
pip install --no-deps -e .
- name: Unit tests
run: |
coverage run --branch -m pytest ${{ matrix.cfg.testopts }} -v
Expand Down Expand Up @@ -114,10 +107,6 @@ jobs:
coverage run -a --branch -m graphblas.core.infixmethods
git diff --exit-code
coverage xml
- name: Style Checks
run: |
flake8
black . --check --diff
- name: Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -128,26 +117,34 @@ jobs:
coveralls --service=github
- name: codecov
uses: codecov/codecov-action@v3
# Randomly test notebooks 1/3 of the time
- name: random number
uses: ddradar/[email protected]
id: rand
with:
contents: |
true
false
weights: |
1
2
- name: Notebooks Execution check
if: ${{ steps.rand.outputs.selected == 'true' }}
run: |
mamba install -c conda-forge matplotlib nbconvert jupyter 'ipython>=7'
mamba install matplotlib nbconvert jupyter 'ipython>=7'
jupyter nbconvert --to notebook --execute notebooks/*ipynb
finish:
needs: build_and_test
if: always()
runs-on: ubuntu-latest
steps:
- name: Setup conda env
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda create -n coveralls_final -c conda-forge python=3.9 coveralls=3.3.1
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: python -m pip install --upgrade pip
- run: pip install coveralls
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda activate coveralls_final
coveralls --finish
run: coveralls --finish
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ repos:
files: ^(graphblas|docs)/
args: ["--ignore-words-list=coo,ba"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.200
rev: v0.0.205
hooks:
- id: ruff
args: ["--force-exclude"]
Expand Down

0 comments on commit 704a81d

Please sign in to comment.