Skip to content

Commit 454cf30

Browse files
committed
Update repo to use latest template, black formatting
1 parent f44b673 commit 454cf30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1017
-1218
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check Sphinx external links
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
schedule:
8+
- cron: '0 5 * * 0' # once every Sunday at midnight ET
9+
workflow_dispatch:
10+
11+
jobs:
12+
check-external-links:
13+
name: Check for broken Sphinx external links
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # tags are required to determine the version
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.13"
25+
26+
- name: Install Sphinx dependencies and package
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install -U ".[docs]"
30+
python -m pip list
31+
32+
- name: Check Sphinx external links
33+
run: |
34+
cd docs # run_doc_autogen assumes spec is found in ../spec/
35+
sphinx-build -b linkcheck ./source ./test_build

.github/workflows/codespell.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Codespell
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
codespell:
11+
name: Check for spelling errors
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Codespell
17+
uses: codespell-project/actions-codespell@v2

.github/workflows/ruff.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Ruff
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
ruff:
11+
name: Check for style errors and common problems
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Ruff
17+
uses: astral-sh/ruff-action@v3
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Run all tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
schedule:
8+
- cron: '0 5 * * 0' # once every Sunday at midnight ET
9+
workflow_dispatch:
10+
11+
jobs:
12+
run-all-tests:
13+
name: ${{ matrix.name }}
14+
runs-on: ${{ matrix.os }}
15+
defaults:
16+
run:
17+
shell: bash
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }}
20+
cancel-in-progress: true
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- { name: linux-python3.9-minimum , requirements: minimum , python-ver: "3.9" , os: ubuntu-latest }
26+
- { name: linux-python3.9 , requirements: upgraded , python-ver: "3.9" , os: ubuntu-latest }
27+
- { name: linux-python3.10 , requirements: upgraded , python-ver: "3.10", os: ubuntu-latest }
28+
- { name: linux-python3.11 , requirements: upgraded , python-ver: "3.11", os: ubuntu-latest }
29+
- { name: linux-python3.12 , requirements: upgraded , python-ver: "3.12", os: ubuntu-latest }
30+
- { name: linux-python3.13 , requirements: upgraded , python-ver: "3.13", os: ubuntu-latest }
31+
- { name: windows-python3.9-minimum , requirements: minimum , python-ver: "3.9" , os: windows-latest }
32+
- { name: windows-python3.9 , requirements: upgraded , python-ver: "3.9" , os: windows-latest }
33+
- { name: windows-python3.10 , requirements: upgraded , python-ver: "3.10", os: windows-latest }
34+
- { name: windows-python3.11 , requirements: upgraded , python-ver: "3.11", os: windows-latest }
35+
- { name: windows-python3.12 , requirements: upgraded , python-ver: "3.12", os: windows-latest }
36+
- { name: windows-python3.13 , requirements: upgraded , python-ver: "3.13", os: windows-latest }
37+
- { name: macos-python3.9-minimum , requirements: minimum , python-ver: "3.9" , os: macos-latest }
38+
- { name: macos-python3.9 , requirements: upgraded , python-ver: "3.9" , os: macos-latest }
39+
- { name: macos-python3.10 , requirements: upgraded , python-ver: "3.10", os: macos-latest }
40+
- { name: macos-python3.11 , requirements: upgraded , python-ver: "3.11", os: macos-latest }
41+
- { name: macos-python3.12 , requirements: upgraded , python-ver: "3.12", os: macos-latest }
42+
- { name: macos-python3.13 , requirements: upgraded , python-ver: "3.13", os: macos-latest }
43+
steps:
44+
- name: Checkout repo
45+
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0 # tags are required to determine the version
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python-ver }}
53+
54+
- name: Install run requirements (minimum)
55+
if: ${{ matrix.requirements == 'minimum' }}
56+
run: |
57+
python -m pip install --upgrade pip
58+
python -m pip install ".[min-reqs,test]"
59+
python -m pip list
60+
python -m pip check
61+
62+
- name: Install run requirements (upgraded)
63+
if: ${{ matrix.requirements == 'upgraded' }}
64+
run: |
65+
python -m pip install --upgrade pip
66+
# force upgrade of all dependencies to latest versions within allowed range
67+
python -m pip install -U ".[test]"
68+
python -m pip list
69+
python -m pip check
70+
- name: Run tests
71+
run: |
72+
pytest -v
73+
74+
- name: Build wheel and source distribution
75+
run: |
76+
python -m pip install --upgrade build
77+
python -m build
78+
ls -1 dist
79+
80+
- name: Test installation from a wheel (POSIX)
81+
if: ${{ matrix.os != 'windows-latest' }}
82+
run: |
83+
python -m venv test-wheel-env
84+
source test-wheel-env/bin/activate
85+
python -m pip install dist/*-none-any.whl
86+
python -c "import ndx_franklab_novela"
87+
88+
- name: Test installation from a wheel (windows)
89+
if: ${{ matrix.os == 'windows-latest' }}
90+
run: |
91+
python -m venv test-wheel-env
92+
test-wheel-env/Scripts/activate.bat
93+
python -m pip install dist/*-none-any.whl
94+
python -c "import ndx_franklab_novela"

.github/workflows/run_coverage.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Run code coverage
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
run-coverage:
11+
name: ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
# TODO handle forks
14+
# run pipeline on either a push event or a PR event on a fork
15+
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
16+
defaults:
17+
run:
18+
shell: bash
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}
21+
cancel-in-progress: true
22+
strategy:
23+
matrix:
24+
os: [ubuntu-latest, windows-latest, macos-latest]
25+
env: # used by codecov-action
26+
OS: ${{ matrix.os }}
27+
PYTHON: '3.13'
28+
steps:
29+
- name: Checkout repo
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0 # tags are required to determine the version
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ env.PYTHON }}
38+
39+
- name: Install package and test dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
# force upgrade of all dependencies to latest versions within allowed range
43+
python -m pip install -U ".[test]"
44+
python -m pip list
45+
python -m pip check
46+
- name: Run tests and generate coverage report
47+
run: |
48+
pytest --cov --cov-report=xml --cov-report=term # codecov uploader requires xml format
49+
50+
# TODO uncomment after setting up repo on codecov.io and adding token
51+
# - name: Upload coverage to Codecov
52+
# uses: codecov/codecov-action@v4
53+
# with:
54+
# fail_ci_if_error: true
55+
# file: ./coverage.xml
56+
# env:
57+
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validate schema
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
validate:
11+
name: Validate schema
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.13"
21+
22+
- name: Install HDMF
23+
run: |
24+
pip install hdmf
25+
26+
- name: Download latest nwb schema language specification
27+
run: |
28+
curl -L https://raw.githubusercontent.com/NeurodataWithoutBorders/nwb-schema/dev/nwb.schema.json -o nwb.schema.json
29+
30+
- name: Validate schema specification
31+
run: |
32+
validate_hdmf_spec spec -m nwb.schema.json

.github/workflows/workflow.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)