Skip to content

BLD/RFC: simplify path type casting in wcs/setup_package.py - #17193

Merged
pllim merged 1 commit into
astropy:mainfrom
neutrinoceros:wcs/bld/bump_extension_helpers
Sep 11, 2026
Merged

pllim merged 1 commit into
astropy:mainfrom
neutrinoceros:wcs/bld/bump_extension_helpers

Conversation

@neutrinoceros

@neutrinoceros neutrinoceros commented Oct 16, 2024 •

Copy link
Copy Markdown
Contributor

Description

Extracted from and a continuation of #16936, cleaning up path type casting that becomes redundant with extension-helpers 1.2.0
This will require extension-helpers 1.2.0 or newer to become available on exotic archs.

update: Here's a dynamic view of extension-helpers packaging status
Packaging status

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

@github-actions

Copy link
Copy Markdown
Contributor

👋 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?

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me. Why does this need the extension helpers update, though?

get_wcslib_cfg(cfg, wcslib_files, wcslib_config_paths)

cfg["include_dirs"].append(join(WCSROOT, "include"))
cfg["include_dirs"].append(WCSROOT / "include")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this have a str(...) too, like the others?

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.

ah, yes. I got things mixed up here, but passing Paths directly to setuptools requires another upgrade that we cannot afford yet because it's not available on exotic archs.
Anyway, thanks for catching this !

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, that leaves me still confused what part actually is solved by upgrading extension helpers.

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.

it should be clearer if you look just at the second commit
8b4fc9f (#17193)

Comment thread astropy/wcs/wcs.py Outdated
if isinstance(header, (str, bytes, os.PathLike)):
try:
is_path = os.path.exists(header)
is_path = os.path.exists(header) # noqa: PTH110

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can one not replace with Path(header).exists()?

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.

that would be a comment for #16936, but yes, we could avoid a noqa here

@neutrinoceros neutrinoceros changed the title BLD: require extension-helpers 1.2.0 and simplify path type casting BLD: require extension-helpers 1.2.0 and simplify path type casting (⏰ wait for #16936) Oct 17, 2024
@neutrinoceros

Copy link
Copy Markdown
Contributor Author

Why does this need the extension helpers update, though?

See #16936 (comment) : extension-helpers 1.2.0 improves native support for Path objects.
This PR shouldn't be reviewed for the time being: only the last commit is relevant.

@mhvk

mhvk commented Oct 17, 2024

Copy link
Copy Markdown
Contributor

OK, so then all the str(path) in setup_package can go too?

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

No. The remaining ones are needed for compatibility with setuptools<72, which we still need to support building on "exotic archs".

@github-actions github-actions Bot added the Close? Tell stale bot that this issue/PR is stale label Mar 16, 2025
@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.

@neutrinoceros neutrinoceros added keep-open and removed Close? Tell stale bot that this issue/PR is stale labels Mar 17, 2025
@astrofrog astrofrog modified the milestones: v7.1.0, v7.2.0 Apr 28, 2025
@astrofrog astrofrog modified the milestones: v7.2.0, v8.0.0 Nov 3, 2025
@astrofrog astrofrog modified the milestones: v8.0.0, v8.1.0 May 5, 2026
@astrofrog

astrofrog commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

@neutrinoceros - would it make sense to try and wrap this up? It should be uncontroversial I imagine?

@neutrinoceros

Copy link
Copy Markdown
Contributor Author

Oh yes. Thanks for reminding me

@neutrinoceros neutrinoceros changed the title BLD: require extension-helpers 1.2.0 and simplify path type casting (⏰ wait for #16936) BLD: require extension-helpers 1.2.0 and simplify path type casting Sep 11, 2026
@neutrinoceros
neutrinoceros force-pushed the wcs/bld/bump_extension_helpers branch from 8b4fc9f to 7122049 Compare September 11, 2026 13:54
@neutrinoceros neutrinoceros changed the title BLD: require extension-helpers 1.2.0 and simplify path type casting BLD/RFC: simplify path type casting in wcs/setup_package.py Sep 11, 2026
@neutrinoceros
neutrinoceros force-pushed the wcs/bld/bump_extension_helpers branch 2 times, most recently from 11570bd to bb0fc20 Compare September 11, 2026 13:59
@neutrinoceros
neutrinoceros force-pushed the wcs/bld/bump_extension_helpers branch from bb0fc20 to d050ad3 Compare September 11, 2026 14:09
@neutrinoceros
neutrinoceros marked this pull request as ready for review September 11, 2026 14:45
@neutrinoceros

neutrinoceros commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

One unrelated failure on extra CI. Addressed in #20373

@pllim
pllim merged commit 987c678 into astropy:main Sep 11, 2026
43 of 45 checks passed
@pllim pllim removed the keep-open label Sep 11, 2026
@neutrinoceros
neutrinoceros deleted the wcs/bld/bump_extension_helpers branch September 11, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants