From 696ce95b357e2fdeca9e2200bf4c00178171bd51 Mon Sep 17 00:00:00 2001 From: Maxwell Lou <62454180+maxlou05@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:45:23 -0400 Subject: [PATCH] Upgrade to Python 3.11 (#11) * Verified python 3.11 works, only change here was to fix new logging location in jpeg benchmark * update CI to use python 3.11 --- .github/workflows/run-tests.yml | 6 +++--- jpeg_benchmark.py | 8 ++++++-- pyproject.toml | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7c598af..b97f2a7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,4 +1,4 @@ -# This workflow will install Python dependencies and run tests with PyTest using Python 3.8 +# This workflow will install Python dependencies and run tests with PyTest using Python 3.11 # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Run tests @@ -18,10 +18,10 @@ jobs: - uses: actions/checkout@v3 # Set Python version - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 # Set up submodules and submodule dependencies # TODO: Uncomment when there are submodules diff --git a/jpeg_benchmark.py b/jpeg_benchmark.py index 6b544d3..a258b00 100644 --- a/jpeg_benchmark.py +++ b/jpeg_benchmark.py @@ -16,7 +16,7 @@ FRAME_COUNT = 300 FRAME_TO_SAVE = 69 INPUT_PATH = pathlib.Path("test_images", "Encode Test Dataset 2024") -OUTPUT_PATH = pathlib.Path(f"log_{int(time.time())}") +OUTPUT_PATH = pathlib.Path("logs", str(int(time.time()))) # Keys for dictionary entries MAX_TIME_MS = "max_time_ms" @@ -157,7 +157,11 @@ def main() -> int: # Save one image (this one has 2 landing pads in it) for reference if frame_index == FRAME_TO_SAVE: - image.save(OUTPUT_PATH / f"q{quality}.jpeg", format="JPEG", quality=quality) + image.save( + pathlib.Path(OUTPUT_PATH, f"q{quality}.jpeg"), + format="JPEG", + quality=quality, + ) # Save average test results current_result[MIN_TIME_MS] = min_time_ns / 1e6 diff --git a/pyproject.toml b/pyproject.toml index 9afd617..fd7075f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ jobs = 0 # Minimum Python version to use for version dependent checks. Will default to the # version used to run pylint. -py-version = "3.8" +py-version = "3.11" # Discover python modules and packages in the file system subtree. recursive = true @@ -115,7 +115,7 @@ addopts = "--ignore=modules/common/" [tool.black] line-length = 100 -target-version = ["py38"] +target-version = ["py311"] # Excludes files or directories in addition to the defaults # Submodules extend-exclude = "modules/common/*"