Enable the use of pyproject-fmt#15365
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 |
|
I am opening this PR so that we can discuss the pros/cons of using this. |
3308bac to
4f2fc04
Compare
|
In future I'd like to only think about the contents of this file, not how it's formatted, so I'm in favor of this PR. |
4f2fc04 to
64542b5
Compare
| rev: "1.0.0" | ||
| hooks: | ||
| - id: pyproject-fmt | ||
| args: ["--indent=4"] |
There was a problem hiding this comment.
Unfortunately, I cannot figure out how to independently configure the indent setting (requested by @pllim) outside of specifying it via command line args. I have opened tox-dev/pyproject-fmt#130 for assistance with this.
| "Programming Language :: Python :: 3 :: Only", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", |
There was a problem hiding this comment.
Will this tool auto-add python3.12?
There was a problem hiding this comment.
It should according to https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
|
Maybe put this in the next dev telecon agenda? I am neutral and I am interested in what other devs think. |
mhvk
left a comment
There was a problem hiding this comment.
Somewhat mixed about it changing ordering in what seems an arbitrary fashion. I'd like the first astropy keyword to be "astronomy", not "ascii".
p.s. I find pre-commit a bit of a pain in slowing down development; this presumably is very fast if pyproject.toml is not touched?
| "tomli; python_version < '3.11'", | ||
| 'tomli; python_version < "3.11"', | ||
| ] | ||
| recommended = [ |
There was a problem hiding this comment.
Order again had (some) meaning here. That said, in this case I can see the advantage of just being alphabetical.
| [tool.ruff.pydocstyle] | ||
| convention = "numpy" | ||
|
|
||
| [tool.pytest.ini_options] |
There was a problem hiding this comment.
This I don't understand; either be alphabetical or not - why is this moved past tools.ruff? Certainly, pytest is far more important to see than ruff.
| ] | ||
| description = "Astronomy and astrophysics core library" | ||
| readme = "README.rst" | ||
| keywords = [ |
There was a problem hiding this comment.
The alphabetization has removed meaning here. astropy is not first and foremost about ascii (not sure why that was put on there, though I guess table reading...).
Interesting. What step in pre-commit is slow? |
|
The remove star is slow. |
|
On |
|
I find it a bit slow on |
|
Ping @Saransh-cpp for this discussion of speed. |
|
It is the collection. And, no, it is not that slow, it is just enough to be irritating, that's why I'm a bit wary of adding more steps. (Plus I fairly regularly clean up the repository with |
Interesting. I'm on an M2 MBPro and it's fast enough I don't notice. |
|
removestar is noticeably slow for me. |
|
We could move removestar to a cron job, or if asmeurer/removestar#51 (or similar) can speed it up... |
|
Thanks for the ping! Re pyproject-fmt: The hook was not added to scientific-python's development guide because it was not very flexible - scikit-hep/scikit-hep.github.io#214 (scikit-hep.github.io was ported to create learn.scientific-python.org/development). I've also discovered some bugs in the tool in the past, and though I planned to work on them, I never got the time :( (not completely against the hook, some of my repositories use it, some of them don't, and I really appreciate the work done on it, everything depends on how well it fits within astropy!) Re removestar's speed: I can shift it to the cron job until I profile and identify the bottleneck. This might take some time, and I am not sure when I'll start working on it 🙂 |
|
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. |
|
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. |
Description
Now that #15247 has been merged we may want to consider standardizing the formatting of our
pyproject.tomlfile. As noted in #15247 (comment) thepyproject-fmttool has been created by the tox devs in order to apply consistent formatting to to theirpyproject.tomlfiles across their various projects.This PR is applies the
pyproject-fmttool toastropyand enables its continued use via ourpre-commit.