From ee8e21a379aee03f053c223a23fa691c3bd57450 Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Mon, 18 Nov 2024 16:29:27 +0100 Subject: [PATCH 1/7] allow prerelease for uv installed environments --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 515e1b6f6..fd21bcd67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,8 @@ version = { attr = "arcade.version.VERSION" } requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" +[tool.uv] +prerelease = "allow" [tool.ruff] # --- Description of what we ignore --- From 3501f26c98dc2c05e649f25c1509f9c38b6282c7 Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Mon, 18 Nov 2024 16:29:44 +0100 Subject: [PATCH 2/7] fix splashscreen duration type --- arcade/future/splash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arcade/future/splash.py b/arcade/future/splash.py index 5f3318fc6..b9dde31fc 100644 --- a/arcade/future/splash.py +++ b/arcade/future/splash.py @@ -21,7 +21,7 @@ class ArcadeSplash(View): dark_mode: If True, the splash screen will be shown in dark mode. (Default False) """ - def __init__(self, view: View, duration: int = 3, dark_mode: bool = False): + def __init__(self, view: View, duration: float = 3.0, dark_mode: bool = False): super().__init__() self._next_view = view self._duration = duration From dc2ad56d9967bf186c1e4d5b7a7bc191cb7d402a Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Mon, 18 Nov 2024 16:37:41 +0100 Subject: [PATCH 3/7] make pymunk imports optional, which allows to exclude it during packaging with cx_freeze --- arcade/__init__.py | 9 ++++++--- arcade/hitbox/__init__.py | 12 +++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/arcade/__init__.py b/arcade/__init__.py index a4c812d3e..7a13f3c33 100644 --- a/arcade/__init__.py +++ b/arcade/__init__.py @@ -199,9 +199,12 @@ def configure_logging(level: int | None = None): from .tilemap import read_tmx from .tilemap import TileMap -from .pymunk_physics_engine import PymunkPhysicsEngine -from .pymunk_physics_engine import PymunkPhysicsObject -from .pymunk_physics_engine import PymunkException +try: + from .pymunk_physics_engine import PymunkPhysicsEngine + from .pymunk_physics_engine import PymunkPhysicsObject + from .pymunk_physics_engine import PymunkException +except ImportError: + print("Pymunk is not installed. Pymunk physics engine will not be available.") from .version import VERSION diff --git a/arcade/hitbox/__init__.py b/arcade/hitbox/__init__.py index ab5d304dc..974d505e0 100644 --- a/arcade/hitbox/__init__.py +++ b/arcade/hitbox/__init__.py @@ -6,18 +6,23 @@ from .base import HitBox, HitBoxAlgorithm, RotatableHitBox from .bounding_box import BoundingHitBoxAlgorithm -from .pymunk import PymunkHitBoxAlgorithm from .simple import SimpleHitBoxAlgorithm #: The simple hit box algorithm. algo_simple = SimpleHitBoxAlgorithm() -#: The detailed hit box algorithm. -algo_detailed = PymunkHitBoxAlgorithm() #: The bounding box hit box algorithm. algo_bounding_box = BoundingHitBoxAlgorithm() #: The default hit box algorithm. algo_default = algo_simple +#: The detailed hit box algorithm, if pymunk available. +try: + from .pymunk import PymunkHitBoxAlgorithm + algo_detailed = PymunkHitBoxAlgorithm() +except ImportError: + algo_detailed = None + print("Warning: pymunk is not installed. PymunkHitBoxAlgorithm will not be available.") + # Temporary functions for backwards compatibility def calculate_hit_box_points_simple(image: Image, *args) -> Point2List: @@ -46,6 +51,7 @@ def calculate_hit_box_points_detailed( How detailed to make the hit box. There's a trade-off in number of points vs. accuracy. """ + assert algo_detailed, "PymunkHitBoxAlgorithm is not available." return algo_detailed.calculate(image, detail=hit_box_detail) From 67baa3bb23c2c4afb528f17fdf373bdbd2ff0a9b Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Mon, 18 Nov 2024 16:43:24 +0100 Subject: [PATCH 4/7] make lint/types happy --- arcade/camera/camera_2d.py | 5 ++--- arcade/hitbox/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arcade/camera/camera_2d.py b/arcade/camera/camera_2d.py index 549009b3f..a1a03ae4b 100644 --- a/arcade/camera/camera_2d.py +++ b/arcade/camera/camera_2d.py @@ -484,8 +484,8 @@ def point_in_view(self, point: Point2) -> bool: """ # This is unwrapped from standard Vec2 operations, # The construction and garbage collection of the vectors would - # increase this method's cost by ~4x - + # increase this method's cost by ~4x + pos = self.position diff = point[0] - pos[0], point[1] - pos[1] @@ -569,7 +569,6 @@ def projection(self) -> Rect: @projection.setter def projection(self, value: Rect) -> None: - # Unpack and validate if not value: raise ZeroProjectionDimension((f"Projection area is 0, {value.lrbt}")) diff --git a/arcade/hitbox/__init__.py b/arcade/hitbox/__init__.py index 974d505e0..ae79fa3b1 100644 --- a/arcade/hitbox/__init__.py +++ b/arcade/hitbox/__init__.py @@ -18,9 +18,10 @@ #: The detailed hit box algorithm, if pymunk available. try: from .pymunk import PymunkHitBoxAlgorithm + algo_detailed = PymunkHitBoxAlgorithm() except ImportError: - algo_detailed = None + algo_detailed = None # type: ignore print("Warning: pymunk is not installed. PymunkHitBoxAlgorithm will not be available.") From d88b920603aa5679a17d98204ba607dabd92bef8 Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Mon, 18 Nov 2024 19:56:20 +0100 Subject: [PATCH 5/7] remove support for python 3.9 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fd21bcd67..93461ca5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,14 +4,13 @@ description = "Arcade Game Development Library" readme = "README.md" authors = [{ name = "Paul Vincent Craven", email = "paul@cravenfamily.com" }] license = { file = "license.rst" } -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", From 87f6c8bed95ff5dc2f994e478d209d0519cb1c98 Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Mon, 18 Nov 2024 20:00:39 +0100 Subject: [PATCH 6/7] remove support for python 3.9 --- .github/workflows/selfhosted_runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/selfhosted_runner.yml b/.github/workflows/selfhosted_runner.yml index ad0e9f4ce..198ac9d92 100644 --- a/.github/workflows/selfhosted_runner.yml +++ b/.github/workflows/selfhosted_runner.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.9.13', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.10', '3.11', '3.12', '3.13'] architecture: ['x64'] steps: From fbb59cd1658996cca0839f64f66abd69a3f1a6e0 Mon Sep 17 00:00:00 2001 From: Maic Siemering Date: Mon, 18 Nov 2024 21:33:50 +0100 Subject: [PATCH 7/7] bring back support for python 3.9 --- .github/workflows/selfhosted_runner.yml | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/selfhosted_runner.yml b/.github/workflows/selfhosted_runner.yml index 198ac9d92..ad0e9f4ce 100644 --- a/.github/workflows/selfhosted_runner.yml +++ b/.github/workflows/selfhosted_runner.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9.13', '3.10', '3.11', '3.12', '3.13'] architecture: ['x64'] steps: diff --git a/pyproject.toml b/pyproject.toml index 93461ca5e..fd21bcd67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,14 @@ description = "Arcade Game Development Library" readme = "README.md" authors = [{ name = "Paul Vincent Craven", email = "paul@cravenfamily.com" }] license = { file = "license.rst" } -requires-python = ">=3.10" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12",