From 18c88d02f8885e06ca2baa3798a353c51a20fe88 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Oct 2023 14:32:26 +0000 Subject: [PATCH 1/5] Update python Docker tag to v3.12 --- .python-version | 2 +- base/Dockerfile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.python-version b/.python-version index 2c073331..e4fba218 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.11 +3.12 diff --git a/base/Dockerfile b/base/Dockerfile index ab8ce83a..18619689 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,5 +1,5 @@ # Download and compile ARMIPS -FROM python:3.11 AS compile_armips +FROM python:3.12 AS compile_armips RUN apt-get update && apt-get install -y cmake RUN git clone --recurse-submodules https://github.com/Kingcom/armips.git WORKDIR /armips @@ -7,7 +7,7 @@ RUN cmake . RUN make # Download and compile ndstool -FROM python:3.11 AS compile_ndstool +FROM python:3.12 AS compile_ndstool RUN apt-get update && apt-get install -y build-essential git gcc g++ autotools-dev autoconf RUN git clone https://github.com/devkitPro/ndstool WORKDIR /ndstool @@ -15,14 +15,14 @@ RUN aclocal && autoconf && automake --add-missing && chmod +x ./configure &&\ ./configure --disable-dependency-tracking && make # Download and compile Floating IPS patcher -FROM python:3.11 as compile_flips +FROM python:3.12 as compile_flips RUN apt-get update && apt-get install -y git g++ build-essential RUN git clone https://github.com/Alcaro/Flips.git RUN chmod +x Flips/make.sh RUN cd Flips && ./make.sh # Build base patch -FROM python:3.11 as build +FROM python:3.12 as build WORKDIR /app # Copy compiled armips, ndstool, and flips binaries from previous stages COPY --from=compile_armips /armips/armips /app From 609f7a8131fd9c3dc2baf3c05e1d72e9b5d03888 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 21 Oct 2023 11:10:12 -0400 Subject: [PATCH 2/5] pre-commit autoupdate --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 50798753..5653c1cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-case-conflict - id: check-docstring-first @@ -19,7 +19,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.0 hooks: - id: black @@ -29,7 +29,7 @@ repos: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.4.0 + rev: v3.15.0 hooks: - id: pyupgrade args: @@ -47,7 +47,7 @@ repos: - --remove-unused-variables - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: @@ -60,13 +60,13 @@ repos: - .flake8 - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v16.0.6 + rev: v17.0.3 hooks: - id: clang-format # Validate aux data against schema - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.23.3 + rev: 0.27.0 hooks: - id: check-jsonschema files: ^ph_rando/shuffler/logic/.*\.json$ @@ -74,6 +74,6 @@ repos: - id: check-github-workflows - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.3.0 + rev: v2.5.0 hooks: - id: setup-cfg-fmt From 9743bff55f323da934c05b83b3cfcbe511ba6c12 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 21 Oct 2023 11:12:07 -0400 Subject: [PATCH 3/5] Configure formatters for python 3.12 --- .pre-commit-config.yaml | 3 +-- pyproject.toml | 2 +- setup.cfg | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5653c1cc..78d13341 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,8 +32,7 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - args: - - --py311-plus + args: [--py312-plus] - repo: https://github.com/PyCQA/autoflake rev: v2.2.1 diff --git a/pyproject.toml b/pyproject.toml index 3ac9b08c..458da5d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ exclude = '\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|dist' line-length = 100 skip-string-normalization = true -target-version = ["py311"] +target-version = ["py312"] [tool.isort] combine_as_imports = true diff --git a/setup.cfg b/setup.cfg index 263c8f10..db25f92e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ install_requires = pyparsing==3.1.1 vidua==0.4.5 zed@git+https://github.com/phst-randomizer/zed.git@5ee969236bf3c3d0707da963e5edc818ddf246d3 -requires_python = >=3.11 +requires_python = >=3.12 [options.entry_points] console_scripts = From ff478b8de4f42ca8e655b56b02f95971ca3d35d6 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 21 Oct 2023 11:14:00 -0400 Subject: [PATCH 4/5] Fix flake8 errors --- ph_rando/patcher/_util.py | 8 ++++---- tests/desmume/test_chest_items.py | 2 +- tests/desmume/test_dig_spot_items.py | 2 +- tests/desmume/test_salvage_items.py | 2 +- tests/desmume/test_shop_items.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ph_rando/patcher/_util.py b/ph_rando/patcher/_util.py index 28048b0a..383e49ed 100644 --- a/ph_rando/patcher/_util.py +++ b/ph_rando/patcher/_util.py @@ -260,7 +260,7 @@ def _patch_zmb_actors(areas: list[Area], input_rom: rom.NintendoDSRom) -> None: for area in areas for room in area.rooms for chest in room.chests - if type(chest) == SalvageTreasure + if type(chest) is SalvageTreasure } dig_spots: dict[str, DigSpot] = { @@ -268,7 +268,7 @@ def _patch_zmb_actors(areas: list[Area], input_rom: rom.NintendoDSRom) -> None: for area in areas for room in area.rooms for chest in room.chests - if type(chest) == DigSpot + if type(chest) is DigSpot } all_chests = salvage_treasures | dig_spots @@ -292,7 +292,7 @@ def _patch_zmb_actors(areas: list[Area], input_rom: rom.NintendoDSRom) -> None: logger.info(f'Patching check "{name}" with item {chest.contents.name}') zmb_files[chest.zmb_file_path].actors[chest.zmb_actor_index].unk0C = item_id - if type(chest) == SalvageTreasure: + if type(chest) is SalvageTreasure: zmb_files[chest.zmb_file_path].actors[chest.zmb_actor_index].unk0C |= 0x8000 @@ -304,7 +304,7 @@ def _patch_shop_items(areas: list[Area], input_rom: rom.NintendoDSRom) -> None: for area in areas for room in area.rooms for chest in room.chests - if type(chest) == Shop + if type(chest) is Shop } # Load arm9.bin and overlay table diff --git a/tests/desmume/test_chest_items.py b/tests/desmume/test_chest_items.py index a9f76eb2..059661d1 100644 --- a/tests/desmume/test_chest_items.py +++ b/tests/desmume/test_chest_items.py @@ -31,7 +31,7 @@ def chest_test_emu( for area in aux_data.areas for room in area.rooms for chest in room.chests - if type(chest) == Chest + if type(chest) is Chest and chest.zmb_file_path == 'Map/isle_main/map19.bin/zmb/isle_main_19.zmb' ] for chest in chests: diff --git a/tests/desmume/test_dig_spot_items.py b/tests/desmume/test_dig_spot_items.py index da045e1e..212bbf2a 100644 --- a/tests/desmume/test_dig_spot_items.py +++ b/tests/desmume/test_dig_spot_items.py @@ -31,7 +31,7 @@ def dig_spot_test_emu( for area in aux_data.areas for room in area.rooms for chest in room.chests - if type(chest) == DigSpot + if type(chest) is DigSpot and chest.zmb_file_path == 'Map/isle_main/map00.bin/zmb/isle_main_00.zmb' ] for chest in chests: diff --git a/tests/desmume/test_salvage_items.py b/tests/desmume/test_salvage_items.py index 0cbd027b..8ec613ab 100644 --- a/tests/desmume/test_salvage_items.py +++ b/tests/desmume/test_salvage_items.py @@ -31,7 +31,7 @@ def salvage_item_test_emu( for area in aux_data.areas for room in area.rooms for chest in room.chests - if type(chest) == SalvageTreasure + if type(chest) is SalvageTreasure and chest.zmb_file_path == 'Map/sea/map00.bin/zmb/sea_00.zmb' ] for chest in chests: diff --git a/tests/desmume/test_shop_items.py b/tests/desmume/test_shop_items.py index 84f2a3b6..8b2ee2e5 100644 --- a/tests/desmume/test_shop_items.py +++ b/tests/desmume/test_shop_items.py @@ -27,7 +27,7 @@ def island_shop_test_emu( for area in aux_data.areas for room in area.rooms for chest in room.chests - if type(chest) == Shop + if type(chest) is Shop ] for chest in chests: chest.contents = Item(name=ITEMS_REVERSED[request.param], states=set()) From c6e3fb75cf99724d24b647004560068f69a319f5 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 22 Oct 2023 11:58:30 -0400 Subject: [PATCH 5/5] Temporarily disable flake8-quotes --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 78d13341..3c13e6f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,7 +53,8 @@ repos: - flake8-black - flake8-bugbear - flake8-isort - - flake8-quotes + # TODO: re-enable when https://github.com/zheller/flake8-quotes/issues/117 is fixed + # - flake8-quotes args: - --config - .flake8