Skip to content

Commit

Permalink
Merge pull request #403 from phst-randomizer/renovate/python-3.x
Browse files Browse the repository at this point in the history
Update python Docker tag to v3.12
  • Loading branch information
mike8699 committed Oct 22, 2023
2 parents 2936958 + c6e3fb7 commit e0eec73
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -29,11 +29,10 @@ repos:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py311-plus
args: [--py312-plus]

- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
Expand All @@ -47,33 +46,34 @@ repos:
- --remove-unused-variables

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- 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

- 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$
args: ["--schemafile", "ph_rando/shuffler/aux_schema.json"]
- 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
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11
3.12
8 changes: 4 additions & 4 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# 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
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
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
Expand Down
8 changes: 4 additions & 4 deletions ph_rando/patcher/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ 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] = {
'.'.join([area.name, room.name, chest.name]): chest
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
Expand All @@ -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


Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion tests/desmume/test_chest_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/desmume/test_dig_spot_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/desmume/test_salvage_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/desmume/test_shop_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit e0eec73

Please sign in to comment.