Skip to content

Switch to Pyglet 2.1 or dev releases #2043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 16, 2024

Conversation

pushfoo
Copy link
Member

@pushfoo pushfoo commented Apr 4, 2024

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 now
    sprite_instance.scale *= 2.0
    # Cleaner & more efficient than setting individual scale components
    sprite_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
Copy link
Member Author

pushfoo commented Apr 4, 2024

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 😢

@pushfoo pushfoo changed the title Switch to Pyglet 2.1dev1 Switch to Pyglet 2.1 or dev releases Apr 13, 2024
@pushfoo
Copy link
Member Author

pushfoo commented Apr 13, 2024

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

@pushfoo
Copy link
Member Author

pushfoo commented Apr 16, 2024

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:development Apr 16, 2024
8 checks passed
Sign up for free to 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