Skip to content

Commit

Permalink
Upgrade to Python 3.11 (#11)
Browse files Browse the repository at this point in the history
* Verified python 3.11 works, only change here was to fix new logging location in jpeg benchmark

* update CI to use python 3.11
  • Loading branch information
maxlou05 authored Aug 21, 2024
1 parent 05b3446 commit 696ce95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions jpeg_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/*"

0 comments on commit 696ce95

Please sign in to comment.