Skip to content

cosmo: properly annotate method overrides - #18802

Closed
nstarman wants to merge 2 commits into
astropy:mainfrom
nstarman:cosmo/typing/override
Closed

nstarman wants to merge 2 commits into
astropy:mainfrom
nstarman:cosmo/typing/override

Conversation

@nstarman

Copy link
Copy Markdown
Member

Requires #18360

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

@github-actions

Copy link
Copy Markdown
Contributor

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.

@nstarman nstarman changed the title Cosmo/typing/override cosmo: properly annotate method overrides Oct 30, 2025
@nstarman nstarman moved this from Triage to In Progress in Cosmology, the Expansion Oct 30, 2025
@astropy astropy deleted a comment from github-actions Bot Nov 11, 2025
@nstarman
nstarman requested a review from eerovaher November 14, 2025 22:23
@nstarman

Copy link
Copy Markdown
Member Author

@eerovaher, this relates to #18360. Do you think I should merge this PR into that one, as part of the conversation around having typing_extensions ?

@nstarman
nstarman force-pushed the cosmo/typing/override branch from 0325a6d to b27efb7 Compare November 16, 2025 17:48
@eerovaher

Copy link
Copy Markdown
Member

typing.override is in the standard library starting from Python 3.12, so if we drop support for Python 3.11 then we will not need typing_extensions for this feature.

@nstarman

Copy link
Copy Markdown
Member Author

So if we're not dropping 3.11 for a year you'd be in favour of adding typing_extensions ?

@eerovaher

Copy link
Copy Markdown
Member

I have no intention of waiting a year before dropping support for Python 3.11. With typing_extensions we can use some of the later typing features in Python 3.11, but PEP 695 – Type Parameter Syntax cannot be provided by a library.

@nstarman

Copy link
Copy Markdown
Member Author

It very well might be a while before py3.11 is dropped. If we remain compatible with numpy for 1 year past its SPEC0 dates then...

Regardless, typing_extensions is required right now, for this PR. If we get to remove it as a dependency by the time Astropy v8 is released, no harm no foul? If it turns out we need it, then we need it. It's all a question of our threshold for adding dependencies. Like packaging, for nearly-core-Python batteries-included packages, that threshold is low.

@eerovaher

Copy link
Copy Markdown
Member

It very well might be a while before py3.11 is dropped.

That's defeatist.

@nstarman

nstarman commented Nov 18, 2025 •

Copy link
Copy Markdown
Member Author

That's pragmatic and optimistic. It's finding solutions given current constraints while ensuring that those solutions don't prevent more optimal solutions when constraints are removed.

  1. ✅ Finding a solution given constraints: we don't have py3.12+ but with typing_extensions we can easily accomplish our goals of improved type annotations.
  2. ✅ ensuring that those solutions don't prevent the optimal solutions. typing_extensions -> typing couldn't be more trivial, when we do transition to py3.12+. Moreover, build(deps): typing-extensions as a dependency #18360 can be accomplished concurrently with efforts to drop py3.11. ruff UP035 seamlessly handles any transition, including bug-fix backports.

@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label Apr 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then.

In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary.

If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock.

If you believe I commented on this pull request incorrectly, please report this here.

@astrofrog astrofrog modified the milestones: v8.0.0, v8.1.0 May 5, 2026
@github-actions github-actions Bot added the closed-by-bot Closed by stale bot label May 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

I'm going to close this pull request as per my previous message. If you think what is being added/fixed here is still important, please remember to open an issue to keep track of it. Thanks!

If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here.

@github-actions github-actions Bot closed this May 18, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Cosmology, the Expansion May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Close? Tell stale bot that this issue/PR is stale closed-by-bot Closed by stale bot cosmology installation no-changelog-entry-needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants