Skip to content
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

build: improve opt deps #16340

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nstarman
Copy link
Member

@nstarman nstarman commented Apr 25, 2024

Small improvements to the specification of optional dependencies. In particular, this improves astropy[all] to actually have everything and installs pre-commit for astropy[test] since our CI consists of 1. pre-commit checks, e.g. yaml verification, and 2. pytest-powered stuff.

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

Copy link

github-actions bot commented Apr 25, 2024

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.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@pllim pllim added Extra CI Run cron CI as part of PR Build all wheels Run all the wheel builds rather than just a selection labels Apr 25, 2024
@pllim
Copy link
Member

pllim commented Apr 25, 2024

Looks reasonable but let me run the other jobs, just in case. Thanks!

@astrofrog
Copy link
Member

astrofrog commented Apr 25, 2024

Should all actually include test_all? I think of it as meaning all runtime dependencies? Not a strong opinion though.

@pllim
Copy link
Member

pllim commented Apr 25, 2024

Good point... There is a distinction between what users need and what testers need.

@nstarman
Copy link
Member Author

As in I should reverse the relationship and have all be a subset of test_all, not test_all a subset of all ?

all = [...] # doesn't have test_all
test_all = ["astropy[all]", ...]

@pllim
Copy link
Member

pllim commented Apr 25, 2024

have all be a subset of test_all

I think this makes more sense. What do you think, @astrofrog ?

@astrofrog
Copy link
Member

Yes probably makes more sense

pyproject.toml Outdated
"astropy[recommended]", # installs the [recommended] dependencies
# Install grouped optional dependencies
"astropy[recommended]",
"astropy[docs]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_all has already been discussed, but I don't think all dependencies should contain docs dependencies either.

@nstarman
Copy link
Member Author

nstarman commented Apr 26, 2024

It would be nice to have an "absolutely everything" category, which makes getting setting up astropy dev environments super simple. I was making all into that, but it's AOK to keep that as all runtime dependencies. What do people think about a dev category that contains all dependencies -- runtime, static, docs, testing ?

@pllim @eerovaher @astrofrog

@mhvk
Copy link
Contributor

mhvk commented Apr 27, 2024

Agreed that I always thought of all as getting meaning I can now run absolutely every astropy function, not that it includes testing or building documentation. Hence, all being part of test_all makes more sense to me, just like astropy[recomended] is part of docs.

I like the idea of a dev dependency that includes all needed to start development, but slightly orthogonal here. E.g., not quite clear that needs all of astropy's optional dependencies (I guess that would be dev_all...)

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
@nstarman nstarman requested review from eerovaher and mhvk April 28, 2024 01:24
Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my one remaining comment, which mostly means another reason to leave this open for a little longer so others can comment.

But I think this little reorganization makes good sense now!

@@ -88,11 +91,8 @@ all = [
"mpmath",
"asdf-astropy>=0.3",
"bottleneck",
"ipython>=4.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, given our discussion over in #16351, perhaps we shouldn't have "hidden" dependencies - code has a dependence on whether ipython is installed in utils.console.

But possibly that is best done separately - here, what we list is the dependencies needed for all astropy functionality.

Anyway, am happy either with this as-is, or with ipython put back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#16354 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it then instead of deleting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any dependency we have should be listed exactly once, but it would indeed be better to keep ipython here and to delete the duplicate from the test_all set instead.

Comment on lines +60 to 61
"astropy[all]", # installs all optional run-time dependencies
"astropy[test]", # installs the [test] dependencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first comment is useful (because it mentiones "run-time"), the second comment is not. The useless comment isn't added by this pull request, but several analogous and equally useless comments are being introduced that should all be cleaned up.

Suggested change
"astropy[all]", # installs all optional run-time dependencies
"astropy[test]", # installs the [test] dependencies
"astropy[all]", # installs all optional run-time dependencies
"astropy[test]"

Comment on lines +108 to +114
dev = [
"astropy[recommended]", # installs the most common optional dependencies
"astropy[test]", # installs the [test] dependencies
"astropy[docs]", # installs the [docs] dependencies
"astropy[typing]", # installs the [typing] dependencies
]
dev_all = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new installation options should be (briefly) introduced somewhere in the developer documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build all wheels Run all the wheel builds rather than just a selection Extra CI Run cron CI as part of PR installation no-changelog-entry-needed
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

6 participants