areusch commented on a change in pull request #8382:
URL: https://github.com/apache/tvm/pull/8382#discussion_r663160299



##########
File path: .pre-commit-config.yaml
##########
@@ -0,0 +1,40 @@
+repos:
+    - repo: https://github.com/pre-commit/pre-commit-hooks
+      rev: v2.5.0
+      hooks:
+        - id: check-added-large-files
+        - id: check-merge-conflict
+        - id: check-yaml
+        - id: end-of-file-fixer
+    - repo: local
+      hooks:
+        -   id: run-file-types
+            name: Checking File Types...
+            entry: python3 tests/lint/check_file_type.py
+            language: system
+            always_run: true
+            pass_filenames: false
+        -   id: run-headers-check
+            name: Checking ASF License Headers...
+            entry: tests/lint/check_asf_header.sh --local
+            language: system
+            always_run: true
+            pass_filenames: false
+        -   id: run-black

Review comment:
       @mshawcroft after some reading, it appears that `pre-commit` will create 
a venv and effectively run `pip install <tool>=<version>`. i think this won't 
quite achieve the same thing as the docker container without specifying 
`additional_dependencies`--each of these named Python packages has dependencies 
that need to exactly match those in `ci-lint`. you could do that by 
cross-referencing `pip3 freeze` from ci-lint. [this 
blog](https://objectpartners.com/2020/06/15/consistent-python-environments-with-poetry-and-pre-commit-hooks/)
 discusses integrating `pre-commit` with a local venv, which goes a bit further 
towards this (though we are still blocked on `requirements.txt` due to CI 
container rebuild pipeline).
   
   i'm okay with committing something with limitations, just noting what they 
are, and i would prefer we document those limitations and/or a recommended 
strategy to work around those somewhere. i do think that as we address the 
`requirements.txt` shortcoming, we can most likely resolve this issue outside 
docker (python version may impact this as well).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to