Move pre-commit in dev for automatic install#1366
Move pre-commit in dev for automatic install#1366esoteric-ephemera merged 3 commits intomaterialsproject:mainfrom
Conversation
|
@thomasloux Thank you. I am not a pre-commit expert. Is the version update stricly required? |
|
No, it just updated by running |
|
I see. Thanks. I think we can keep the old version. Could you check the documentation for the pre-commit installation and update this one? |
|
What do you want me to change regarding pre-commit? There is nothing about pre-commit in the docs as far as I know: https://materialsproject.github.io/atomate2/about/contributing.html |
|
It is here: https://materialsproject.github.io/atomate2/dev/dev_install.html Can you add the uv options and check if all pip ones are updated? That would be great! |
|
Just noting: we don't use Not sure this needs to be modified |
|
This does not need to be updated. I was mainly suggesting an alternative configuration that I find more convenient. This is independent of the CI workflow. |
|
@esoteric-ephemera in CI you can also replace 'pip install .[extra1, extra2]' with 'uv sync --extra extra1 --extra extra2' if you have uv installed and want to only use uv and drop pip. |
7676e83 to
7569834
Compare
|
Thanks! We should probably make a decision regarding using |
|
@esoteric-ephemera I think this would be great! Also, adding this to our documentation would be good |
Summary
In current installation, you need to run
uv sync --extra devto use pre-commit. I've just installed it usinguv add --dev pre-commitso that this dev group is automatically installed when running uv sync.Checklist
Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request
title.
Before a pull request can be merged, the following items must be checked:
The easiest way to handle this is to run the following in the correct sequence on
your local machine. Start with running
ruffandruff formaton your new code. This willautomatically reformat your code to PEP8 conventions and fix many linting issues.
Run ruff on your code.
type check your code.
Note that the CI system will run all the above checks. But it will be much more
efficient if you already fix most errors prior to submitting the PR. It is highly
recommended that you use the pre-commit hook provided in the repository. Simply run
pre-commit installand a check will be run prior to allowing commits.