-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Move requirements to pyproject.toml
#12178
Move requirements to pyproject.toml
#12178
Conversation
@@ -304,11 +304,11 @@ be reflected the next time you open a Python interpreter and ``import mne`` | |||
Finally, we'll add a few dependencies that are not needed for running | |||
MNE-Python, but are needed for locally running our test suite:: | |||
|
|||
$ pip install -r requirements_testing.txt | |||
$ pip install -e .[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.
behavior change: now install full install + full set up test dependencies
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 don't think we should advertise this variant actually because it will force people to install PyQt6. Conda users -- including those of our installers -- will have PyQt5
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.
@drammock this is also an issue with the monolithic dev
-- we can't directly recommend using it because it uses full
which in turn installs PyQt6
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.
Can you point me at a discussion of why this fractionation exists? My naive question is why can't we harmonize what gets installed by the standalone installer, conda-forge recipe and pip (i.e., can't we always install PyQt5 regardless of install route)
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.
PyQt6 isn't available on on conda forge yet. PySide6 doesn't support interactive updates well. We could use PyQt5 everywhere but PyQt6 should be better as it's newer and has more features etc (so why not use it and promote it where we can).
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.
PyQt5 doesn't receive any updates or bug fixes. I've encountered text rendering bugs that will never be fixed, so I decided to support only PySide6 in MNELAB. PyQt6 should also work, but I'd really stay away from Qt5 stuff.
👍 for recommending pip over conda.
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 still not seeing the compelling argument to require pyqt6 when possible and pyqt5 otherwise
Yeah we don't explicitly use any Qt6 features yet but it's more about general GUI library usability, features, etc. Qt6 came out almost 3 years ago so it's disappointing to recommend that people use Qt5. We have no choice for our installers at the moment, though, since PyQt6 isn't available there yet 😞 If we change full
to install PyQt5 then people who use pip
/venv
(and previously used requirements.txt
) will experience a bit of a step back.
Stepping back a bit, would it work to change the contribution guidelines to say ...
We could recommend using a venv
but I think that's a harder step for most people in terms of remembering to activate, relationship to conda envs, etc. So it depends a bit on how advanced/experienced our audience is for the dev
part.
To keep things simple and easy for us (in terms of maintenance) and the less experienced devs (in terms of what they need to do), we could focus on supporting what's required for development assuming you're using our installers. In 1.6 at least these will fortunately come with a lot of what's needed:
If we consider others with different sys configs (like those using pip venvs) as "advanced" devs, maybe it's okay to expect them to use pytest SKIP
statements to see what they need when they need it. If this is acceptable, then recommending in our docs that people do pip install -e .[test]
or pip install -e .[test,docs]
might be sufficient and easier than trying to roll an all-encompassing dev
option.
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.
Do we even still need conda? I mean, for testing and in our install instructions.
I believe @cbrnr only uses pip to install everything these days, right?
I personally use conda every day still, but as I'm moving all my development into dev containers, I started using pipx and pip more, for easier setup.
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 believe @cbrnr only uses pip to install everything these days, right?
Yes, I've been using pip (and venv) exclusively for a long time now, and I haven't had any major problems. Note that I haven't really tested PyVista though, since I don't need it in my daily workflow. If we recommend VS Code, by default venvs are auto-activated, so I don't think this will be a huge issue.
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.
We could recommend using a
venv
but I think that's a harder step for most people in terms of remembering to activate, relationship to conda envs, etc. So it depends a bit on how advanced/experienced our audience is for thedev
part.
what I meant by the "however you like" in "please create an empty venv (however you like)" was that e.g., conda users could do
$ conda create -n mnedev pip
$ conda activate mnedev
$ pip install -e .[dev]
...so no need to require new knowledge of venv
if they understand at least one way of creating environments. Or stated differently: "recommend that contributors install via pip in their dev environment even if they use conda to manage environments".
To keep things simple and easy for us (in terms of maintenance) and the less experienced devs (in terms of what they need to do), we could focus on supporting what's required for development assuming you're using our installers.
-0.5 on this; the installers contain a LOT of stuff that is not needed for MNE dev work (tensorflow, plotly, etc).
…ed thanks [build-system] in pyproject.toml
I will only have time to continue work on this on Wednesday. |
No strong preference here. Channeling @larsoner I'd say "see what numpy/scipy/pandas/matplotlib call them" and follow suit if there's a pattern. One opinion I do have is that we should reconsider If CI efficiency is not the reason for the granularity, well then I still think we should consider merging some of the variants. I want our (advanced) install instructions as simple as possible, and we already have 4 variants at least: |
That's exactly what I mentioned previously. Let's try to make do with the smallest set of variants. For example, let's get rid of hdf5 and incorporate it in either the base requirements or in full. |
yes, I was echoing your prior comment, but forgot to give you credit, sorry @cbrnr. |
I think it makes sense to have it in "base", considering that we're now offering to save to HDF5 in several places. We will keep the then empty variant around for compatibility, like we do with "data". Any vetos? @agramfort Would that work for you? Or ... not so happy? 😅🫣 |
I would not keep them around forever though. Let's deprecate them. |
How are you going to let users know that they're deprecated, though? I think I read in the PyPA docs that it's recommended to just keep them around, empty ... |
Except for people using pip install in a script, this is not really part of their code, so I assume it won't really break a lot of people's workflows. I think it's fine to keep them around for two more releases, but then remove them. Surely there has to be a way of getting pip to print some warning? |
We had some extended discussion a while ago about what's required to add something to the base / required dependencies. I was trying to make the case for
So to me if we reject
Previously we decided to keep the legacy no-op options. There is close to zero maintenance burden for this so I wouldn't bother deprecating it.
Historically the motivation for the two files are:
So I like the idea of |
I'm fine with moving Regarding keeping the legacy variants around as no-ops, this means that they suddenly and silently stop doing what they used to do. I would print a warning for a couple of releases and eventually remove these options. |
I don't think we should make any existing option stop doing what it used to do. IIRC |
OK. But then they are not no-ops, right? |
|
Yep, unless we add |
here's what I think is a concrete and complete proposal. we have:
So then publicly we advertise the options |
…o-pyproject.toml * upstream/main: Fix copy-view issue in epochs (mne-tools#12121)
Okay I'm going to get rid of the |
…o-pyproject.toml * upstream/main: MRG: Add ICA's `fit_params` to HTML representation (mne-tools#12194)
Green! Fixes failures currently in |
thanks @larsoner and @hoechenberger !! |
Thanks @larsoner, massive effort! I hope I will find some time to test this before the weekend Thanks everybody for your input, esp @drammock, @cbrnr and @agramfort |
Good team effort! @hoechenberger feel free to come back to #12173 when you want. I don't think we should merge it this week as we push out 1.6 to be safe -- it's better as an early PR in the 1.7 cycle |
Co-authored-by: Eric Larson <[email protected]>
This is based on the discussion in #12173
This PR removes all
requirements*.txt
files and moves the dependencies topyproject.toml
.requirements_base.txt
is now declared underproject.dependencies
(no change )requirements_hdf5.txt
is now declared under themne[hdf5]
variant (no change)requirements.txt
is now declared under themne[full]
variant (new)requirements_testing.txt
is now declared under themne[test_base]
variant (new)requirements_testing_extra.txt
is now declared under themne[test]
variant (existed before, but was undocumented)requirement_doc.txt
is now declared under themne[doc]
variant (new)mne[dev]
variant, which resolve tomne[test,doc]
❓I wanted to ask about the naming of those variants. I think I would prefer
tests
ortesting
overtest
; anddocs
overdoc
. But no super strong feelings here. Just wanted to ask what you think.I also realized that when building the sdist via
python -m build -s
, I get some warnings related to (outdated) definitions inMANIFEST.in
, which will warrant an investigation sometime when we have time.