Skip to content

Commit

Permalink
add doctest workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Jan 11, 2024
1 parent 5bbec0a commit bb372c8
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
# - "3.12"
steps:
# This cancels any such job that is still runnning
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Linux libraries
run: |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \
libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
- name: Install dependencies
run: |
pip install --upgrade pip
pip install zstandard==0.16.0
pip install numpy
pip install flybrains --no-deps
pip install pyarrow
- name: Install fafbseb
run: pip install -e .
- name: Report dependency versions
run: pip freeze -r requirements.txt
- name: Set FlyWire CAVE token for tests
env:
CAVE_TOKEN: ${{ secrets.cave_token }}
run: |
python -c "from fafbseg import flywire;flywire.set_chunkedgraph_secret('$CAVE_TOKEN')"
- name: Test with pytest
with:
run: |
export NAVIS_HEADLESS=TRUE
pytest --verbose
11 changes: 11 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

SKIP = ['conf.py']

def pytest_ignore_collect(path):
# Do not test the Blender module - for some reason that can't be imported
if "blender" in str(path):
return True
for s in SKIP:
if str(path).endswith(s):
return True

5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
doctest_optionflags = IGNORE_EXCEPTION_DETAIL NUMBER NORMALIZE_WHITESPACE
addopts = --doctest-modules
env =
NAVIS_HEADLESS=TRUE

0 comments on commit bb372c8

Please sign in to comment.