Revert "CI: pylint to ruff (#29276)" (#29284)

This reverts commit ffad7279cbad3c4f2ea786287b4624d3a3aa18d7.
old-commit-hash: a91764954b
beeps
Justin Newberry 2 years ago committed by GitHub
parent c1bcb53d4e
commit ff96892511
  1. 28
      .pre-commit-config.yaml
  2. 4
      poetry.lock
  3. 10
      pyproject.toml
  4. 7
      selfdrive/debug/dump.py
  5. 2
      selfdrive/modeld/runners/onnx_runner.py
  6. 3
      selfdrive/modeld/thneed/lib.py

@ -34,11 +34,31 @@ repos:
types: [python]
args: ['--explicit-package-bases']
exclude: '^(third_party/)|(cereal/)|(opendbc/)|(panda/)|(laika/)|(laika_repo/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(xx/)'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.282
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: ruff
exclude: '^(third_party/)|(cereal/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(tools/)|(selfdrive/modeld/thneed/debug/)|(selfdrive/modeld/test/)|(selfdrive/camerad/test/)|(installer/)|(tinygrad_repo/)'
- id: flake8
exclude: '^(third_party/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(opendbc/)|(laika_repo/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(selfdrive/debug/)/'
additional_dependencies: ['flake8-no-implicit-concat']
args:
- --indent-size=2
- --enable-extensions=NIC
- --select=F,E112,E113,E304,E502,E701,E702,E703,E71,E72,E731,W191,W6
- --statistics
- -j4
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
exclude: '^(third_party/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)'
args:
- -j0
- -rn
- -sn
- --rcfile=.pylintrc
- repo: local
hooks:
- id: cppcheck

4
poetry.lock generated

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:36187dd8afc0afe0abdb6976b5d31bb07294ec91c96022b426e86a0484216d8e
size 792009
oid sha256:4bdf2a7ffee6dd09d6532b7e2a2cd5d6af889658cfbbe0d02deac92e14be33e9
size 809997

@ -19,6 +19,7 @@ cffi = "*"
crcmod = "*"
cryptography = "*"
Cython = "*"
flake8 = "*"
Flask = "*"
future-fstrings = "*" # for acados
gunicorn = "*"
@ -91,6 +92,7 @@ pprofile = "*"
pre-commit = "*"
pycurl = "*"
pygame = "*"
pylint = "*"
pyprof2calltree = "*"
pytest = "*"
pytest-xdist = "*"
@ -159,7 +161,6 @@ PyMySQL = "~0.9"
pyproj = "*"
python-logstash = "*"
redis = "*"
ruff = "*"
s2sphere = "*"
scikit-image = "*"
scikit-learn = "*"
@ -185,10 +186,3 @@ opencv-python-headless = { url = "https://github.com/commaai/opencv-python-build
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
[tool.ruff]
select = ["E", "F", "W"]
ignore = ["W292", "E741"]
line-length = 2500
target-version="py311"

@ -3,15 +3,14 @@ import os
import sys
import argparse
import json
from hexdump import hexdump
import codecs
import cereal.messaging as messaging
codecs.register_error("strict", codecs.backslashreplace_errors)
from hexdump import hexdump
from cereal import log
import cereal.messaging as messaging
from cereal.services import service_list
codecs.register_error("strict", codecs.backslashreplace_errors)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Dump communication sockets. See cereal/services.py for a complete list of available sockets.')

@ -8,7 +8,7 @@ from typing import Tuple, Dict, Union, Any
os.environ["OMP_NUM_THREADS"] = "4"
os.environ["OMP_WAIT_POLICY"] = "PASSIVE"
import onnxruntime as ort # noqa: E402
import onnxruntime as ort # pylint: disable=import-error
ORT_TYPES_TO_NP_TYPES = {'tensor(float16)': np.float16, 'tensor(float)': np.float32, 'tensor(uint8)': np.uint8}

@ -1,5 +1,4 @@
import struct
import json
import struct, json
def load_thneed(fn):
with open(fn, "rb") as f:

Loading…
Cancel
Save