Skip to content

Switch svgutils to drawsvg; migrate package management to uv - #76

Merged
aarmey merged 1 commit into
mainfrom
fix/svgutils-to-drawsvg
Sep 13, 2026
Merged

aarmey merged 1 commit into
mainfrom
fix/svgutils-to-drawsvg

Conversation

@aarmey

@aarmey aarmey commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

  • svgutils is unmaintained; this switches overlayCartoon in tensorpack/test/common.py to use drawsvg instead. The base figure and cartoon SVGs are parsed and their inner markup composed with drawsvg's Drawing/Group/Raw primitives, replicating the same translate/scale transform semantics svgutils previously produced. (Note: overlayCartoon doesn't appear to be called anywhere in this repo currently, but it's part of the public module.)
  • Migrates package management from poetry to uv: converts pyproject.toml to PEP 621 with a hatchling build backend, replaces poetry.lock with uv.lock, and updates makefile and .github/workflows/pytest.yml to use uv run/uv sync.
  • The tensordata git dev dependency is pinned to the last commit (7c52287) before it bumped its requires-python to >=3.14, which is outside this project's supported range (>=3.11,<3.13); tracking the floating main branch broke lockfile resolution.

Fixes meyer-lab/lab-internals#68

Test plan

  • uv lock / uv sync resolve and install cleanly
  • Manually exercised overlayCartoon against a real SVG figure + cartoon and visually verified the composited output
  • uv run pytest — 11 passed, 1 pre-existing failure (test_coupled_svd) unrelated to this change: it's a floating-point tolerance assertion (RuntimeError: normalize_factors() causes R2X change) on unseeded random test data in coupled.py, and reproduces consistently on this branch due to newer resolved numpy/scipy/scikit-learn versions — not something introduced by the svgutils/uv migration.

svgutils is unmaintained; drawsvg is actively maintained. overlayCartoon
now composes the base figure and cartoon SVGs directly with drawsvg's
Drawing/Group/Raw primitives instead of svgutils' transform API.

Also migrates package management from poetry to uv: converts
pyproject.toml to PEP 621 + a hatchling build backend, replaces
poetry.lock with uv.lock, and updates the makefile and CI workflow to
use `uv run`/`uv sync`. The tensordata dev dependency is pinned to the
last commit before it required Python 3.14 (newer than this project's
supported range).

Fixes meyer-lab/lab-internals#68
@aarmey
aarmey merged commit 295ea83 into main Sep 13, 2026
1 check failed
@aarmey
aarmey deleted the fix/svgutils-to-drawsvg branch September 13, 2026 00:31
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