Skip to content

Switch to Pyglet 2.1 or dev releases - #2043

Merged
einarf merged 13 commits into
pythonarcade:developmentfrom
pushfoo:pyglet_2.1
Apr 16, 2024
Merged

Switch to Pyglet 2.1 or dev releases#2043
einarf merged 13 commits into
pythonarcade:developmentfrom
pushfoo:pyglet_2.1

Conversation

@pushfoo

@pushfoopushfoo commented Apr 4, 2024

Copy link
Copy Markdown
Member

TL;DR: Get new pyglet bug fixes + immutable vecs for #2021

Why?

Per Discord discussion with @Cleptomania, this change:

  1. enables backward-compatible BasicSprite.scale behavior in Name scale properties on Sprites to things that make sense #2021:
    # Will work with scalars as it does nowsprite_instance.scale*=2.0# Cleaner & more efficient than setting individual scale componentssprite_instance.scale*=2.0, 3.0
  2. seems to show it works fine according to preliminary tests
  3. matches how we've never made a release that wasn't on a preview pyglet build

Changes

  1. Use pyglet==2.1dev2
  2. Update references to pyglet.canvas to refer to pyglet.display
  3. Use new layout syntax per 2.1 styles

Testing Steps Taken

  • Human spot-check of examples (GUI, Text, and Media) on

    • Linux
    • Windows
    • Mac
  • Run unit & integration tests on

    • Linux
    • Windows
    • Mac

Follow-up Work

@pushfoo

pushfoo commented Apr 4, 2024

Copy link
Copy Markdown
MemberAuthor

TL;DR: Looks like CI failures are all unimportant but annoying type annotation issues.

In addition to pre-existing CI failures from the GUI, we also gain a few new ones due to 2.1 changes on pyglet's side:

  • The pyglet .pyi file doesn't appear to be updated to reflect s/pyglet.canvas/pyglet.display/g (PyCharm + pyright dislike this) fixed as of 2.1dev2
  • In pyglet, Literal used to annotate arguments where str is more appropriate 😢

@pushfoopushfoo changed the title Switch to Pyglet 2.1dev1Switch to Pyglet 2.1 or dev releasesApr 13, 2024
@pushfoo

Copy link
Copy Markdown
MemberAuthor

Ben just shipped pyglet 2.1dev2. I plan on updating this branch to that after I get back in < 2 hrs.

@pushfoo

Copy link
Copy Markdown
MemberAuthor

The recent commits:

  1. Resolve rebase conflicts
  2. Fix a lingering pyright issue from either the conflict resolution or pyglet 2.0 -> 2.1 changes

@einarf
einarf merged commit 42c5419 into pythonarcade:developmentApr 16, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pushfoo@einarf