FIX: handle missing __version__ in check_version#13870
FIX: handle missing __version__ in check_version#13870baris-talar wants to merge 4 commits intomne-tools:mainfrom
Conversation
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
for more information, see https://pre-commit.ci
… :func: role check_version is not listed in doc/api/ so :func:`mne.utils.check_version` fails the Sphinx docs build. Replace with plain inline ``check_version``. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I noticed that the CircleCI jobs (build_docs, linkcheck, default) are failing immediately with “task information unavailable”. |
|
It looks like the Azure failure is from test_adjacency_matches_ft[adj26], where pooch.retrieve() hits a 502 Server Error while downloading itab28_neighb.mat from the FieldTrip GitHub repository. This seems unrelated to the changes in this PR. Happy to rerun or investigate further if needed. |
|
Regarding CircleCI jobs, could you have a look at this PR and let me know if the added explanation of continuous Integration workflows is helpful? |
|
@CarinaFo Thanks — yes, this is definitely helpful. As a new contributor, I initially found it a bit confusing to distinguish between local tests and the different CI checks. One thing that caught me off guard was that some CircleCI jobs failed immediately with messages like “task information unavailable” or block-unregistered-user, which looked like real failures at first. A brief note about workflow approval for external contributors could make this even clearer. Overall though, the added explanation improves clarity a lot. |
Closes #13863
Description
This PR updates
mne.utils.check_versionto gracefully handle packages that do not expose a__version__attribute.Previously, accessing
library.__version__could raise anAttributeError, causing_soft_importto fail even when no minimum version was required.Changes
__version__access in a try/except block__version__asNonemin_versionis specifiedcheck_versiondocstring accordinglymin_version)Rationale
Some third-party libraries do not expose
__version__at the top level. This change improves robustness when handling optional dependencies, while preserving strict version checking when required.