From bc4566f82e09ddd8978481c7851f028d2e171af2 Mon Sep 17 00:00:00 2001 From: Aspect1103 Date: Sun, 7 Jan 2024 15:09:33 +0000 Subject: [PATCH] Updated dependencies. Reverted the change to start_menu.py which caused the buttons to not appear. Stopped running the Python tests on ubuntu-latest for now due to the EGL bug. This will be fixed at a later date. Fixed the bug where CodeQL does not scan binding.cpp by manually compiling instead of using autobuild. --- .github/workflows/codeql.yaml | 10 +++++---- .github/workflows/test.yaml | 4 +++- .pre-commit-config.yaml | 2 +- poetry.lock | 38 +++++++++++++++++------------------ pyproject.toml | 2 +- src/hades/views/game.py | 1 - src/hades/views/start_menu.py | 6 ++---- src/hades/window.py | 2 ++ 8 files changed, 34 insertions(+), 31 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index b6dc989f..d1d48b99 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -24,11 +24,13 @@ jobs: with: languages: ${{ matrix.language }} setup-python-dependencies: false - - name: Autobuild C++ + - name: Set up CMake if: matrix.language == 'cpp' - uses: github/codeql-action/autobuild@v2.22.9 - with: - working-directory: ${{ github.workspace }}/src/hades_extensions + uses: lukka/get-cmake@v3.27.7 + - name: Build CMake + if: matrix.language == 'cpp' + working-directory: ${{ github.workspace }}/src/hades_extensions + run: cmake . --preset Debug && cmake --build build-debug - name: Perform CodeQL analysis uses: github/codeql-action/analyze@v2.22.9 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f30bd68..85370f03 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [windows-latest] + # TODO: Figure out why EGL isn't working on ubuntu + # os: [ubuntu-latest, windows-latest] python-version: ["3.11", "3.12"] steps: - name: Checkout repository diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d95e79e3..2564143b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: hooks: - id: ssort - repo: "https://github.com/charliermarsh/ruff-pre-commit" - rev: v0.1.9 + rev: v0.1.11 hooks: - id: ruff args: ["--fix", "--exit-non-zero-on-fix"] diff --git a/poetry.lock b/poetry.lock index 238e5f1d..28109bdb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -941,28 +941,28 @@ files = [ [[package]] name = "ruff" -version = "0.1.9" +version = "0.1.11" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.9-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:e6a212f436122ac73df851f0cf006e0c6612fe6f9c864ed17ebefce0eff6a5fd"}, - {file = "ruff-0.1.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:28d920e319783d5303333630dae46ecc80b7ba294aeffedf946a02ac0b7cc3db"}, - {file = "ruff-0.1.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:104aa9b5e12cb755d9dce698ab1b97726b83012487af415a4512fedd38b1459e"}, - {file = "ruff-0.1.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1e63bf5a4a91971082a4768a0aba9383c12392d0d6f1e2be2248c1f9054a20da"}, - {file = "ruff-0.1.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4d0738917c203246f3e275b37006faa3aa96c828b284ebfe3e99a8cb413c8c4b"}, - {file = "ruff-0.1.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:69dac82d63a50df2ab0906d97a01549f814b16bc806deeac4f064ff95c47ddf5"}, - {file = "ruff-0.1.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2aec598fb65084e41a9c5d4b95726173768a62055aafb07b4eff976bac72a592"}, - {file = "ruff-0.1.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:744dfe4b35470fa3820d5fe45758aace6269c578f7ddc43d447868cfe5078bcb"}, - {file = "ruff-0.1.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:479ca4250cab30f9218b2e563adc362bd6ae6343df7c7b5a7865300a5156d5a6"}, - {file = "ruff-0.1.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:aa8344310f1ae79af9ccd6e4b32749e93cddc078f9b5ccd0e45bd76a6d2e8bb6"}, - {file = "ruff-0.1.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:837c739729394df98f342319f5136f33c65286b28b6b70a87c28f59354ec939b"}, - {file = "ruff-0.1.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:e6837202c2859b9f22e43cb01992373c2dbfeae5c0c91ad691a4a2e725392464"}, - {file = "ruff-0.1.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:331aae2cd4a0554667ac683243b151c74bd60e78fb08c3c2a4ac05ee1e606a39"}, - {file = "ruff-0.1.9-py3-none-win32.whl", hash = "sha256:8151425a60878e66f23ad47da39265fc2fad42aed06fb0a01130e967a7a064f4"}, - {file = "ruff-0.1.9-py3-none-win_amd64.whl", hash = "sha256:c497d769164df522fdaf54c6eba93f397342fe4ca2123a2e014a5b8fc7df81c7"}, - {file = "ruff-0.1.9-py3-none-win_arm64.whl", hash = "sha256:0e17f53bcbb4fff8292dfd84cf72d767b5e146f009cccd40c2fad27641f8a7a9"}, - {file = "ruff-0.1.9.tar.gz", hash = "sha256:b041dee2734719ddbb4518f762c982f2e912e7f28b8ee4fe1dee0b15d1b6e800"}, + {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:a7f772696b4cdc0a3b2e527fc3c7ccc41cdcb98f5c80fdd4f2b8c50eb1458196"}, + {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:934832f6ed9b34a7d5feea58972635c2039c7a3b434fe5ba2ce015064cb6e955"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9bd4025b9c5b429a48280785a2b71d479798a69f5c2919e7d274c5f4b32c3607"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1ad00662305dcb1e987f5ec214d31f7d6a062cae3e74c1cbccef15afd96611d"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:4b077ce83f47dd6bea1991af08b140e8b8339f0ba8cb9b7a484c30ebab18a23f"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4a88efecec23c37b11076fe676e15c6cdb1271a38f2b415e381e87fe4517f18"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5b25093dad3b055667730a9b491129c42d45e11cdb7043b702e97125bcec48a1"}, + {file = "ruff-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:231d8fb11b2cc7c0366a326a66dafc6ad449d7fcdbc268497ee47e1334f66f77"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:09c415716884950080921dd6237767e52e227e397e2008e2bed410117679975b"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0f58948c6d212a6b8d41cd59e349751018797ce1727f961c2fa755ad6208ba45"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:190a566c8f766c37074d99640cd9ca3da11d8deae2deae7c9505e68a4a30f740"}, + {file = "ruff-0.1.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6464289bd67b2344d2a5d9158d5eb81025258f169e69a46b741b396ffb0cda95"}, + {file = "ruff-0.1.11-py3-none-win32.whl", hash = "sha256:9b8f397902f92bc2e70fb6bebfa2139008dc72ae5177e66c383fa5426cb0bf2c"}, + {file = "ruff-0.1.11-py3-none-win_amd64.whl", hash = "sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a"}, + {file = "ruff-0.1.11-py3-none-win_arm64.whl", hash = "sha256:97ce4d752f964ba559c7023a86e5f8e97f026d511e48013987623915431c7ea9"}, + {file = "ruff-0.1.11.tar.gz", hash = "sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb"}, ] [[package]] @@ -1137,4 +1137,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "baaa1b14d48c05d11e9ca863915ab6fac7e5dcc497120f950a7463ddab296203" +content-hash = "956dcb490cbd116df68ec65300dcefae05a454fabe557aa942202527a7eedd09" diff --git a/pyproject.toml b/pyproject.toml index a9995de8..72060555 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ pytest-icdiff = "0.9" pytest-instafail = "0.5.0" pytest-randomly = "3.15.0" pytest-sugar = "0.9.7" -ruff = "0.1.9" +ruff = "0.1.11" ssort = "v0.12.0" tox = "4.11.4" diff --git a/src/hades/views/game.py b/src/hades/views/game.py index 59021f62..eb1772b5 100644 --- a/src/hades/views/game.py +++ b/src/hades/views/game.py @@ -58,7 +58,6 @@ # TODO: Add player attacking enemy (so switching and attacking). Will require components # and indicator bars too -# TODO: Moving the physics engine to C++ would massively help, but needs a lot of work class Game(View): diff --git a/src/hades/views/start_menu.py b/src/hades/views/start_menu.py index 9ae3d020..4dde3f80 100644 --- a/src/hades/views/start_menu.py +++ b/src/hades/views/start_menu.py @@ -56,10 +56,8 @@ def __init__(self: StartMenu) -> None: # Create the buttons vertical_box = UIBoxLayout(space_between=20) - start_button, quit_button = ( - UIFlatButton(text="Start Game", width=200), - UIFlatButton(text="Quit Game", width=200), - ) + start_button = vertical_box.add(UIFlatButton(text="Start Game", width=200)) + quit_button = vertical_box.add(UIFlatButton(text="Quit Game", width=200)) start_button.on_click = start_on_click_handler quit_button.on_click = lambda _: arcade.exit() diff --git a/src/hades/window.py b/src/hades/window.py index d15b29a3..36c1b6c7 100644 --- a/src/hades/window.py +++ b/src/hades/window.py @@ -66,3 +66,5 @@ def main() -> None: # TODO: Start thinking about how to refactor the game (maybe move to pygam or some other # library or other methods). Could move events to c++ and/or move physics system to # box2d or chipmunk among other stuff +# TODO: Moving the physics engine to C++ (chipmunk) would massively help, but needs a +# lot of work, e.g. the bullets, hitboxes, collisions, etc