-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
APE23: Guidelines for required and optional dependencies #86
base: main
Are you sure you want to change the base?
Conversation
Prompted by some of the discussion at the 2024 coordination meeting:
Another thing that came up is the question of what to do with conda. Since conda has no concept of "recommended dependencies" the situation is even worse there. The feeling in the room at the 2024 coordination meeting seemed to be that it made sense to make all the recommended requirements be "requirements" for conda, although it isn't clear to me if the desire was to make this part of this APE vs just a thing we can do in the conda-forge recipe. |
@Cadair started a PR in that direction at conda-forge/astropy-feedstock#137 if anyone's interested |
I think we should 100% put all the recommended deps in the conda recipie now. Frankly, I think we should put all of the unintuitive deps in the conda recipie now. It's just user hostile not to, given the lack of [all] and also it's the generally done thing in conda packages. |
To express an opinion on a more meta level: Our current dependency policy, both in how they are specified in pyproject.toml and the conda recipe is actively user hostile for the majority of our users. We can love the purity (and occasional utility) of having it possible to install astropy with few dependencies, but given the tooling we are working with the upshot of supporting that use case is that we make things significantly worse for the majority of people. We should move scipy and matplotlib for sure into required dependencies in pyproject and we should also add all the non-interface dependencies to the list on conda-forge, we should do the latter now, as there's no good reason I can see not to. |
While I'm not entirely averse to the idea, I'm not sure I agree with that assertion. You would need to support that with data. For instance I just checked pandas and it does not include optional dependencies in conda. |
oooh, well in trying to find a citation, I found this: https://conda-forge.org/docs/maintainer/knowledge_base/#multi-output-recipes
So clearly we should do that, have "astropy" be basically everything and astropy-base be nothing but recommended. |
I understand scipy (though there is still a lot of functionality that doesn't require it, many still just use astropy for the fits and wcs modules), but why mpl, surely that is not at all required for most astropy functionality. |
As the person who usually complains about all the extra unwanted baggage - this I am totally fine with. As far as I can tell, the only reason we ever have had disagreements about making all optional dependencies the default, is that So, -1 on changing |
It is stupid to do just because |
I still maintain the pain of |
Users not knowing what their tools doing is not exactly a strong argument here. E.g. And peppering downstream configs with --no-deps and other workarounds for astropy installs and instead spelling out required dependencies manually is not at all a good alternative (I found the need to explicitly name liberfa in astroquery configs a not at all good experience). |
Agree with @bsipocz here. Also, as @neutrinoceros noticed elsewhere, most users just have a single virtual environment, in which almost certainly they have installed scipy and matplotlib by hand, quite possibly before installing astropy. And it is not like they don't need to install other packages by hand (say, astroquery). Anyway, let's get the And perhaps it really does make sense to just have |
Hadn't even thought of it. Please, don't force me to adjust my other packages (which, yes, all use astropy, but, no, do not require scipy or matplotlib, since really I just use the basics, units, SkyCoord, Time, QTable, io)! |
Just to circle back to the APE, I want to make sure we don't lose sight of the fact that making scipy be installed by default is not just about convenience, it actually reflects that it really should be a required dependency as it is used in so many unexpected places (unlike matplotlib). |
I will try and update the APE shortly based on the coordination meeting feedback |
Could matplotlib then be put into a separate output in conda as well, like |
For the record, I'm on board with adding dependencies for the conda package and have astropy-base for the minium set. The above resistance is for not adding non-required things to the mandatory list in pyproject. Having more extras option is also a 👍 from me, even if there are overlaps between the various extras lists (quite like what pandas has on that front, I can just really quickly browse for the keyword parquet or s3 and install only what's needed for those) |
I'm +1 on what @bsipocz said, especially this
and I'll add: Footnotes
|
This is probably the best place to bring this up but, I have got the conda-forge recipe in a state where we need to actually decide on the concrete list of optional dependencies to install for "astropy" (as opposed to "astropy-base") by default, input and review welcome here: https://github.com/conda-forge/astropy-feedstock/pull/137/files#diff-f3725a55bf339595bf865fec73bda8ac99f283b0810c205442021f29c06eea9aR83 |
Can you elaborate on that? Both package managers install all required dependencies by default, so to first order the footprint should be the same in both cases, right? Both package managers also include an option to ignore dependencies and allow a "minimal" installation that will likely be broken. I'm not sure if this is still the case, but the biggest difference is that the conda dependency graph management is more robust, so for instance it won't let you downgrade or remove a package if that breaks any installed package. IIRC, pip will happily let you "corrupt" your environment with no warnings. In practice, I'm finding that |
What I meant there was to reformulate how pip/PyPI have mechanisms to require extra dependencies, while conda doesn't. Nothing new really, I just wanted to take a step back and reframe the discussion a bit.
Yes.
This was actually changed in 2020: modern versions of pip have a "true" dependency resolver and will warn you in case of conflicting requirements. It still lets you ignore them if you explicitly specify requirements that don't respect your existing environment, but there again it does tell you that you're doing it. This is the reason why in 2020 I switched from conda to pip as my installer, since pip resolved the only problem that made me prefer conda at that time.
Related: I started a discussion on |
@neutrinoceros - Are you sure about that? That is not my experience:
|
Well, uninstalling is not what I had in mind. Indeed it seems that conda outshines pip in this area.
outputs
Or, to show that pip does keep track of what's already installed
then
outputs
as I was saying, it does let you install conflicting requirements but makes it harder (it won't do it if these requirements come from a single command), and warns about it. |
And for completion, here are the same scenarios with
-> similar to
then
-> no error message at all ! FTR this behavior is fine within the intended workflow: I believe |
I would guess that most working researchers have one environment where they just install any package that seems useful. So if they had astropy 6.0 installed and then some other random package requires numpy>2, suddenly astropy is broken with no warning. I'm a bit surprised that a new ground-up package like |
scientists and data analysts are not the primary target demographic for uv, I suppose. |
cough conda. 😛 |
I'm getting whiplash from trying to decide what is best to recommend for astropy users. I had come full circle to pip, but maybe with the new kitchen-sink-included astropy conda package then conda might be best. 🤯 |
Co-authored-by: Clément Robert <cr52@protonmail.com>
This APE has been in the pipeline for a long time and was inspired by astropy/astropy#12448 - I decided to try and revive it and update it. The main goal here was to try and provide a framework for discussing/thinking about optional dependencies since there are different kinds of such dependencies.
I don't want to be too prescriptive here about what to do specifically about scipy, as I think that should be discussed in the relevant issue, and this is meant to be a more general APE.