MNT: Run PTH flake test in prep for supporting pathlib (utils 1/n) (⏰ wait for #16930)#16928
MNT: Run PTH flake test in prep for supporting pathlib (utils 1/n) (⏰ wait for #16930)#16928neutrinoceros wants to merge 1 commit intoastropy:mainfrom
Conversation
|
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.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
| Parameters | ||
| ---------- | ||
| localfn : str | ||
| localfn : str | Path |
There was a problem hiding this comment.
This looks like a new feature? I think this one actually needs a change log.
There was a problem hiding this comment.
good point. I need to review this thoroughly myself before I undraft, and I'll keep this in mind when I do !
|
Actually I find that this only works if the rest of the |
Co-authored-by: Mridul Seth <git@mriduls.com>
ff2d5d7 to
f5020da
Compare
pllim
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Can you please elaborate on what exactly should be fixed? Is there a follow-up issue?
| Parameters | ||
| ---------- | ||
| data_name : str | ||
| data_name : str | Path |
There was a problem hiding this comment.
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: |
| f2 = download_file(u, cache=True) | ||
| os.unlink(f2) | ||
| bf4 = os.path.dirname(f2) | ||
| # os.unlink(f2) |
|
I'm not aware of any serious HPC issues with Path objects, but I haven't researched the topic extensively. |
|
This PR isn't ready for review yet. |
|
There are conflicts now and looks like one of the blockers still unresolved, so moving milestone. |
|
while resolving merge conflicts I realized this is full of unwarranted API changes so I think I'll just drop this PR for now. |
Description
Extracted from #16060
utilsis a big one so I'm focusing on a single module for this PR in order to unblock #16927blocked by
Pathobjects inio.ascii.core.BaseInputter.get_lines#16930pathlib.Pathinputs iniers#16931