mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-24 01:23:45 +08:00
@@ -56,6 +56,10 @@ repos:
|
||||
language: system
|
||||
types: [python]
|
||||
exclude: '^(pyextra/)|(cereal/)|(rednose/)|(panda/)|(laika/)|(laika_repo/)|(rednose_repo/)'
|
||||
args:
|
||||
- -rn
|
||||
- -sn
|
||||
- --rcfile=.pylintrc
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: cppcheck
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:622d406fc947cb3368849635f1da29fbeb002110bf1f9792022bffedf5cdff6d
|
||||
size 1607
|
||||
oid sha256:5fea746328dc90e4e1542a334508feda0616b2d19d7904f33a3ecfff2b1a6f79
|
||||
size 1621
|
||||
|
||||
Generated
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4e1dc8f78c5fcb90106aa180adb1091ff14c442d177bfa1ad2b5714b162b707e
|
||||
size 176374
|
||||
oid sha256:7d093d32dfcaf18972f9c62a0b87dc470ee0d74304ca8d659fc142ee0176b7c5
|
||||
size 188750
|
||||
|
||||
@@ -116,7 +116,7 @@ def with_http_server(func):
|
||||
with Timeout(2, 'HTTP Server seeding failed'):
|
||||
while True:
|
||||
try:
|
||||
requests.put(f'http://{host}:{port}/qlog.bz2', data='')
|
||||
requests.put(f'http://{host}:{port}/qlog.bz2', data='', timeout=10)
|
||||
break
|
||||
except requests.exceptions.ConnectionError:
|
||||
time.sleep(0.1)
|
||||
|
||||
@@ -135,7 +135,7 @@ class RouteEngine:
|
||||
|
||||
url = self.mapbox_host + f'/directions/v5/mapbox/driving-traffic/{self.last_position.longitude},{self.last_position.latitude};{destination.longitude},{destination.latitude}'
|
||||
try:
|
||||
resp = requests.get(url, params=params)
|
||||
resp = requests.get(url, params=params, timeout=10)
|
||||
resp.raise_for_status()
|
||||
|
||||
r = resp.json()
|
||||
|
||||
@@ -30,7 +30,7 @@ if __name__ == "__main__":
|
||||
percent_finished = int(100 - (unfinished_translations / total_translations * 100.))
|
||||
color = "green" if percent_finished == 100 else "orange" if percent_finished >= 70 else "red"
|
||||
|
||||
r = requests.get(f"https://img.shields.io/badge/LANGUAGE {name}-{percent_finished}%25 complete-{color}")
|
||||
r = requests.get(f"https://img.shields.io/badge/LANGUAGE {name}-{percent_finished}%25 complete-{color}", timeout=10)
|
||||
assert r.status_code == 200, "Error downloading badge"
|
||||
content_svg = r.content.decode("utf-8")
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class StreamingDecompressor:
|
||||
def __init__(self, url: str) -> None:
|
||||
self.buf = b""
|
||||
|
||||
self.req = requests.get(url, stream=True, headers={'Accept-Encoding': None}) # type: ignore
|
||||
self.req = requests.get(url, stream=True, headers={'Accept-Encoding': None}) # type: ignore # pylint: disable=missing-timeout
|
||||
self.it = self.req.iter_content(chunk_size=1024 * 1024)
|
||||
self.decompressor = lzma.LZMADecompressor(format=lzma.FORMAT_AUTO)
|
||||
self.eof = False
|
||||
|
||||
@@ -15,7 +15,7 @@ class TestAgnosUpdater(unittest.TestCase):
|
||||
m = json.load(f)
|
||||
|
||||
for img in m:
|
||||
r = requests.head(img['url'])
|
||||
r = requests.head(img['url'], timeout=10)
|
||||
r.raise_for_status()
|
||||
self.assertEqual(r.headers['Content-Type'], "application/x-xz")
|
||||
if not img['sparse']:
|
||||
|
||||
@@ -17,7 +17,7 @@ def get_chunk_download_size(chunk):
|
||||
if os.path.isfile(path):
|
||||
return os.path.getsize(path)
|
||||
else:
|
||||
r = requests.head(path)
|
||||
r = requests.head(path, timeout=10)
|
||||
r.raise_for_status()
|
||||
return int(r.headers['content-length'])
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ def send_thread(joystick):
|
||||
print('\n' + ', '.join(f'{name}: {round(v, 3)}' for name, v in joystick.axes_values.items()))
|
||||
if "WEB" in os.environ:
|
||||
import requests
|
||||
requests.get("http://"+os.environ["WEB"]+":5000/control/%f/%f" % tuple([joystick.axes_values[a] for a in joystick.axes_order][::-1]))
|
||||
requests.get("http://"+os.environ["WEB"]+":5000/control/%f/%f" % tuple([joystick.axes_values[a] for a in joystick.axes_order][::-1]), timeout=None)
|
||||
rk.keep_time()
|
||||
|
||||
def joystick_thread(use_keyboard):
|
||||
|
||||
@@ -21,7 +21,7 @@ class TestReaders(unittest.TestCase):
|
||||
self.assertEqual(hist['logMessage'], 6857)
|
||||
|
||||
with tempfile.NamedTemporaryFile(suffix=".bz2") as fp:
|
||||
r = requests.get("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/raw_log.bz2?raw=true")
|
||||
r = requests.get("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/raw_log.bz2?raw=true", timeout=10)
|
||||
fp.write(r.content)
|
||||
fp.flush()
|
||||
|
||||
@@ -53,7 +53,7 @@ class TestReaders(unittest.TestCase):
|
||||
assert np.all(frame_first_30[15] == frame_15[0])
|
||||
|
||||
with tempfile.NamedTemporaryFile(suffix=".hevc") as fp:
|
||||
r = requests.get("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/video.hevc?raw=true")
|
||||
r = requests.get("https://github.com/commaai/comma2k19/blob/master/Example_1/b0c9d2329ad1606b%7C2018-08-02--08-34-47/40/video.hevc?raw=true", timeout=10)
|
||||
fp.write(r.content)
|
||||
fp.flush()
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ def install():
|
||||
os.mkdir(INSTALL_DIR)
|
||||
|
||||
url = os.path.join(RELEASES_URL, m + ".tar.gz")
|
||||
with requests.get(url, stream=True) as r, tempfile.NamedTemporaryFile() as tmp:
|
||||
with requests.get(url, stream=True, timeout=10) as r, tempfile.NamedTemporaryFile() as tmp:
|
||||
r.raise_for_status()
|
||||
with open(tmp.name, 'wb') as tmpf:
|
||||
for chunk in r.iter_content(chunk_size=1024*1024):
|
||||
|
||||
@@ -18,7 +18,7 @@ segment = int(sys.argv[2])
|
||||
frame = int(sys.argv[3])
|
||||
|
||||
url = 'https://api.commadotai.com/v1/route/'+sys.argv[1]+"/files"
|
||||
r = requests.get(url, headers={"Authorization": "JWT "+jwt})
|
||||
r = requests.get(url, headers={"Authorization": "JWT "+jwt}, timeout=10)
|
||||
assert r.status_code == 200
|
||||
print("got api response")
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ if __name__ == "__main__":
|
||||
exit(1)
|
||||
|
||||
username = sys.argv[1]
|
||||
keys = requests.get(f"https://github.com/{username}.keys")
|
||||
keys = requests.get(f"https://github.com/{username}.keys", timeout=10)
|
||||
|
||||
if keys.status_code == 200:
|
||||
Params().put("GithubSshKeys", keys.text)
|
||||
|
||||
@@ -44,6 +44,7 @@ pip install pip==21.3.1
|
||||
pip install pipenv==2021.11.23
|
||||
|
||||
if [ -d "./xx" ]; then
|
||||
echo "WARNING: using xx Pipfile ******"
|
||||
export PIPENV_SYSTEM=1
|
||||
export PIPENV_PIPFILE=./xx/Pipfile
|
||||
fi
|
||||
@@ -56,7 +57,8 @@ else
|
||||
fi
|
||||
|
||||
echo "pip packages install..."
|
||||
pipenv install --dev --deploy --clear
|
||||
pipenv sync --dev
|
||||
pipenv --clear
|
||||
pyenv rehash
|
||||
|
||||
echo "pre-commit hooks install..."
|
||||
|
||||
Reference in New Issue
Block a user