Skip to content

Update pyglet to 3.0.dev11 - #2903

Merged
pvcraven merged 4 commits into
developmentfrom
update-pyglet-3.0.dev11
Oct 1, 2026
Merged

pvcraven merged 4 commits into
developmentfrom
update-pyglet-3.0.dev11

Conversation

@pvcraven

@pvcraven pvcraven commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Updates the pyglet pin from 3.0.dev8 to 3.0.dev11, in pyproject.toml and uv.lock. Arcade's library code needed no changes; doc/conf.py did (see "Docs build fix" below).

What changed in pyglet dev9–dev11

pyglet's RELEASE_NOTES doesn't cover 3.0 yet, and the GitHub releases have no notes. So I went through the 148 commits between v3.0.dev8 and v3.0.dev11, and the changes to the 3.0 migration guide.

Change Affects arcade?
ShaderProgram requires a vertex_layout keyword argument; create_vertex_layout and set_instance_attributes are replaced by VertexLayout and get_vertex_view No. Arcade's shaders use arcade.gl, and arcade doesn't create pyglet shader programs or vertex lists
Graphics resources get a backend .handle and a stable .key; .id is deprecated No. The only .id uses in arcade are Tiled tile IDs
MouseCursor.gl_drawable renamed to api_drawable No. Not used
pyglet.gui rewritten around UIManager No. arcade.gui is separate
WebGL OpenGLSurfaceContext renamed to WebGL2SurfaceContext No. Only mentioned in two comments
Documentation builds are detected through the PYGLET_DOC_BUILD environment variable instead of sys.is_pyglet_doc_run Yes, for arcade's docs build. Fixed in doc/conf.py, see below
pyglet.app.run adds a SIGINT handler that calls app.exit Yes, in a good way: Ctrl+C now stops arcade.run() cleanly (except in headless mode and test runs, which use arcade's own loop)
macOS 14+: redraws can be driven by CADisplayLink (pyglet.options.osx_displaylink, default on) No. The display link is only started when app.run is given an interval; arcade calls pyglet.app.run(None) and schedules its own frames, so it falls through before any draw source is created (EventLoop._schedule_window_draw)

These are written up in the changelog under "Breaking Changes" for users who use pyglet directly, following the dev8 entry's format.

Note that pyglet/__init__.py at the v3.0.dev11 git tag still says version = '3.0.dev10'. The PyPI wheel says 3.0.dev11, and apart from that line it's identical to the tag.

Docs build fix

The first CI run failed in Build Documentation: AttributeError: module 'pyglet.lib' has no attribute 'LibraryMock'.

pyglet dev11 now detects documentation builds through the PYGLET_DOC_BUILD environment variable, read when pyglet is first imported, instead of the sys.is_pyglet_doc_run flag that doc/conf.py set. With only the old flag, pyglet never defined LibraryMock, so conf.py's patch to it crashed.

conf.py now sets os.environ["PYGLET_DOC_BUILD"] = "1" before anything imports pyglet. I also dropped the LibraryMock __bool__/__iter__ patch, because dev11's mock defines both.

I reproduced the failure locally with uv run make.py docs-full, using an environment from the lock file (pyglet 3.0.dev11, Sphinx 9.1.0, Python 3.13). With the fix, the full build succeeds with -W. I missed this the first time because I'd run the tests and import checks but not the docs build.

Testing

All of this was run with the actual PyPI 3.0.dev11 wheel:

  • Imports: every arcade module imports. The exceptions (PyInstaller hook, cv2 video, and atlas_array/atlas_bindless) fail the same way on dev8, because of missing optional packages or an existing ArcadeContext NameError. The atlas stubs are removed in Remove unfinished array and bindless texture atlas stubs #2904.
  • Tests: the whole tests/ folder, as CI runs it, gives identical results on dev8 and dev11: 1365 passed, with the same 3 render tests failing on my machine only. The warnings are also identical, so dev11 adds no new deprecation warnings for arcade.
  • Docs: make.py docs-full (as CI runs it) succeeds with -W; see above.
  • Not tested: macOS. Based on the code path above, I don't expect a timing change there, but a quick run of a moving-sprite example on a Mac would confirm it.

🤖 Generated with Claude Code

Paul V Craven and others added 4 commits October 1, 2026 12:53
Update the pyglet pin from 3.0.dev8 to 3.0.dev11 in pyproject.toml and
uv.lock. Only the pyglet entries in the lock file change.

Arcade needed no code changes: every arcade module imports, and the
full test suite gives the same results as on dev8. The breaking changes
in dev9-dev11 (ShaderProgram vertex_layout, resource handle/key,
pyglet.gui UIManager) are in pyglet APIs arcade doesn't use. The new
macOS display link draw source isn't started because arcade calls
pyglet.app.run(None) and schedules its own frames.

Document the changes for users who use pyglet directly in the changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pyglet 3.0.dev11 detects documentation builds through the
PYGLET_DOC_BUILD environment variable, read when pyglet is first
imported, instead of the sys.is_pyglet_doc_run flag. With only the old
flag set, pyglet.lib.LibraryMock was never defined, so doc/conf.py's
patch to it raised AttributeError and the docs build failed.

Set the environment variable instead, before anything imports pyglet,
and drop the LibraryMock patch: dev11's mock already defines __bool__
and __iter__.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pvcraven
pvcraven merged commit d0583e5 into development Oct 1, 2026
7 checks passed
@pvcraven
pvcraven deleted the update-pyglet-3.0.dev11 branch October 1, 2026 18:37
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.

1 participant