-
- Notifications
You must be signed in to change notification settings - Fork 1.4k
Move development dependencies into a dependency group (no more extra) #13452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
That way, the built distributions won't expose these optional dependencies anymore. This is supported in `pip` since version 25.2 (released end of July).
Co-authored-by: Daniel McCloy <dan@mccloy.info>
| I realize this is a draft PR, so you may already know / be planning this, but FWIW you'll at least need to touch |
|
No worries, all feedback is welcome ;) |
I though it was (also if such changes are needed, then |
| regardless, thanks for working on this! I've been wishing someone had the time to work on it |
Me too, then I tested it, it seemed to work without I'm wondering if it even makes sense to continue here, or if I should rather start working on switching over to Not sure what the best way forward is now. Any input is welcome! |
|
| CI errors are unrelated (NumPy API change, it seems) This one is ready for review. |
larsoner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1 for merge!
np.ndarray.ptp -> Use np.ptp(arr, ...) instead. https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ndarray-and-scalar-methods |
| Worked around in recent PR, I'll fix the conflict but it should come back green |
| ... and also python-quantities/python-quantities#263 |
drammock left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great that this is working! Aside from a couple inline remarks below, 2 high-level comments:
- I think we now need to pin to
pip >= 25.1as a dev dependency, right? (25.1 is when the--groupflag was added) - Should we do some communication with downstream projects re: this change? If for some reason they were using one of our developer-focused extras in their CIs, and e.g.
pip install mne[test]is going to start failing for them at the next release, it seems a bit mean to just spring it on them with no warning. Ideally we would have committed to doing this a while ago and announced it in the prior release's changelog, and then done it now. But since we didn't do that, I think we should at minimum announce this in the upcoming changelog (and tell them what the fix is) so that if they do need to change their CI config it will be as painless as possible.
pyproject.toml Outdated
| requires = ["hatch-vcs", "hatchling"] | ||
| | ||
| [dependency-groups] | ||
| dev = ["rcssmin", {include-group = "doc"}, {include-group = "test"}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do people think about making dev group depend on test_extra instead of just test? That way, dev will include everything needed to run all tests (without test_extra some tests will get skipped)
| dev = ["rcssmin", {include-group = "doc"}, {include-group = "test"}] | |
| dev = ["rcssmin", {include-group = "doc"}, {include-group = "test_extra"}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disk space is cheap and plenty, so why not :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@larsoner can you make this change too while you're at it? (or just push the "commit suggestion" button)
tools/circleci_dependencies.sh Outdated
| sleepecg tensorpac yasa meegkit eeg_positions wfdb \ | ||
| curryreader | ||
| curryreader \ | ||
| --group=test --group=doc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's legal to put these flags at the end of the command, but it seems to me a bit nicer to put them adjacent to -ve .[full] (since . is the package they apply to). IDK if it works to do pip install . --group=test package2 package3 (sticking the group flag in between other deps), but if it doesn't maybe we could just move -ve .[full] to the end (after curryreader)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to anything if you believe it improves readability!
Since we're talking about this particular section of the script: I'm not a fan of having dependencies listed inline like this … any chance we could change that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting adding another dependency group for these? It seems a bit odd to add a dep group just for ease of CI usage (not sure end users will ever want this set of deps as a whole?) @larsoner WDYT about adding these to a dep group?
They look like the "related community projects" from https://mne.tools/dev/install/mne_tools_suite.html#related-software but it seems some are missing (antio, best-python, cross-domain-saliency-maps, ...) Maybe it's the set of community projects that are in the installer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has more to do with our doc build than anything else (most are just used for the "related software" section) and it's the only place they're used, so circleci_dependencies.sh makes more sense as a place to have them to me than the more general pyproject.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was more thinking along the lines of a requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A doc/related_software.txt could make sense and be nicely scoped / named for its purpose etc., and reduce this to just -r doc/related_software.txt. Feel free to push here if @drammock agrees!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has more to do with our doc build than anything else (most are just used for the "related software" section) and it's the only place they're used, so
circleci_dependencies.shmakes more sense as a place to have them to me than the more generalpyproject.toml
Thinking about it, why shouldn't we have dep groups of the kind build-docs or docs-ci? That way, all dependencies for everything we do would be centralized 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both approaches "centralize" different ways... depends on whether you want to centralize/prioritize "as many dependency specs as possible should live in pyproject.toml" vs "as much doc-build-related stuff as possible should live in doc/". To me pyproject.toml is most useful/ideal when lists are intended to get reused multiple places, rather than as a host for all possible dependency specs for a project. This particular list is really a one-off related to doc/sphinxext/related_software.py. The most natrual place actually would be for it to live in that .py script if we could pull it off -- there are some relationships between that file and this list -- but then at least doc/ is closer than pyproject.toml from a filesystem/scope sense.
For another example, if we wanted to move as many deps as possible to pyproject.toml, we'd want to add an entry for PyQt5 for our Qt tests in azure-pipelines.yml, and I think that would (also) make it a bit harder to maintain rather than keeping that specific dependency (which is only ever used there, like in the CircleCI case) in azure-pipelines.yml. There are probably other cases like this, too, for other CI-related things in our GHA and/or Azure runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll push a quick commit to add the requirements file and fix the conflict then mark for merge-when-green, since this otherwise seems almost good to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks Eric, please feel free to take over and push this over the finish line, I likely won't have time for a bit!
Thinking about this a bit, I am pretty sure |
| Okay @drammock should be good to go! |
| Nice, thanks @hoechenberger, @larsoner, and @drammock! |
* upstream/main: (23 commits) ENH: Add on_missing for combine_channels (mne-tools#13463) Bump the actions group with 2 updates (mne-tools#13464) Move development dependencies into a dependency group (no more extra) (mne-tools#13452) ENH: add on_missing for rename_channels (mne-tools#13456) add advisory board to website (mne-tools#13462) ENH: Support Nihon Kohden EEG-1200A V01.00 (mne-tools#13448) MAINT: Update dependency specifiers (mne-tools#13459) ENH: Add encoding parameter to Nihon Kohden reader (mne-tools#13458) [MAINT] Automatic SPEC0 dependency version management (mne-tools#13451) FIX: Read Nihon Kohden annotation file accurately (mne-tools#13251) MAINT: Restore edfio git install (mne-tools#13421) Support preload=False for the new EEGLAB single .set format (mne-tools#13096) [pre-commit.ci] pre-commit autoupdate (mne-tools#13453) MAINT: Restore PySide6 6.10.0 testing (mne-tools#13446) MAINT: Auth [skip azp] [skip actions] MAINT: Deploy [circle deploy] [skip azp] [skip actions] Bump github/codeql-action from 3 to 4 in the actions group (mne-tools#13442) ENH: Dont constrain fiducial clicks to mesh vertices (mne-tools#13445) Use timezone-aware ISO 8601 for website timestamp (mne-tools#13347) [pre-commit.ci] pre-commit autoupdate (mne-tools#13443) ...
* upstream/main: (230 commits) FIX: Fix ICA.apply when fitted including marked bad channels (mne-tools#13478) FIX: Correctly set the calibration factor in Nihon Kohden reader (mne-tools#13468) [pre-commit.ci] pre-commit autoupdate (mne-tools#13479) MAINT: Update code credit (mne-tools#13477) Fix `versionadded` directive formatting (mne-tools#13471) typo in mailmap (mne-tools#13475) FIX: Fix _plot_topomap channel names plotting when using a mask (mne-tools#13470) FIX: Handle an Eyelink File with blank lines injected throughout file (mne-tools#13469) ENH: adds annotation filtering to raw and ica source figures (mne-tools#13460) MAINT: Restore VTK nightly wheel on Linux and bump changelog checker (mne-tools#13436) [pre-commit.ci] pre-commit autoupdate (mne-tools#13465) FIX: Fix add_reference_channels for passing two channels names (mne-tools#13466) ENH: Add on_missing for combine_channels (mne-tools#13463) Bump the actions group with 2 updates (mne-tools#13464) Move development dependencies into a dependency group (no more extra) (mne-tools#13452) ENH: add on_missing for rename_channels (mne-tools#13456) add advisory board to website (mne-tools#13462) ENH: Support Nihon Kohden EEG-1200A V01.00 (mne-tools#13448) MAINT: Update dependency specifiers (mne-tools#13459) ENH: Add encoding parameter to Nihon Kohden reader (mne-tools#13458) ...
* upstream/main: (85 commits) FIX: Fix ICA.apply when fitted including marked bad channels (mne-tools#13478) FIX: Correctly set the calibration factor in Nihon Kohden reader (mne-tools#13468) [pre-commit.ci] pre-commit autoupdate (mne-tools#13479) MAINT: Update code credit (mne-tools#13477) Fix `versionadded` directive formatting (mne-tools#13471) typo in mailmap (mne-tools#13475) FIX: Fix _plot_topomap channel names plotting when using a mask (mne-tools#13470) FIX: Handle an Eyelink File with blank lines injected throughout file (mne-tools#13469) ENH: adds annotation filtering to raw and ica source figures (mne-tools#13460) MAINT: Restore VTK nightly wheel on Linux and bump changelog checker (mne-tools#13436) [pre-commit.ci] pre-commit autoupdate (mne-tools#13465) FIX: Fix add_reference_channels for passing two channels names (mne-tools#13466) ENH: Add on_missing for combine_channels (mne-tools#13463) Bump the actions group with 2 updates (mne-tools#13464) Move development dependencies into a dependency group (no more extra) (mne-tools#13452) ENH: add on_missing for rename_channels (mne-tools#13456) add advisory board to website (mne-tools#13462) ENH: Support Nihon Kohden EEG-1200A V01.00 (mne-tools#13448) MAINT: Update dependency specifiers (mne-tools#13459) ENH: Add encoding parameter to Nihon Kohden reader (mne-tools#13458) ...
That way, the built distributions won't expose these optional dependencies anymore.
This is supported in
pipsince version 25.2 (released end of July).FYI I originally placed the
dependency-groupssection inpyproject.tomlbelow the extras, but one of our pre-commit hooks moved it up, right below the build system specs.