diff --git a/.github/workflows/selfhosted_runner.yml b/.github/workflows/selfhosted_runner.yml index ec4324977..b57262f51 100644 --- a/.github/workflows/selfhosted_runner.yml +++ b/.github/workflows/selfhosted_runner.yml @@ -1,4 +1,6 @@ -name: Windows self-hosted test +# This is our full unit tests +# Self-hosted, run on an old notebook +name: Unit testing on: push: @@ -10,14 +12,21 @@ on: jobs: build: - name: Self Hosted Testing + name: Unit tests runs-on: self-hosted + + strategy: + matrix: + os: [ubuntu-latest] + python-version: ['3.8', '3.9.13', '3.10', '3.11'] + architecture: ['x64'] + steps: - uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} - name: Install dependencies part 1 run: | @@ -25,20 +34,10 @@ jobs: python -m venv .venv source .venv/bin/activate python -m pip install -U pip wheel setuptools - python -m pip install pyogg pymunk - name: Install dependencies part 2 run: | source .venv/bin/activate - python -m pip install -I -e .[dev] - - name: code-inspection - run: | - source .venv/bin/activate - mypy arcade - ruff arcade - - name: build-docs - run: | - source .venv/bin/activate - sphinx-build doc build -W + python -m pip install -I -e .[testing_libraries] - name: Test with pytest run: | source .venv/bin/activate @@ -64,7 +63,7 @@ jobs: - name: Upload a Build Artifact if: always() && steps.prepare-artifact.outcome == 'success' continue-on-error: true - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pull-request-payload path: pull_request_payload.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc583c5da..be08e57b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,6 @@ -name: GitHub Ubuntu test +# This does code inspection and checks to make sure building of docs works + +name: GitHub based tests on: push: @@ -10,13 +12,13 @@ on: jobs: build: - name: test + name: Code inspections runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.11'] architecture: ['x64'] steps: @@ -46,10 +48,57 @@ jobs: if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }} run: | python ./make.py ruff + # Prepare the Pull Request Payload artifact. If this fails, + # we fail silently using the `continue-on-error` option. It's + # nice if this succeeds, but if it fails for any reason, it + # does not mean that our lint-test checks failed. + - name: Prepare Pull Request Payload artifact + id: prepare-artifact + if: always() && github.event_name == 'pull_request' + continue-on-error: true + run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json + + # This only makes sense if the previous step succeeded. To + # get the original outcome of the previous step before the + # `continue-on-error` conclusion is applied, we use the + # `.outcome` value. This step also fails silently. + - name: Upload a Build Artifact + if: always() && steps.prepare-artifact.outcome == 'success' + continue-on-error: true + uses: actions/upload-artifact@v3 + with: + name: pull-request-payload + path: pull_request_payload.json + + builddoc: + name: Documentation build test + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + python-version: ['3.11'] + architecture: ['x64'] + + steps: + - uses: actions/checkout@v3 + - name: setup + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.architecture }} + + - name: dependencies + run: | + python -m pip install -U pip wheel setuptools + - name: wheel + id: wheel + run: | + python -m pip install -e .[dev] - name: build-docs run: | sphinx-build doc build -W - # Prepare the Pull Request Payload artifact. If this fails, we + # Prepare the Pull Request Payload artifact. If this fails, # we fail silently using the `continue-on-error` option. It's # nice if this succeeds, but if it fails for any reason, it # does not mean that our lint-test checks failed. @@ -66,7 +115,7 @@ jobs: - name: Upload a Build Artifact if: always() && steps.prepare-artifact.outcome == 'success' continue-on-error: true - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pull-request-payload path: pull_request_payload.json diff --git a/.github/workflows/verify_types.yml b/.github/workflows/verify_types.yml index df229b8ea..f6de7b98b 100644 --- a/.github/workflows/verify_types.yml +++ b/.github/workflows/verify_types.yml @@ -10,7 +10,7 @@ on: jobs: verifytypes: - name: verifytypes + name: Verify types runs-on: ubuntu-latest steps: diff --git a/doc/tutorials/menu/menu_05.py b/doc/tutorials/menu/menu_05.py index d5c5ba6dc..5917ec5eb 100644 --- a/doc/tutorials/menu/menu_05.py +++ b/doc/tutorials/menu/menu_05.py @@ -3,6 +3,8 @@ Shows the usage of almost every gui widget, switching views and making a modal. """ +from typing import List + import arcade import arcade.gui @@ -155,7 +157,7 @@ def on_draw(self): class SubMenu(arcade.gui.UIMouseFilterMixin, arcade.gui.UIAnchorLayout): """Acts like a fake view/window.""" - def __init__(self, title: str, input_text: str, toggle_label: str, dropdown_options: list[str], slider_label: str): + def __init__(self, title: str, input_text: str, toggle_label: str, dropdown_options: List[str], slider_label: str): super().__init__(size_hint=(1, 1)) # Setup frame which will act like the window. diff --git a/pyproject.toml b/pyproject.toml index 4a34e0375..79f414bb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,8 +22,8 @@ classifiers = [ ] dependencies = [ "pyglet>=2.0.8,<2.1", - "pillow~=9.5.0", - "pymunk~=6.5.0", + "pillow~=10.0.0", + "pymunk~=6.5.1", "pytiled-parser~=2.2.3" ] dynamic = ["version"] @@ -37,6 +37,7 @@ Source = "https://github.com/pythonarcade/arcade" Book = "https://learn.arcade.academy" [project.optional-dependencies] +# Used for dev work dev = [ "pytest", "mypy", @@ -45,19 +46,26 @@ dev = [ "coveralls", "pytest-mock", "pytest-cov", - "pygments==2.15.1", - "docutils==0.19", + "pygments==2.16.1", + "docutils==0.20.1", "furo", "pyright==1.1.322", - "pyyaml==6.0", - "sphinx==7.1.2", + "pyyaml==6.0.1", + "sphinx==7.2.2", "sphinx-autobuild==2021.3.14", "sphinx-copybutton==0.5.2", - # Intentionally kept at 2.3 until this bugfix is published: https://github.com/jdillard/sphinx-sitemap/pull/62 - "sphinx-sitemap==2.3.0", + "sphinx-sitemap==2.5.1", "typer[all]==0.7.0", "wheel", ] +# Testing only +testing_libraries = [ + "pytest", + "pytest-mock", + "pytest-cov", + "pyyaml==6.0.1", + "typer[all]==0.7.0", +] [project.scripts] arcade = "arcade.management:execute_from_command_line" diff --git a/tests/unit/resources/test_resources.py b/tests/unit/resources/test_resources.py index 3ff4ba2aa..acef0a2b3 100644 --- a/tests/unit/resources/test_resources.py +++ b/tests/unit/resources/test_resources.py @@ -45,7 +45,8 @@ def test_resource_listing_is_complete(): continue if path.suffix in skip_extensions: continue - if any(path.is_relative_to(skip_path) for skip_path in skip_paths): + if any(str(path).startswith(str(skip_path)) for skip_path in skip_paths): + # if any(path.is_relative_to(skip_path) for skip_path in skip_paths): # Python 3.9+ continue paths_in_resources.add(path) diff --git a/util/make_resources_init.py b/util/make_resources_init.py index f33eec918..ffaf61245 100644 --- a/util/make_resources_init.py +++ b/util/make_resources_init.py @@ -82,7 +82,8 @@ def get_prefix(path: Path) -> str: def is_path_ignored(path: Path) -> bool: """Return True if the path should be ignored.""" for ignore_path in IGNORE_PATHS: - if path.is_relative_to(ignore_path): + # if path.is_relative_to(ignore_path): # Python 3.9+ + if str(path).startswith(str(ignore_path)): return True return False