Skip to content

Touchup examples#113

Merged
benmoran56 merged 15 commits into
benmoran56:masterfrom
jn64:examples
Feb 1, 2026
Merged

Touchup examples#113
benmoran56 merged 15 commits into
benmoran56:masterfrom
jn64:examples

Conversation

@jn64
Copy link
Copy Markdown
Contributor

@jn64 jn64 commented Sep 14, 2025

Fixed a few minor things to make it easier to demo the examples as a curious passerby :)

jn64 and others added 14 commits September 14, 2025 17:22
This allows easy demos without prior setup, using tools that support PEP 723
inline metadata, e.g.:

    git clone <url>
    cd esper
    uv run --script examples/pyglet_example.py
Unlike pyglet.resource, pygame.image.load() and sdl2.ext.load_image() do not
search relative to the script. This caused the latter two to fail when running
from a different dir like the repo root:

    uv run --script examples/pygame_example.py # FileNotFoundError
    cd examples
    uv run --script pygame_example.py # ok

Now both cases work.
This doesn't change the benchmark, it was just annoying waiting ~0.4s for --help
to return. Now should be instant.
This also conveniently prints to stderr instead of stdout.
Return code is still 1.
Remove unnecessary header
Remove unnecessary header
Remove unnecessary header
Add space between different import types
Remove unnecessary header
Remove unnecessary header
@benmoran56 benmoran56 merged commit 7acd3aa into benmoran56:master Feb 1, 2026
36 checks passed
@benmoran56
Copy link
Copy Markdown
Owner

Thank you for the PR. The small fixes are great. I hope you don't mind, but I opted to remove the PEP 723 related headers.

@jn64
Copy link
Copy Markdown
Contributor Author

jn64 commented Feb 1, 2026

PEP 723 related headers

No problem. Those interested can use e.g.

uv run --with esper,pyglet --script examples/pyglet_example.py

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