mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 02:02:46 +00:00
Enhancements in precommit_install.sh for Python and CK Tile code (#2400)
* fix(precommit_install): script now installs packages in virtual env
* fix(precommit_install): installs packages in virtual env
* feat(precommit): added ruff for python linting and formatting
* feat(precommit): added ruff for python linting and formatting
* feat(precommit): run ruff when py files are commited
* feat(precommit): remod.py is run when ck_tile modified
* add empty line at the end
* style(precommit.yaml): remove empty line
---------
Co-authored-by: Max Podkorytov <4273004+tenpercent@users.noreply.github.com>
[ROCm/composable_kernel commit: e9036a8fc2]
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
run_and_check() {
|
||||
"$@"
|
||||
status=$?
|
||||
@@ -13,8 +12,12 @@ run_and_check() {
|
||||
echo "I: Installing tools required for pre-commit checks..."
|
||||
run_and_check apt install clang-format-12
|
||||
|
||||
echo "I: Installing pre-commit itself..."
|
||||
run_and_check pip3 install pre-commit
|
||||
echo "I: Creating and activating virtual environment for pre-commit..."
|
||||
python3 -m venv "$(dirname "$0")/../.venv"
|
||||
source "$(dirname "$0")/../.venv/bin/activate"
|
||||
|
||||
echo "I: Installing pre-commit in virtual environment..."
|
||||
run_and_check pip install pre-commit
|
||||
run_and_check pre-commit install
|
||||
|
||||
echo "I: Installation successful."
|
||||
|
||||
Reference in New Issue
Block a user