Skip to content

Re-enable Spike2 real-data tests on platforms with sonpy wheels - #1914

Merged
h-mayorquin merged 8 commits into
catalystneuro:mainfrom
AxelNoun:test/spike2-reenable
Nov 16, 2026
Merged

h-mayorquin merged 8 commits into
catalystneuro:mainfrom
AxelNoun:test/spike2-reenable

Conversation

@AxelNoun

@AxelNoun AxelNoun commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Recreates #1886, which was closed automatically on 2026-08-12 when the fork hosting its branch was detached during an account cleanup on my side. Prior context and discussion: #1855


Refs #1797. Follow-up to #1855, as agreed there.

The problem. #1855 fixed the spike2 extra but left the real-data tests dead on purpose: their guard (this_python_version > version.parse("3.9")) is always true under requires-python = ">=3.10", and re-enabling them would hit Neo's CedRawIO, broken against sonpy>=1.9.12 (NeuralEnsemble/python-neo#1890). There are two such guards: TestSpike2RecordingInterface and the spike2 case of test_metadata_key_is_accepted_and_forwarded.

The fix. NeuralEnsemble/python-neo#1891 fixed CedRawIO, and main requires neo>=0.14.6 since #2239. This PR:

  • re-enables both tests where sonpy has a wheel that loads: Windows, and x86_64 Linux and macOS on Python 3.14;
  • restricts the sonpy requirement of the spike2 extra to the same combinations. The only macOS wheel of sonpy 1.9.12 is tagged universal2, but its extension contains only x86_64 code, so on Apple Silicon it installs and then fails with incompatible architecture (have 'x86_64', need 'arm64e' ...);
  • removes the known-breakage note from the Spike2 gallery page and updates its sonpy warning;
  • adds changelog_entries/1914.bugfix.md.

Verification. On CI at 6381471, the Spike2 tests ran without failures on Windows 3.11 and 3.14 and on Ubuntu 3.14, and failed on macOS 3.14 (arm64) with the error above, which led to the x86_64 restriction. The test workflows have not run on the current head yet.

Locally, on Windows 11 x86_64 with Python 3.14, neo 0.14.6 and sonpy 1.9.12 from PyPI, and spike2/m365_1sec.smrx from gin: TestSpike2RecordingInterface and test_metadata_key_is_accepted_and_forwarded[spike2] give 16 passed, and TestAssertions::test_spike2_import_assertions is skipped (it only runs where sonpy is not installable). I also evaluated the extra marker and both skip conditions for macOS arm64 and x86_64 and Linux aarch64 and x86_64 on Python 3.14: they agree, and sonpy is installed and tested only on x86_64.

Claude helped me with this PR.

Both TestSpike2RecordingInterface and the spike2 case of
test_metadata_key_is_accepted_and_forwarded were guarded by
this_python_version > version.parse("3.9"), always true under
requires-python = ">=3.10". Skip instead only where sonpy has no
wheel: Linux and macOS below Python 3.14.

Refs catalystneuro#1797
Follow-up to catalystneuro#1855

Co-authored-by: Cursor <cursoragent@cursor.com>
@AxelNoun AxelNoun closed this Aug 13, 2026
@AxelNoun AxelNoun reopened this Aug 13, 2026
@AxelNoun AxelNoun mentioned this pull request Oct 27, 2026
2 tasks done
@h-mayorquin
h-mayorquin marked this pull request as ready for review November 13, 2026 21:28
@h-mayorquin

Copy link
Copy Markdown
Collaborator

@AxelNoun neo 0.14.6 is out and main requires it since #2239, so this is unblocked. I merged main and pushed the rest of your list:

  • Removed the .. note:: about sonpy>=1.9.12 from the Spike2 gallery page.
  • Added changelog_entries/1914.bugfix.md.

The neo bump is no longer needed here as #2239 already did it. CI tests 3.11 and 3.14 now instead of 3.10 and 3.13, so once this leaves draft the tests also run on Linux and macOS 3.14, not only on Windows.

Do you want to update the description before I mark it ready for review, or should I go ahead?

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.10%. Comparing base (69e663b) to head (b6ad3ad).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1914   +/-   ##
=======================================
  Coverage   92.10%   92.10%           
=======================================
  Files         251      251           
  Lines       22637    22637           
=======================================
  Hits        20850    20850           
  Misses       1787     1787           
Flag Coverage Δ
unittests 92.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...tainterfaces/ecephys/spike2/spike2datainterface.py 55.26% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

h-mayorquin and others added 2 commits November 13, 2026 16:09
The sonpy 1.9.12 macOS wheel is tagged universal2 but its extension only
contains x86_64 code, so the spike2 extra now skips it on non-x86_64
machines. Update the gallery warning and its skip reason to match.

Claude helped me with this change.
@AxelNoun

Copy link
Copy Markdown
Contributor Author

Thanks for pushing the rest, and for the x86_64 fix. For the record, the macOS 3.14 failure was incompatible architecture (have 'x86_64', need 'arm64e' ...): the only macOS wheel of sonpy 1.9.12 is tagged universal2, but its extension contains only x86_64 code.

I pushed one more commit (113fcc4) that updates the Spike2 gallery warning and its skip reason in extras_by_gallery_entry.json, which still said sonpy works on macOS 3.14. I also rewrote the description, so it is ready from my side. The test workflows on the last two commits are waiting for approval.

One thing I left as is: on Apple Silicon, Spike2RecordingInterface now reports that sonpy is not installed and suggests pip install sonpy, which installs the wheel that does not load. _test_sonpy_installation could name the architecture instead. I can do it here or in a follow-up, or we can leave it.

@h-mayorquin
h-mayorquin enabled auto-merge (squash) November 15, 2026 07:49
@h-mayorquin
h-mayorquin disabled auto-merge November 16, 2026 20:51
@h-mayorquin
h-mayorquin merged commit 516a3f3 into catalystneuro:main Nov 16, 2026
21 of 22 checks passed
@h-mayorquin

Copy link
Copy Markdown
Collaborator

@AxelNoun thanks for tracking down the macOS failure and for rewriting the description!

I did the Apple Silicon message here as get_package can already exclude by architecture. _test_sonpy_installation now excludes darwin:arm on every Python version, so the user gets "sonpy is not available on the darwin:arm platform" instead of being told to run pip install sonpy. Intel Macs keep the exclusions they had. The test that checks that message now expects darwin:arm on Apple Silicon.

Merged, thanks for seeing this through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants