ENH: Use pixi to install pre-commit, python for pre-commit#5032
ENH: Use pixi to install pre-commit, python for pre-commit#5032hjmjohnson merged 2 commits intoInsightSoftwareConsortium:masterfrom
Conversation
|
This also makes it easy to run the pre-commit hooks on demand on all files via: |
c05a571 to
7913f9f
Compare
|
Tested locally on Mac, Linux, and Windows. |
|
Does that happen for you? If so, can you add these changes as a new commit? |
jhlegarreta
left a comment
There was a problem hiding this comment.
Have not tried, but I trust the change. Thanks @thewtex 💯.
On Windows, Python is not available by default. The SetupForDevelopment.sh script does not complete successfully in a default build on Windows. This uses pixi to install pre-commit, python for pre-commit, so the contribution experience works out-of-the-box for experienced and new contributors to ITK. This also improves the isolation and maintainability of pre-commit tooling. Everything needed for a commit is local to the ITK repository. We also get more reproducible versions of Python and pre-commit via pixi's configuration in pyproject.toml and pixi.lock. pixi is a self-contained, single-file, cross-platform Rust binary. A local version is installed to .git/hooks/pixi/bin/pixi. Pixi's python and pre-commit is installed to .pixi/. The installation of tools is: SetupForDevelopment.sh -> curl -> pixi -> python, pre-commit -> pre-commit's hook dependencies This also makes it easy to run the pre-commit hooks on demand on all files via: ``` pixi run pre-commit-run ```
@dzenanz thanks for testing. Yes -- I will add the commit to this branch. |
Generated via: pixi run pre-commit-run
7913f9f to
c201332
Compare
|
There seems to be some unforeseen side-effects of pre-commit hooks. Linting now fails for remote modules with message |
|
Likely the action needs to be updated, may be something like this: https://github.com/InsightSoftwareConsortium/ITKClangFormatLinterAction/pull/3/files but with the correct version. |
On Windows, Python is not available by default. The SetupForDevelopment.sh script does not complete successfully in a default build on Windows.
This uses pixi to install pre-commit, python for pre-commit, so the contribution experience works out-of-the-box for experienced and new contributors to ITK.
This also improves the isolation and maintainability of pre-commit tooling. Everything needed for a commit is local to the ITK repository. We also get more reproducible versions of Python and pre-commit via pixi's configuration in pyproject.toml and pixi.lock.
pixi is a self-contained, single-file, cross-platform Rust binary. A local version is installed to .git/hooks/pixi/bin/pixi. Pixi's python and pre-commit is installed to .pixi/.
The installation of tools is:
SetupForDevelopment.sh -> curl -> pixi -> python, pre-commit -> pre-commit's hook dependencies
This is to help get @N-Dekker going again and make the contribution process easier for new contributors.