Skip to content

Apply the sonpy platform marker to the ced and all extras - #1913

Merged
zm711 merged 4 commits into
NeuralEnsemble:masterfrom
AxelNoun:ced-extra-platform-marker
Nov 25, 2026
Merged

zm711 merged 4 commits into
NeuralEnsemble:masterfrom
AxelNoun:ced-extra-platform-marker

Conversation

@AxelNoun

@AxelNoun AxelNoun commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1891, as agreed there with @zm711 on 2026-08-04 ("I would say separate PR").

sonpy 1.9.12 (every older release caps Requires-Python below 3.10) publishes wheels for Windows (win_amd64, cp39 to cp314) and, for Linux (manylinux_2_39 x86_64) and macOS (universal2), for cp314 only, plus an sdist. The test extra already selects sonpy with platform_system=='Windows' or python_version>='3.14', but ced and all request it unconditionally, so on Linux or macOS with Python 3.10 to 3.13 pip install neo[ced] falls back to the sonpy sdist.

Changes

  • pyproject.toml: the same marker on sonpy in ced and all, with a one-line comment above ced.
  • neo/rawio/cedrawio.py: the "sonpy is not installed" ImportError now names the platform constraint, as the CedRawIO docstring already stated; the docstring now mentions both extras.

Behaviour change: on Linux and macOS with Python 3.10 to 3.13, neo[ced] and neo[all] no longer install sonpy, and using CedRawIO there raises:

ImportError: sonpy is not installed. sonpy only publishes wheels for Windows, and for Linux and macOS from Python 3.14 onwards; on those platforms install it with `pip install sonpy`.

The marker approximates the wheel list: it does not exclude Linux aarch64, glibc older than 2.39, Windows on ARM, or a future Python version without wheels. It will need an update if CED publishes more wheels.

Checks

  • packaging.markers: the marker is true on Windows for Python 3.10 to 3.14, and on Linux and macOS for 3.14 only. The sonpy requirement is identical in test, ced and all.
  • uv pip install --dry-run ".[ced]" (uv 0.11.29) with --python-platform and --python-version: sonpy 1.9.12 is selected for Windows on 3.10, 3.13 and 3.14, and for Linux x86_64 and macOS arm64 on 3.14; nothing is selected for Linux and macOS on 3.10 and 3.13. On master, the same command for Linux on 3.12 selects sonpy 1.9.12, which has no wheel for that target.
  • Windows, Python 3.12: without sonpy, _get_sonpy_namespace() raises the message above; after uv pip install -e ".[ced]" (sonpy 1.9.12 wheel), it returns the sonpy namespace with SonFile.
  • black --check neo/rawio/cedrawio.py passes.
  • I did not run the CED tests locally (no test data on this machine). In CI they still run only where the test extra installs sonpy, which this PR does not change.

Authors list

On #1891 (2026-08-11) you offered to add me to the author list before the next release, and I replied with the name to use. doc/source/authors.rst does not list me yet, either on master or on #1910. Should I add the line in this PR, or would you prefer to add it yourself? I have left it out of this diff.

sonpy 1.9.12 only publishes wheels for Windows, and for Linux and macOS
on Python 3.14. Elsewhere `pip install neo[ced]` fell back to the sonpy
source distribution. Use the marker already present in the `test` extra
for `ced` and `all`, so those platforms install nothing and CedRawIO
raises its ImportError on first use.

Make that ImportError name the platform constraint, as the CedRawIO
docstring already stated, and update the docstring to cover both extras.

Follow-up to NeuralEnsemble#1891.
@zm711

zm711 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@AxelNoun The data repo we use is giving a lot of troubles for testing right now. We are working on that. I'll try to review this shortly unless one of the other maintainers is able to get to it. I will add you as author in the release PR that I'm prepping for this weekend since I'm not quite sure if this PR will make it into our point release.

@AxelNoun

AxelNoun commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@AxelNoun The data repo we use is giving a lot of troubles for testing right now. We are working on that. I'll try to review this shortly unless one of the other maintainers is able to get to it. I will add you as author in the release PR that I'm prepping for this weekend since I'm not quite sure if this PR will make it into our point release.

Don't hesitate to tell me if I can help you in any way ! Thank you for your attention to my work ! I remain available if you need me !

@AxelNoun

Copy link
Copy Markdown
Contributor Author

@zm711 @h-mayorquin Friendly ping on this one when you have a moment. It only adds the existing test marker to sonpy in the ced and all extras, plus a clearer ImportError message. CI is green and it merges cleanly on current master. Happy to adjust anything.

@zm711 zm711 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me. I'll give @h-mayorquin until Monday to review it and then I'll merge if he has no comments. Thanks for the ping!

@AxelNoun

Copy link
Copy Markdown
Contributor Author

This looks fine to me. I'll give @h-mayorquin until Monday to review it and then I'll merge if he has no comments. Thanks for the ping!

Sounds good, thanks for the update! I appreciate you taking the time to coordinate the review. Hopefully we can get it merged on Monday. Thanks again!

@h-mayorquin

Copy link
Copy Markdown
Contributor

Does this really work on apple silicon? don't we need to rule out arm?

sonpy 1.9.12 ships x86_64 binaries only: win_amd64, manylinux x86_64,
and a macOS wheel tagged universal2 whose extension module contains a
single x86_64 slice. Skip sonpy on Windows ARM64 and, from Python 3.14,
on any non-x86_64 Linux or macOS machine, including Apple Silicon.
@AxelNoun

Copy link
Copy Markdown
Contributor Author

@h-mayorquin You are right, thank you. I checked the binaries in the sonpy 1.9.12 wheels rather than relying on their tags:

  • cp314-cp314-macosx_10_15_universal2: despite the universal2 tag, sonpy.cpython-314-darwin.so is a thin Mach-O with a single x86_64 slice. pip would therefore install it on Apple Silicon, and the import would then fail under a native arm64 Python.
  • cp314-cp314-manylinux_2_39_x86_64: x86_64 ELF.
  • win_amd64: x86-64 PE.

There is no build for Linux aarch64 or Windows ARM64 either. In 8e21e4f the marker, identical in test, ced and all, becomes:

(platform_system=='Windows' and platform_machine!='ARM64') or (python_version>='3.14' and platform_machine=='x86_64' and (platform_system=='Linux' or platform_system=='Darwin'))

The ImportError message and the CedRawIO docstring now state the same constraint. Evaluated with packaging.markers on Windows (AMD64, ARM64), Linux (x86_64, aarch64) and macOS (x86_64, arm64) for Python 3.11 to 3.15, the marker matches the available binaries everywhere except Python 3.15, for which sonpy has not published wheels yet. I have not run an installation on ARM hardware.

The failing Read the Docs build is unrelated to this change: the ipython block in doc/source/rawio.rst receives a 403 from gin, and the same error appeared on the master build of 2026-11-09 and on other recent PRs.

@h-mayorquin h-mayorquin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this makes sense to me.

@zm711
zm711 merged commit c2c20bc into NeuralEnsemble:master Nov 25, 2026
62 checks passed
@AxelNoun
AxelNoun deleted the ced-extra-platform-marker branch November 25, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants