Conversation
8882fad to
7ed7283
Compare
| "types-pyyaml~=6.0", | ||
| ] | ||
|
|
||
| [dependency-groups] |
There was a problem hiding this comment.
This makes development with uv easier since uv installs dev dependency group by default.
So e.g. one can run uv run pytest straight after cloning a repo and it will work.
For a general info about the (new) concept of "dependency groups" see PEP-735.
In principle this should obviate the need for the dev extras. The only disadvantage is that the dependency group is a very new thing and would not work with older pip (or other installation managers) versions.
(feel free to split this comment into a separate commit :-) )
There was a problem hiding this comment.
Haha, well, if you insist! 😉
Thanks for the note on "dependency groups"! Always good to read a PEP in the morning.
7ed7283 to
0b0f449
Compare
The `py` dependency was using in the (currently disabled) `CondaProject` implementation. Since we'll most likely not rely on this package when we reintroduce support for `conda`, we can remove it from the dependencies list. Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Add a `dev` dependency group, see PEP735 for more information on the concept: https://peps.python.org/pep-0735/ Besides the advantages described in PEP735, adding a `dev` dependency group makes development with `uv` easier since `uv` installs the `dev` dependency group by default. Now one can run `uv run pytest` straight after cloning a repo and it will work. In the future this will the remove the need for the `dev` extras. However, dependency groups are very new, and only supported from `pip` v25.1 via the `--group` option: pip install -e. --group dev Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
d299f23 to
c6fffd3
Compare
mbercx
left a comment
There was a problem hiding this comment.
Thanks a million @danielhollas! I'm not going to bike shed about which rules we select, since we apparently were selecting none before (see my comment 🙈).
I reorganized the commits as you suggested, and left one suggestion for cleaning up the .pre-commit-config.yaml some more. I'd also squash all pre-commit related changes into one commit, if that's ok?
| @@ -18,26 +18,12 @@ repos: | |||
| - id: end-of-file-fixer | |||
| - id: trailing-whitespace | |||
There was a problem hiding this comment.
Do we still need these old hooks when we switch to Ruff? I think we can also remove the exclude above.
There was a problem hiding this comment.
These are still useful for non-python files, but it's up to you if that is worth it.
There was a problem hiding this comment.
Ahh, I missed the indent. Let's leave them for now, I'll experiment with it later 👍
| 'PLC0415', # `import` should be at the top-level of a file | ||
| ] | ||
|
|
||
| select = [ |
There was a problem hiding this comment.
Heh, I actually didn't know you had to select rules, since I'm used to using Ruff through hatch, which automatically selects a bunch of rules in its default settings.
Sure, go for it! |
Remove hooks in the `.pre-commit-config.yaml` that can be effectively replaced by Ruff (`pyupgrade`, `isort`, `black`). The Ruff rules `select`/`ignore` is copied from `aiida-core`. Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
c6fffd3 to
57c21d6
Compare
|
Commit OCD satisfied! Have a final look, @danielhollas, and I'll approve and merge once you give a 👍 |
Looks very nice, thanks! |
pydependency (used only in disabled conda support, and also is deprecated)New version of #31