Skip to content

Cleanup: unused imports, encoding docstring/assert, Docker diffusers pin - #409

Merged
dylanuys merged 2 commits into
mainfrom
chore/cheap-cleanups
Jul 9, 2026
Merged

Cleanup: unused imports, encoding docstring/assert, Docker diffusers pin#409
dylanuys merged 2 commits into
mainfrom
chore/cheap-cleanups

Conversation

@dylanuys

@dylanuys dylanuys commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

A batch of low-risk cleanups from the remaining correctness/hygiene items. No behavior change in normal operation.

  • Unused importsruff --fix removed 67 unused imports across gas/, neurons/, and tests/ (F401). The four package __init__.py files re-export public API but lacked __all__, so their imports read as unused; added explicit __all__ lists (verified against F822) rather than deleting the re-exports.
  • encoding.pymedia_to_bytes docstring claimed PNG/AVI output and image/png/video/avi mime types; the code JPEG-encodes images and MP4-encodes video. Corrected. Also replaced an assert used for input validation (stripped under python -O) with a ValueError.
  • Dockerfile — was installing diffusers from git master on top of the pinned diffusers==0.36.0, so Docker images ran a different diffusers than bare-metal installs and the lockfile. Dropped the git override (0.36.0 is already installed via the package). Janus and CLIP stay on git — they aren't available as suitable PyPI releases.

Not included

The content_manager.py tab→space reformat is deferred to its own style: PR — ruff-format produces an ~1800-line diff and needs a .git-blame-ignore-revs entry, so it doesn't belong mixed in here.

Test plan

  • pytest tests/ — 37 passed
  • ruff check (E9/F-series) — clean
  • Docker image build sanity before next release (diffusers change)

🤖 Generated with Claude Code

dylanuys added 2 commits July 8, 2026 23:39
- media_to_bytes docstring claimed PNG/AVI and 'image/png'/'video/avi';
  the code JPEG-encodes images and MP4-encodes video. Corrected.
- video_to_bytes used 'assert video.max() <= 1.0' for input validation,
  which is stripped under python -O; replaced with a ValueError.
- Dockerfile installed diffusers from git master on top of the pinned
  diffusers==0.36.0, so Docker validators ran a different diffusers than
  bare-metal (install.sh) and the lockfile. Dropped the git override;
  0.36.0 is already installed via 'uv pip install -e .'. Janus and CLIP
  stay on git (not available as suitable PyPI releases).
- ruff --fix removed 64 unused imports across gas/ and neurons/ module
  bodies (no behavior change; F401).
- The four package __init__.py files re-export public API but had no
  __all__, so those imports read as 'unused'. Added explicit __all__
  lists (verified against F822) — documents the public surface and lets
  ruff's default rules run clean.

Also deleted untracked working-tree litter (cli.py copy, #VEr#,
verification_ideass.txt, pr_description.md, stale emacs autosave).
@dylanuys
dylanuys merged commit e0fb2fa into main Jul 9, 2026
2 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.

1 participant