Skip to content

BLD: require extension-helpers 1.2.0 and simplify path type casting (⏰ wait for #16936)#17193

Draft
neutrinoceros wants to merge 2 commits intoastropy:mainfrom
neutrinoceros:wcs/bld/bump_extension_helpers
Draft

BLD: require extension-helpers 1.2.0 and simplify path type casting (⏰ wait for #16936)#17193
neutrinoceros wants to merge 2 commits intoastropy:mainfrom
neutrinoceros:wcs/bld/bump_extension_helpers

Conversation

@neutrinoceros
Copy link
Contributor

@neutrinoceros neutrinoceros commented Oct 16, 2024

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

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.

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
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
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
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
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)

if isinstance(header, (str, bytes, os.PathLike)):
try:
is_path = os.path.exists(header)
is_path = os.path.exists(header) # noqa: PTH110
Copy link
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
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
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
Copy link
Contributor

mhvk commented Oct 17, 2024

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

@neutrinoceros
Copy link
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
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
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.

3 participants