From 4ca8bc5f4cdef11b7ef9845bbe971455782e6466 Mon Sep 17 00:00:00 2001 From: Paul Craven Date: Mon, 30 Dec 2024 19:44:57 -0600 Subject: [PATCH 1/6] Update Pyglet version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 515e1b6f68..9a5f634320 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ # at the cost of slow download and constant pip install -I -e .[dev] # "pyglet@git+https://github.com/pyglet/pyglet.git@development#egg=pyglet", # Expected future dev preview release on PyPI (not yet released) - "pyglet == 2.1rc1", + "pyglet == 2.1rc3", "pillow~=11.0.0", "pymunk~=6.9.0", "pytiled-parser~=2.2.7", From 221e712efece0885b99f93e2671e487d5c2dd2eb Mon Sep 17 00:00:00 2001 From: Paul Craven Date: Mon, 30 Dec 2024 20:07:36 -0600 Subject: [PATCH 2/6] Work on updating to rc3 --- arcade/__init__.py | 9 +++++---- arcade/sound.py | 4 ++-- tests/unit/test_example_docstrings.py | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arcade/__init__.py b/arcade/__init__.py index a4c812d3ea..f4ffcebdbb 100644 --- a/arcade/__init__.py +++ b/arcade/__init__.py @@ -60,10 +60,11 @@ def configure_logging(level: int | None = None): import pyglet # Enable HiDPI support -if os.environ.get("ARCADE_TEST"): - pyglet.options.dpi_scaling = "real" -else: - pyglet.options.dpi_scaling = "stretch" +# Note: This seems to have changed to 'scale_with_dpi' in pyglet +# if os.environ.get("ARCADE_TEST"): +# pyglet.options['dpi_scaling'] = "real" +# else: +# pyglet.options.dpi_scaling = "stretch" # Env variable shortcut for headless mode headless: Final[bool] = bool(os.environ.get("ARCADE_HEADLESS")) diff --git a/arcade/sound.py b/arcade/sound.py index 443e551c36..7c7359a122 100644 --- a/arcade/sound.py +++ b/arcade/sound.py @@ -13,11 +13,11 @@ from arcade.resources import resolve if os.environ.get("ARCADE_SOUND_BACKENDS"): - pyglet.options.audio = tuple( # type: ignore + pyglet.options['audio'] = tuple( # type: ignore v.strip() for v in os.environ["ARCADE_SOUND_BACKENDS"].split(",") ) else: - pyglet.options.audio = ("openal", "xaudio2", "directsound", "pulse", "silent") # type: ignore + pyglet.options['audio'] = ("openal", "xaudio2", "directsound", "pulse", "silent") # type: ignore import pyglet.media as media diff --git a/tests/unit/test_example_docstrings.py b/tests/unit/test_example_docstrings.py index 09f9e8137f..9bda1cd8f2 100644 --- a/tests/unit/test_example_docstrings.py +++ b/tests/unit/test_example_docstrings.py @@ -51,7 +51,7 @@ def check_submodules(parent_module_absolute_name: str) -> None: It is important to understand that module names and file paths are different things: * A module name is what Python sees the module's name as (``"arcade.color"``) - * A file path is the location on disk (``C:\\Users\\Reader\\python_project\game.py``) + * A file path is the location on disk (``C:\\Users\\Reader\\python_project\\game.py``) Args: parent_module_absolute_name: The absolute import name of the module to check. From 6629ae066a16322f69332e9ac7a34a3756b6426a Mon Sep 17 00:00:00 2001 From: Paul Craven Date: Mon, 30 Dec 2024 20:17:42 -0600 Subject: [PATCH 3/6] Fix up text 'bold' for rc3 --- arcade/text.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arcade/text.py b/arcade/text.py index fe404839fd..e307bdba9c 100644 --- a/arcade/text.py +++ b/arcade/text.py @@ -307,7 +307,7 @@ def __init__( color=Color.from_iterable(color), width=width, align=align, # type: ignore - bold=bold, + weight=pyglet.text.Weight.BOLD if bold else pyglet.text.Weight.NORMAL, italic=italic, multiline=multiline, rotation=rotation, @@ -585,11 +585,11 @@ def bold(self) -> bool | str: * ``"light"`` """ - return self._label.bold + return self._label.weight == pyglet.text.Weight.BOLD @bold.setter def bold(self, bold: bool | str): - self._label.bold = bold + self._label.weight = pyglet.text.Weight.BOLD if bold else pyglet.text.Weight.NORMAL @property def italic(self) -> bool | str: From f7763a667a2c0932badf39458ea6734e2aa1d7ea Mon Sep 17 00:00:00 2001 From: Paul Craven Date: Fri, 3 Jan 2025 14:29:52 -0600 Subject: [PATCH 4/6] Fix for pyright --- arcade/physics_engines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arcade/physics_engines.py b/arcade/physics_engines.py index eeb65ac7ae..9b7aa5c4ff 100644 --- a/arcade/physics_engines.py +++ b/arcade/physics_engines.py @@ -349,7 +349,7 @@ def walls(self, walls: SpriteList | Iterable[SpriteList] | None = None) -> None: def walls(self) -> None: self._walls.clear() - def update(self) -> list[SpriteType]: + def update(self) -> list[BasicSprite]: """Move :py:attr:`player_sprite` and return any colliding sprites. Returns: From c5c4bb8a8721d8709ebb252eac3c0c09e1da218c Mon Sep 17 00:00:00 2001 From: Paul Craven Date: Fri, 10 Jan 2025 08:21:48 -0600 Subject: [PATCH 5/6] Update libraries --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9a5f634320..98c223bba5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,9 @@ dependencies = [ # at the cost of slow download and constant pip install -I -e .[dev] # "pyglet@git+https://github.com/pyglet/pyglet.git@development#egg=pyglet", # Expected future dev preview release on PyPI (not yet released) - "pyglet == 2.1rc3", - "pillow~=11.0.0", - "pymunk~=6.9.0", + "pyglet == 2.1.0", + "pillow~=11.1.0", + "pymunk~=6.10.0", "pytiled-parser~=2.2.7", ] dynamic = ["version"] From 8713feb9e59b5f47bf8bf6b640eb4af79febc614 Mon Sep 17 00:00:00 2001 From: Paul Craven Date: Fri, 10 Jan 2025 08:25:00 -0600 Subject: [PATCH 6/6] Black format --- arcade/sound.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arcade/sound.py b/arcade/sound.py index 7c7359a122..3cf687e817 100644 --- a/arcade/sound.py +++ b/arcade/sound.py @@ -13,11 +13,11 @@ from arcade.resources import resolve if os.environ.get("ARCADE_SOUND_BACKENDS"): - pyglet.options['audio'] = tuple( # type: ignore + pyglet.options["audio"] = tuple( # type: ignore v.strip() for v in os.environ["ARCADE_SOUND_BACKENDS"].split(",") ) else: - pyglet.options['audio'] = ("openal", "xaudio2", "directsound", "pulse", "silent") # type: ignore + pyglet.options["audio"] = ("openal", "xaudio2", "directsound", "pulse", "silent") # type: ignore import pyglet.media as media