Skip to content

MNT: Run PTH flake test in prep for supporting pathlib (utils 1/n) (⏰ wait for #16930)#16928

Closed
neutrinoceros wants to merge 1 commit intoastropy:mainfrom
neutrinoceros:utils.data/rfc/pth_checks
Closed

MNT: Run PTH flake test in prep for supporting pathlib (utils 1/n) (⏰ wait for #16930)#16928
neutrinoceros wants to merge 1 commit intoastropy:mainfrom
neutrinoceros:utils.data/rfc/pth_checks

Conversation

@neutrinoceros
Copy link
Contributor

@neutrinoceros neutrinoceros commented Sep 3, 2024

Description

Extracted from #16060
utils is a big one so I'm focusing on a single module for this PR in order to unblock #16927

blocked by

  • 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

github-actions bot commented Sep 3, 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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2024

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

Parameters
----------
localfn : str
localfn : str | Path
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a new feature? I think this one actually needs a change log.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. I need to review this thoroughly myself before I undraft, and I'll keep this in mind when I do !

@neutrinoceros
Copy link
Contributor Author

Actually I find that this only works if the rest of the utils subpackage is updated too. Luckily utils.data is still the bulk of the change. However I also find that this requires a couple small changes in astropy.table to work, so let me open a separate PR for that.

Co-authored-by: Mridul Seth <git@mriduls.com>
@neutrinoceros neutrinoceros force-pushed the utils.data/rfc/pth_checks branch from ff2d5d7 to f5020da Compare September 4, 2024 09:05
@neutrinoceros neutrinoceros changed the title MNT: Run PTH flake test in prep for supporting pathlib (utils.data) MNT: Run PTH flake test in prep for supporting pathlib (utils) Sep 4, 2024
@neutrinoceros neutrinoceros changed the title MNT: Run PTH flake test in prep for supporting pathlib (utils) MNT: Run PTH flake test in prep for supporting pathlib (utils 1/n) Sep 4, 2024
Copy link
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.

I am a little worried about changing so much low level utility code. Is ruff really that hard to please?

This one might need feedback from downstream like astroquery (@bsipocz) and HPC users (@aarchiba , @weaverba137 , etc).

if isinstance(name_or_obj, os.PathLike):
name_or_obj = os.fspath(name_or_obj)

# FIXME: this should be fixed
Copy link
Member

Choose a reason for hiding this comment

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

Can you please elaborate on what exactly should be fixed? Is there a follow-up issue?

Parameters
----------
data_name : str
data_name : str | Path
Copy link
Member

Choose a reason for hiding this comment

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

This is considered new feature, so probably needs a change log. Same comment applies to all other similar occurrences in this PR (i.e., adding Path support to public API).

os.path.join(dldir, entry.name, "url"), encoding="utf-8"
)
r[url] = os.path.abspath(os.path.join(dldir, entry.name, "contents"))
# with os.scandir(dldir) as it:
Copy link
Member

Choose a reason for hiding this comment

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

Why is this commented?

f2 = download_file(u, cache=True)
os.unlink(f2)
bf4 = os.path.dirname(f2)
# os.unlink(f2)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this commented?

@weaverba137
Copy link
Member

I'm not aware of any serious HPC issues with Path objects, but I haven't researched the topic extensively.

@neutrinoceros
Copy link
Contributor Author

This PR isn't ready for review yet.
@pllim I'm having a lot of the same questions you raised, I intend to answer them before I undraft this, but I'll prioritize fixing CI first.

@neutrinoceros neutrinoceros changed the title MNT: Run PTH flake test in prep for supporting pathlib (utils 1/n) MNT: Run PTH flake test in prep for supporting pathlib (utils 1/n) (⏰ wait for #16930) Sep 10, 2024
@pllim
Copy link
Member

pllim commented Oct 10, 2024

There are conflicts now and looks like one of the blockers still unresolved, so moving milestone.

@pllim pllim modified the milestones: v7.0.0, v7.1.0 Oct 10, 2024
@neutrinoceros
Copy link
Contributor Author

while resolving merge conflicts I realized this is full of unwarranted API changes so I think I'll just drop this PR for now.

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