Parcourir la source

clear instructions on formatting with yapf, remove linting

Alex Cheema il y a 6 mois
Parent
commit
f82410f808
3 fichiers modifiés avec 16 ajouts et 5 suppressions
  1. 14 0
      README.md
  2. 1 1
      format.py
  3. 1 4
      setup.py

+ 14 - 0
README.md

@@ -222,6 +222,20 @@ For the **tinygrad** inference engine specifically, there is a separate DEBUG fl
 TINYGRAD_DEBUG=2 exo
 TINYGRAD_DEBUG=2 exo
 ```
 ```
 
 
+## Formatting
+
+We use [yapf](https://github.com/google/yapf) to format the code. To format the code, first install the formatting requirements:
+
+```sh
+pip3 install -e '.[formatting]'
+```
+
+Then run the formatting script:
+
+```sh
+python3 format.py ./exo
+```
+
 ## Known Issues
 ## Known Issues
 
 
 - On some versions of MacOS/Python, certificates are not installed properly which can lead to SSL errors (e.g. SSL error with huggingface.co). To fix this, run the Install Certificates command, usually:
 - On some versions of MacOS/Python, certificates are not installed properly which can lead to SSL errors (e.g. SSL error with huggingface.co). To fix this, run the Install Certificates command, usually:

+ 1 - 1
format.py

@@ -21,7 +21,7 @@ def run_yapf(target):
 
 
 def main():
 def main():
   if len(sys.argv) < 2:
   if len(sys.argv) < 2:
-    print("Usage: python format.py <directory_or_file>")
+    print("Usage: python3 format.py <directory_or_file> e.g. python3 format.py ./exo")
     sys.exit(1)
     sys.exit(1)
 
 
   target = sys.argv[1]
   target = sys.argv[1]

+ 1 - 4
setup.py

@@ -30,10 +30,7 @@ install_requires = [
 ]
 ]
 
 
 extras_require = {
 extras_require = {
-  "linting": [
-    "pylint==3.2.6",
-    "ruff==0.5.5",
-    "mypy==1.11.0",
+  "formatting": [
     "yapf==0.40.2",
     "yapf==0.40.2",
   ],
   ],
   "apple_silicon": [
   "apple_silicon": [