Repository navigation
DEP: redefine dev[_all] extras as PEP 735 Dependency Groups - #18342
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
ccbdff5 to
249e0ac
Compare
| docs = [ | ||
| "astropy[docs]", | ||
| ] | ||
| # this is duplicated to avoid self-references in oldestdeps (astropy itself can't have a lower bound) |
There was a problem hiding this comment.
discovered this limitation while working on this. It'd probably be labelled as an upstream bug so I'll take my chances and report it upstream later.
|
Could you explain what the benefits are of using dependency groups here compared to extras? |
|
providing a clearer separation between
|
|
Ah I see, so would you plan to deprecate astropy[test]? |
|
This one I don't think so, but |
|
Ok cool, if we don't plan to deprecate test, maybe we should avoid redefining it since anyway for now it requires repeating everything? |
|
I'll touch base with uv folks first. It shouldn't be necessary to duplicate metadata |
|
Actually, I tried to reproduce the problem with self-referential groups + [tool.uv.sources]
astropy = { workspace = true }Now I'm thinking the problem might be with |
There was a problem hiding this comment.
I have to say I'm not really sold on using dependency groups - they are the shiny new thing, but I think here more than ever, 'if it ain't broke, don't fix it'. I don't think it really makes sense to have extras and dependency groups living in parallel, and I would oppose removing extras like test and docs. I spend a lot of my time typing e.g.:
pip install .[test]
and
pip install .[docs]
in packages including astropy core and the dependency group command looks like it will be a pain to type. This is just my opinion though, but just wanted it to be on the record 😅
|
|
||
| pip install -e .[all,test_all,docs] | ||
| pip install -U pip | ||
| pip install -e . --group test_all --group docs |
There was a problem hiding this comment.
I think that is a net negative from a developer point of view - I use pip install .[...] all the time and now there is going to be more to type
|
Any extras you would not oppose to removing ? |
|
In hindsight I agree there's not much point to have both a |
|
regarding the amount of typing required, and as a purely informative note: if you don't mind pulling in all dependencies, there's |
There were all added for a reason, so probably not, at least not without a lot of opinions involved... |
|
For dev-only extras, I'm assuming the reason was that no equally convenient way existed to define them without exposing them. In other words, I think they were probably exposed as a side effect rather than intentionally. Maybe I'm wrong about it. And even if I'm not, it could be argued that it's too late to put the genie back in the bottle, but I'm not there yet. |
Yes. |
2819a6a to
849db46
Compare
dev[_all] extras as PEP 723 Dependency Groups
|
Ok, reduced the scope of this PR to |
|
Please rebase. Thanks! |
|
I already did this very morning. Is it still needed ? |
|
Says outdated again and one job failing, so might as well? |
|
Let's try re-running first. |
|
@taldcroft , do you want to re-review? |
|
This was on today's agenda but I think we somehow forgot to go over it... |
|
Overall I don't want to stand in the way of progress. But I'll note one more thing, which is that This could be easy to miss, but even if it is spotted this will cause confusion for anyone not following this PR. ACTION: when this is merged, we need to send notice to the astropy-dev email group and astropy slack (probably |
e34fc8e to
5fce251
Compare
|
@neutrinoceros , can you please address https://github.com/astropy/astropy/pull/18342/changes#r2678530716 ? Thanks. |
5fce251 to
2a00f6e
Compare
|
Thanks for reminding me, I lost track of this PR's state so it seems. I think I've addressed any lingering comments now ! |
|
@taldcroft are you able to do a final review to ensure your remaining concern is truly addressed to your liking? Thanks, all! |
2a00f6e to
e03618e
Compare
|
@pllim @taldcroft I just rebased this to resolve merge conflicts. The diff is now mostly from the indirect changes in the resolved lowest tree, but this might bitrot more quickly as a result. |
e03618e to
24f5fc2
Compare
|
failures are unrelated, and also seen on main. I'll inquire there (probably not earlier than tomorrow though), but this can be undrafted in the mean time. |
24f5fc2 to
3f756bb
Compare
|
@astrofrog this has one approval already, and would be much better as part of a major release. Can we merge this for 8.0.0 ? |
astrofrog
left a comment
There was a problem hiding this comment.
I’m ok with this though as @taldcroft pointed out we should advertise on astropy-dev. We should also add a what's new entry for 8.0, could you add this here? (But I don't need to rereview)
3f756bb to
2f95023
Compare
|
changelog added, auto-merge enabled, and email sent. Thanks ! |
Description
This is a first stab at #17623, implementing dependency groups to eventually (but not yet) replace our dev-only extra sets of optional dependencies, and use them internally where it makes sense.
This PR is 100% backwards compatible, since it doesn't remove any
extras(which are user visible), and instead defines (user-invisible) dependency groups as mirrors.Not every extra I'm mirrorin here is intended to be fully dropped in the future (for instance, we may still want to deliberatly expose
astropy[test]as an install target), but I expect at least part of them would be uncontroversial (I don't know who needsastropy[docs]orastropy[typing]downstream).