Python-Logo-Widgets

Python Logo Widgets — Development

Setup

git clone https://github.com/willtheorangeguy/Python-Logo-Widgets
cd Python-Logo-Widgets
pip install -e .
pytest

No runtime dependencies; requirements.txt holds the tooling.

Layout

File Responsibility
widgets.py The three Frame subclasses
_compat.py The original function API, wrapping the classes
_demo.py The demo window
__main__.py python -m entry
imgs/ The three GIFs, plus an __init__.py so importlib.resources can address them

Tests

pytest
pytest tests/test_widgets.py -v

test_widgets.py covers the widget classes; test_compat.py the legacy functions.

Tkinter tests need a display. On a headless Linux runner:

xvfb-run -a pytest

Conventions

Adding a widget

Add the GIF to imgs/, add a class following the existing three, export it from __init__.py, and add a test. The shape is deliberate; keep it.

Before adding an image, note the trademark position on the ones already here — see internal/known-issues.md.

The str(files(...)) limitation

_load_image returns str(files(...).joinpath(name)), which assumes a real filesystem path. That holds for pip installs and not for a zipped package. importlib.resources.as_file() is the supported idiom and would need the path used inside a context manager. Same known-issues file.

Licence

GPL v3 for the code. The images are PSF trademarks under separate terms — contributions of code are GPL; contributions of trademarked artwork are a different question entirely.

Recording defects

Bugs found while working here go in internal/known-issues.md rather than being fixed in passing, unless fixing them is the job you are on.