From 6696b304644be821cf4661b118b511e1c5bccdb4 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 22 Apr 2026 13:53:27 +0200 Subject: [PATCH] Add action to copy neuropixels_probe_features from ProbeTable --- .../copy-neuropixels-probe-features.yml | 46 +++++++++++++++++++ MANIFEST.in | 1 + pyproject.toml | 3 ++ 3 files changed, 50 insertions(+) create mode 100644 .github/workflows/copy-neuropixels-probe-features.yml diff --git a/.github/workflows/copy-neuropixels-probe-features.yml b/.github/workflows/copy-neuropixels-probe-features.yml new file mode 100644 index 000000000..be39ff987 --- /dev/null +++ b/.github/workflows/copy-neuropixels-probe-features.yml @@ -0,0 +1,46 @@ +name: Sync neuropixels_probe_features from ProbeTable + +on: + schedule: + - cron: '0 0 * * 1' # Every Monday at 00:00 UTC + workflow_dispatch: + +jobs: + copy-file: + runs-on: ubuntu-latest + + steps: + - name: Checkout current repository + uses: actions/checkout@v4 + + - name: Copy file from external repo + run: | + # Download the file directly + curl -o neo/resources/neuropixels_probe_features.json \ + https://raw.githubusercontent.com/billkarsh/ProbeTable/refs/heads/main/Tables/probe_features.json + + - name: Commit changes if any + id: commit + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + git add neo/resources/neuropixels_probe_features.json + + # Only commit if there are changes + if git diff --staged --quiet; then + echo "No changes to commit" + echo "changes=false" >> $GITHUB_OUTPUT + else + git commit -m "Update neuropixels_probe_features from ProbeTable" + echo "changes=true" >> $GITHUB_OUTPUT + fi + + - name: Make PR with updated probe features + if: steps.commit.outputs.changes == 'true' + uses: peter-evans/create-pull-request@v7 + with: + title: "Update Neuropixels probe features" + body: "This PR updates the probe features JSON file from the ProbeTable repository." + branch-suffix: short-commit-hash + base: "main" diff --git a/MANIFEST.in b/MANIFEST.in index 92d8f2142..1b82c1bfa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include README.rst include LICENSE.txt +recursive-include neo/resources *.json include CITATION.rst prune drafts include examples/*.py diff --git a/pyproject.toml b/pyproject.toml index 9142a9795..6d2c0aaa8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,5 +133,8 @@ all = [ # we do not include 'stfio' in 'all' as it is not pip installable +[tool.setuptools.package-data] +neo = ["resources/*.json"] + [tool.black] line-length = 120