From f22aff9f6e9b37941e9cbc2f9df9cd49cddacd1f Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 30 Jun 2023 17:35:57 -0700 Subject: [PATCH] bump to python 3.11.4 (#865) * bump to python 3.11.4 * Update requirements.txt * fix * req * fixfix --------- Co-authored-by: Maxime Desroches --- .github/workflows/tests.yml | 2 +- Dockerfile | 6 +++--- generator/chrysler/_stellantis_common_ram.py | 2 +- generator/generator.py | 4 ++-- .../hyundai/hyundai_kia_mando_corner_radar.py | 2 +- generator/hyundai/hyundai_kia_mando_front_radar.py | 2 +- requirements.txt | 14 +++++++------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5ab3dac..d3c95f5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ name: tests on: [push, pull_request] env: - RUN: docker run -v $GITHUB_WORKSPACE:/project/opendbc -w /project/opendbc -e PYTHONWARNINGS=error --shm-size 1G --rm opendbc /bin/bash -c + RUN: docker run -v $GITHUB_WORKSPACE:/project/opendbc -w /project/opendbc -e PYTHONWARNINGS="error,default::DeprecationWarning" --shm-size 1G --rm opendbc /bin/bash -c BUILD: | docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile) || true docker pull ghcr.io/commaai/opendbc:latest || true diff --git a/Dockerfile b/Dockerfile index c406413..69c851c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,13 +34,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}" -RUN pyenv install 3.8.10 -RUN pyenv global 3.8.10 +RUN pyenv install 3.11.4 +RUN pyenv global 3.11.4 RUN pyenv rehash COPY requirements.txt /tmp/ RUN pip install --no-cache-dir -r /tmp/requirements.txt -RUN pip install --no-cache-dir pre-commit==2.15.0 pylint==2.5.2 +RUN pip install --no-cache-dir pre-commit==2.15.0 pylint==2.17.4 ENV PYTHONPATH=/project diff --git a/generator/chrysler/_stellantis_common_ram.py b/generator/chrysler/_stellantis_common_ram.py index b117db0..5072985 100755 --- a/generator/chrysler/_stellantis_common_ram.py +++ b/generator/chrysler/_stellantis_common_ram.py @@ -32,7 +32,7 @@ if __name__ == "__main__": chrysler_path = os.path.dirname(os.path.realpath(__file__)) for out, addr_lookup in chrysler_to_ram.items(): - with open(os.path.join(chrysler_path, src)) as in_f, open(os.path.join(chrysler_path, out), 'w') as out_f: + with open(os.path.join(chrysler_path, src), encoding='utf-8') as in_f, open(os.path.join(chrysler_path, out), 'w', encoding='utf-8') as out_f: out_f.write(f'CM_ "Generated from {src}"\n\n') wrote_addrs = set() diff --git a/generator/generator.py b/generator/generator.py index 9d5b37b..214c8fb 100755 --- a/generator/generator.py +++ b/generator/generator.py @@ -11,7 +11,7 @@ generated_suffix = '_generated.dbc' def read_dbc(src_dir: str, filename: str) -> str: - with open(os.path.join(src_dir, filename)) as file_in: + with open(os.path.join(src_dir, filename), encoding='utf-8') as file_in: return file_in.read() @@ -23,7 +23,7 @@ def create_dbc(src_dir: str, filename: str, output_path: str): output_filename = filename.replace('.dbc', generated_suffix) output_file_location = os.path.join(output_path, output_filename) - with open(output_file_location, 'w') as dbc_file_out: + with open(output_file_location, 'w', encoding='utf-8') as dbc_file_out: dbc_file_out.write('CM_ "AUTOGENERATED FILE, DO NOT EDIT";\n') for include_filename in includes: diff --git a/generator/hyundai/hyundai_kia_mando_corner_radar.py b/generator/hyundai/hyundai_kia_mando_corner_radar.py index d4bcf67..aad417e 100755 --- a/generator/hyundai/hyundai_kia_mando_corner_radar.py +++ b/generator/hyundai/hyundai_kia_mando_corner_radar.py @@ -5,7 +5,7 @@ import os if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc") hyundai_path = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(hyundai_path, dbc_name), "w") as f: + with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: f.write(""" VERSION "" diff --git a/generator/hyundai/hyundai_kia_mando_front_radar.py b/generator/hyundai/hyundai_kia_mando_front_radar.py index 8870bf0..ee8dde6 100755 --- a/generator/hyundai/hyundai_kia_mando_front_radar.py +++ b/generator/hyundai/hyundai_kia_mando_front_radar.py @@ -4,7 +4,7 @@ import os if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc") hyundai_path = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(hyundai_path, dbc_name), "w") as f: + with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: f.write(""" VERSION "" diff --git a/requirements.txt b/requirements.txt index 62b29a2..a95489c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -Cython==0.29.34 -flake8==6.0.0 -Jinja2==3.1.2 -numpy==1.24.2 -pycapnp==1.3.0 -pylint==2.17.2 -pyyaml==6.0 +Cython +flake8 +Jinja2 +numpy +pycapnp +pylint==2.17.4 +pyyaml scons