-
-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to pyproject.toml + cleanup #1158
Conversation
A fix for the failing docs - readthedocs/readthedocs.org#3322 (comment) |
Ideally, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting this discussion, @Saransh-cpp. I'm 👍 for use of pre-commit.ci and the readthedocs failure will need fixing in the RTD settings so the single test failure can be safely ignored for the moment.
I have tried to perform a 1:1 port. No extra information was added and all the existing metadata has been moved to pyproject.toml.
Thanks, this is a great way to keep the PR reviewable. There's one minor change from my side, but otherwise generally approve of moderization. 😄
Do any other @zarr-developers/python-core-devs have opinions here?
Thanks for the quick review, @joshmoore! Should I go ahead and remove the |
Yes, please, so that anyone who is reviewing will also be aware of the change. |
TODO for maintainers -
|
This pull request fixes 6 alerts when merging 26a1e75 into 6ef11d3 - view on LGTM.com fixed alerts:
|
Thanks for the quick review, @jakirkham!
Unfortunately, tomli cannot parse blocks like -
Hence, anything the metadata written in between |
This pull request fixes 6 alerts when merging 653f20a into f9581cb - view on LGTM.com fixed alerts:
|
ci: | ||
autoupdate_commit_msg: "chore: update pre-commit hooks" | ||
autofix_commit_msg: "style: pre-commit fixes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will these perform the style fixes for us after pushing a PR? If so, that's great 😄
Though we probably want to document this behavior somewhere so users know about this. Maybe in the contributor guide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! But the maintainers should install the precommit.ci
app (https://github.com/marketplace/pre-commit-ci) for Zarr's GH repository.
I'll document it in the contributor guide.
Co-authored-by: jakirkham <jakirkham@gmail.com>
Co-authored-by: jakirkham <jakirkham@gmail.com>
This pull request fixes 6 alerts when merging 45cd3dc into 2c52b17 - view on LGTM.com fixed alerts:
|
8 Likes and no objections -- https://twitter.com/zarr_dev/status/1579838254379339776 Let's do it! |
The LGTM.com analysis can be removed now that GitHub code scanning has been added: |
Why remove section Is it OK to put it back in |
Zarr now uses codespell as a pre-commit hook 😉 which means that the spell check is automated and should be performed using See - zarr-python/.pre-commit-config.yaml Lines 17 to 21 in 4362bb4
|
I see. You could maintain codespell options in At some point, I expect a false positive to be introduced in new code. I feel that being able to run codespell directly, with the same options, will help understand and fix the problem. |
Seems if the options can be in pyproject.toml rather than .pre-commit-config.yaml that's optimal.
@DimitriPapadopoulos: just to be clear, I'll remove the app, yeah? |
See #1191. |
Yes, but I need to fix a few issues I have with codespell first, to be able to test with the latest version 2.2.2, which supports |
IMO it would be better to keep the configuration of all the
to run codespell on all files. |
The point is that codespell is not necessarily run from pre-commit. I mean, that's your point of view, but my point of view is that it should be possible to run codespell from the command line as usual. |
@Saransh-cpp: I'd guess I'd counter with how much can be inside the pyproject.toml? :) @DimitriPapadopoulos has really been leading the lint-ification and so if we can keep the "running without pre-commit" use case, that'd be great. |
Yes, running it without pre-commit sounds good too! Any path that would make the process smoother! |
Would be good to make the same changes to Numcodecs 🙂 Filed as issue ( zarr-developers/numcodecs#364 ) |
Also, I do not have much experience with
I am probably doing something stupid here. |
Do you have Python 3.9 installed? |
No, I work with Python 3.10. |
That'll be why it's failing - we should probably loosen the |
Yes, having to install Python 3.9 just to run codespell is really too complex. This seems to be a default version suggestion, isn't it possible to override it? zarr-python/.pre-commit-config.yaml Lines 5 to 6 in 4362bb4
As a side note, |
Yep, just change it to |
This was changed to |
Done in PR ( #1191 ) |
seealso: #1209 |
pyproject.toml
.setup.py
and switch topyproject.toml
setup.cfg
until it is a necessity - Eventually deprecatesetup.cfg
with automatic conversion topyproject.toml
pypa/setuptools#3214setuptools
as a frontend (python setup.py install
) - this is not maintained (confirmed bysetuptools
developers, but I cannot find the exact issue number at this moment)pre-commit
workflowI have tried to perform a 1:1 port. No extra information was added and all the existing metadata has been moved to
pyproject.toml
.TODO: