Skip to content

Commit bc1c491

Browse files
Merge pull request sensorium-competition#147 from reneburghardt/fix-docs-and-workflow
Fix doc building and version constraints and allow manual dispatching of CI pipelines
2 parents d61d9b8 + 8c2be2c commit bc1c491

6 files changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
pull_request:
88
branches:
99
- '**'
10+
workflow_dispatch:
1011

1112
jobs:
1213
build-docs:
1314
name: Build Sphinx Docs
1415
runs-on: ubuntu-latest
1516
if: |
1617
github.event_name == 'push' ||
18+
github.event_name == 'workflow_dispatch' ||
1719
(
1820
github.event_name == 'pull_request' &&
1921
github.repository != github.event.pull_request.head.repo.full_name

.github/workflows/ruff.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
pull_request:
88
branches:
99
- '**'
10+
workflow_dispatch:
1011

1112
jobs:
1213
ruff:
1314
name: Ruff Linting
1415
runs-on: ubuntu-latest
1516
if: |
1617
github.event_name == 'push' ||
18+
github.event_name == 'workflow_dispatch' ||
1719
(
1820
github.event_name == 'pull_request' &&
1921
github.repository != github.event.pull_request.head.repo.full_name

.github/workflows/test.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
pull_request:
88
branches:
99
- '**'
10+
workflow_dispatch:
1011

1112
jobs:
1213
test:
1314
name: Run Tests
1415
runs-on: ubuntu-latest
1516
if: |
1617
github.event_name == 'push' ||
18+
github.event_name == 'workflow_dispatch' ||
1719
(
1820
github.event_name == 'pull_request' &&
1921
github.repository != github.event.pull_request.head.repo.full_name
@@ -47,6 +49,7 @@ jobs:
4749
runs-on: ubuntu-latest
4850
if: |
4951
github.event_name == 'push' ||
52+
github.event_name == 'workflow_dispatch' ||
5053
(
5154
github.event_name == 'pull_request' &&
5255
github.repository != github.event.pull_request.head.repo.full_name
@@ -64,25 +67,25 @@ jobs:
6467
- name: Install tools
6568
run: |
6669
python -m pip install --upgrade pip
67-
pip install "black[jupyter]==25.1.0" isort==6.0.1
70+
pip install -e ".[dev]"
6871
6972
- name: Run Black and Isort
7073
run: |
7174
if [[ "${{ github.event_name }}" == "push" && "${{ github.repository }}" == "${{ github.event.repository.full_name }}" ]]; then
7275
echo "Push event in same repo: Running black and isort with auto-format and commit"
7376
black .
7477
isort .
75-
git config user.name "github-actions"
76-
git config user.email "github-actions@github.com"
78+
git config user.name "github-actions[bot]"
79+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
7780
if ! git diff --quiet; then
7881
git commit -am "style: auto-format with black and isort"
7982
git push
8083
else
8184
echo "No formatting changes to commit."
8285
fi
8386
84-
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
85-
echo "PR from fork: Running black and isort in check mode"
87+
elif [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
88+
echo "PR or manual run: Running black and isort in check mode"
8689
black --check . || { echo "Black formatting issues found. Run 'black .' to fix."; exit 1; }
8790
isort --check-only . || { echo "isort import order issues found. Run 'isort .' to fix."; exit 1; }
8891
@@ -95,6 +98,7 @@ jobs:
9598
runs-on: ubuntu-latest
9699
if: |
97100
github.event_name == 'push' ||
101+
github.event_name == 'workflow_dispatch' ||
98102
(
99103
github.event_name == 'pull_request' &&
100104
github.repository != github.event.pull_request.head.repo.full_name

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2
44
build:
55
os: ubuntu-22.04
66
tools:
7-
python: "3.9"
7+
python: "3.12"
88

99
python:
1010
install:

docs/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# -- Project information -----------------------------------------------------
1414
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1515

16-
project = "experanto"
16+
project = "Experanto"
1717
copyright = f"{datetime.today().strftime('%Y')}, sinzlab"
1818
author = "sinzlab"
1919
release = "0.1"
@@ -83,6 +83,8 @@
8383
"optree",
8484
"rootutils",
8585
"numba",
86+
"numpy",
87+
"yaml",
8688
]
8789

8890
# -- Intersphinx settings (cross-references to external docs) ----------------

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1"
44
description = "Python package to interpolate recordings and stimuli of neuroscience experiments"
55
readme = "README.md"
66
requires-python = ">=3.9"
7+
# When adding or removing dependencies, also update autodoc_mock_imports in docs/source/conf.py if necessary.
78
dependencies = [
89
"scipy>=1.13.1",
910
"jaxtyping>=0.2.30",
@@ -21,7 +22,9 @@ dependencies = [
2122
dev = [
2223
"pytest==8.3.5",
2324
"pytest-cov>=7.0.0",
24-
"pyright",
25+
"pyright==1.1.408",
26+
"black[jupyter]==25.1.0",
27+
"isort==6.0.1",
2528
"hypothesis>=6.0",
2629
"ruff==0.15.6",
2730
]

0 commit comments

Comments
 (0)