diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a3e0312..a1a1c7b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - '**' + workflow_dispatch: jobs: build-docs: @@ -14,6 +15,7 @@ jobs: runs-on: ubuntu-latest if: | github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 97b3f5b..024b15c 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - '**' + workflow_dispatch: jobs: ruff: @@ -14,6 +15,7 @@ jobs: runs-on: ubuntu-latest if: | github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8de4443..db57e8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - '**' + workflow_dispatch: jobs: test: @@ -14,6 +15,7 @@ jobs: runs-on: ubuntu-latest if: | github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name @@ -47,6 +49,7 @@ jobs: runs-on: ubuntu-latest if: | github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name @@ -64,7 +67,7 @@ jobs: - name: Install tools run: | python -m pip install --upgrade pip - pip install "black[jupyter]==25.1.0" isort==6.0.1 + pip install -e ".[dev]" - name: Run Black and Isort run: | @@ -72,8 +75,8 @@ jobs: echo "Push event in same repo: Running black and isort with auto-format and commit" black . isort . - git config user.name "github-actions" - git config user.email "github-actions@github.com" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" if ! git diff --quiet; then git commit -am "style: auto-format with black and isort" git push @@ -81,8 +84,8 @@ jobs: echo "No formatting changes to commit." fi - elif [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "PR from fork: Running black and isort in check mode" + elif [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "PR or manual run: Running black and isort in check mode" black --check . || { echo "Black formatting issues found. Run 'black .' to fix."; exit 1; } isort --check-only . || { echo "isort import order issues found. Run 'isort .' to fix."; exit 1; } @@ -95,6 +98,7 @@ jobs: runs-on: ubuntu-latest if: | github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name diff --git a/.readthedocs.yml b/.readthedocs.yml index fbcf582..6aa4129 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,7 +4,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.9" + python: "3.12" python: install: diff --git a/docs/source/conf.py b/docs/source/conf.py index d3fcfc1..f56ddc6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,7 +13,7 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "experanto" +project = "Experanto" copyright = f"{datetime.today().strftime('%Y')}, sinzlab" author = "sinzlab" release = "0.1" @@ -83,6 +83,8 @@ "optree", "rootutils", "numba", + "numpy", + "yaml", ] # -- Intersphinx settings (cross-references to external docs) ---------------- diff --git a/pyproject.toml b/pyproject.toml index 646e20e..b2bd59e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ version = "0.1" description = "Python package to interpolate recordings and stimuli of neuroscience experiments" readme = "README.md" requires-python = ">=3.9" +# When adding or removing dependencies, also update autodoc_mock_imports in docs/source/conf.py if necessary. dependencies = [ "scipy>=1.13.1", "jaxtyping>=0.2.30", @@ -21,7 +22,9 @@ dependencies = [ dev = [ "pytest==8.3.5", "pytest-cov>=7.0.0", - "pyright", + "pyright==1.1.408", + "black[jupyter]==25.1.0", + "isort==6.0.1", "hypothesis>=6.0", "ruff==0.15.6", ]