Skip to content

TST/DEP: add missing env resolution constraints to make oldestdeps platform-portable#18693

Merged
pllim merged 3 commits intoastropy:mainfrom
neutrinoceros:tst/dep/portable-oldestdeps
Oct 22, 2025
Merged

TST/DEP: add missing env resolution constraints to make oldestdeps platform-portable#18693
pllim merged 3 commits intoastropy:mainfrom
neutrinoceros:tst/dep/portable-oldestdeps

Conversation

@neutrinoceros
Copy link
Copy Markdown
Contributor

Description

Since #16963, uv has been used internally to dynamically resolve oldestdeps envs. However, without additional constraints, this solution doesn't necessarily port well across platforms (Linux, where we actually test this config, is on a happy path). Here I'm trying to improve the situation to allow oldestdeps tests to run on any platform by:

  • mandating binary installs for certain key packages (first and foremost, numpy, scipy ...)
  • adding missing lower bounds on a couple direct dependencies
  • adding constraints to the resolver to avoid building old versions of pure Python packages that didn't have a wheel

Note that this last point is intended as temporary: I'll move said constraints to proper requirements whenever they affect direct dependencies, once this is stable.
I'm opening as a draft and skipping CI mostly to save this branch somewhere I won't forget it, but I note that, at the time of opening (uv 0.9.0 was just released), there appears to be a bug in uv that breaks resolving the full env on my machine, that I need to report upstream.

  • 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.

@neutrinoceros neutrinoceros added Upstream Action Required Was: Upstream Fix Required testing Experimental no-changelog-entry-needed dependencies Pull requests that update a dependency file labels Oct 8, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 8, 2025

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 8, 2025

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@neutrinoceros
Copy link
Copy Markdown
Contributor Author

upstream ticket at astral-sh/uv#16186

@neutrinoceros neutrinoceros changed the title TST/DEP: add missing env resolution constraints to make oldestdeps platform-portable [ci skip] TST/DEP: add missing env resolution constraints to make oldestdeps platform-portable Oct 8, 2025
@neutrinoceros neutrinoceros force-pushed the tst/dep/portable-oldestdeps branch from a063597 to 7b750f0 Compare October 8, 2025 13:24
@neutrinoceros neutrinoceros removed the Upstream Action Required Was: Upstream Fix Required label Oct 8, 2025
@neutrinoceros neutrinoceros force-pushed the tst/dep/portable-oldestdeps branch from 7b750f0 to 07cb5bc Compare October 8, 2025 13:52
@neutrinoceros neutrinoceros added this to the v7.2.0 milestone Oct 8, 2025
@neutrinoceros
Copy link
Copy Markdown
Contributor Author

oldestdeps is currently choking on a deprecation warning from setuptools:

UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.

I don't know yet how to best resolve this.

  • adding a inconditional constraint is overkill and would prevent discovering actual runtime incompatibilities
  • filtering this warning will not solve the incoming breakage

conceptually, what we'd need is a constraint that only affects --resolution=lowest[-direct] cases. Will think a bit more about it.

@neutrinoceros

This comment was marked as outdated.

@neutrinoceros neutrinoceros force-pushed the tst/dep/portable-oldestdeps branch 3 times, most recently from f603cc2 to 5eeda75 Compare October 8, 2025 16:50
@neutrinoceros
Copy link
Copy Markdown
Contributor Author

This is stable now. Opening for review !

@neutrinoceros neutrinoceros marked this pull request as ready for review October 8, 2025 17:05
pyproject.toml Outdated
"pytest>=8.0.0",
"sphinx-changelog>=1.2.0",
"sphinx_design",
"sphinx-design>=0.6.1",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh why? Official name has underscore https://pypi.org/project/sphinx_design/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note: 0.6.1 is the latest release; released on 2024-08-02 . For doc build, this is fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hyphens are normalized to underscores by pip and uv (and supposedly everyone else), I merely changed it for style consistency. The important bit is that I added a lower bound so that uv wouldn't warn about it being unbound when resolving for oldestdeps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer the name be in sync with official PyPI name, can we revert back to underscore? thanks.

Copy link
Copy Markdown
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

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

Someone more familiar with uv/tox should review. At a glance, the versions seem fine.

pyproject.toml Outdated
"sortedcontainers>=1.5.7", # (older versions may work)
"pytz>=2016.10", # (older versions may work)
"jplephem>=2.15",
"jplephem>=2.17.0", # first version with a wheel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Released 2021-12-31

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

these comments make me wonder where the majority really stands. I initially proposed to add inline comments to this effect in #16960 , but this part was rejected

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those dates just for my own notes. I am okay with them staying as PR comments. FWIW

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should try to follow SPEC 0, so when required dependency versions are being updated then providing a link to something like the project release history on PyPI is very helpful for reviewers. But once the reviewers have verified that updating a version is not problematic then those links have served their purpose. Therefore, the appropriate place for the links are comments in the PR, not pyproject.toml.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

pyproject.toml Outdated
# Install all remaining dependencies
"objgraph>=1.6.0",
"skyfield>=1.20",
"objgraph>=3.1.2", # first version with a py3 wheel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Released 2017-11-27

pyproject.toml Outdated
"objgraph>=1.6.0",
"skyfield>=1.20",
"objgraph>=3.1.2", # first version with a py3 wheel
"skyfield>=1.42.0", # first version with a wheel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Released 2022-02-06

pyproject.toml Outdated
"pytest>=8.0.0",
"sphinx-changelog>=1.2.0",
"sphinx_design",
"sphinx-design>=0.6.1",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note: 0.6.1 is the latest release; released on 2024-08-02 . For doc build, this is fine.

pyproject.toml Outdated
# constrain acceptable versions of some known-problematic, indirect dependencies
constraint-dependencies = [
"pyparsing<3.3.0a1", # https://github.com/astropy/astropy/issues/18652
"asdf>=2.12.0", # first version without a runtime dependency on setuptools
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Released 2022-06-06

pyproject.toml Outdated
constraint-dependencies = [
"pyparsing<3.3.0a1", # https://github.com/astropy/astropy/issues/18652
"asdf>=2.12.0", # first version without a runtime dependency on setuptools
"asdf-coordinates-schemas>=0.2.0", # first version with a wheel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Released 2023-03-21.

@pllim pllim added Build all wheels Run all the wheel builds rather than just a selection Extra CI Run cron CI as part of PR labels Oct 8, 2025
@pllim
Copy link
Copy Markdown
Member

pllim commented Oct 8, 2025

Hmm 3.13t cannot find pyerfa wheel

@neutrinoceros
Copy link
Copy Markdown
Contributor Author

Hmm 3.13t cannot find pyerfa wheel

thanks for pointing it out, I missed this bit.
The explanation is quite simple: that wheel doesn't exist. We've been relying on pyerfa supporting building from source for this config, so I'm relaxing my constraint for it, which should be sufficient.

Another note is that this PR will immediately (but trivially) conflict with #18697, which I recommend go in first.

@pllim
Copy link
Copy Markdown
Member

pllim commented Oct 9, 2025

I merged #18697 . Please rebase when GH is back up. Thanks!

@neutrinoceros neutrinoceros force-pushed the tst/dep/portable-oldestdeps branch from 5714328 to f8bd163 Compare October 22, 2025 09:56
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
Copy link
Copy Markdown
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

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

Thanks!

@pllim
Copy link
Copy Markdown
Member

pllim commented Oct 22, 2025

Remote data and linkcheck failures are unrelated

Copy link
Copy Markdown
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

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

This seems ok to me, I'm not sure we need comments like # first version with a wheel in pyproject.toml since once this PR is merged I'm not sure we'll care anymore why that was the min version? As long as it's not a super recent version, seems reasonable to bump from time to time.

as requested by astrofrog [ci skip]
@neutrinoceros
Copy link
Copy Markdown
Contributor Author

of course. I except these comments to go away when versions are bumped. They are certainly not meant to forbid said bumps !

@pllim
Copy link
Copy Markdown
Member

pllim commented Oct 22, 2025

I removed the comments as Tom R requested. No point rerunning CI. Merging. Thanks, all!

@pllim pllim merged commit 9ba9bce into astropy:main Oct 22, 2025
1 of 2 checks passed
@neutrinoceros neutrinoceros deleted the tst/dep/portable-oldestdeps branch October 22, 2025 15:53
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 dependencies Pull requests that update a dependency file Extra CI Run cron CI as part of PR installation no-changelog-entry-needed testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants