Switch svgutils to drawsvg; migrate package management to uv - #76
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
svgutilsis unmaintained; this switchesoverlayCartoonintensorpack/test/common.pyto usedrawsvginstead. The base figure and cartoon SVGs are parsed and their inner markup composed withdrawsvg'sDrawing/Group/Rawprimitives, replicating the sametranslate/scaletransform semanticssvgutilspreviously produced. (Note:overlayCartoondoesn't appear to be called anywhere in this repo currently, but it's part of the public module.)pyproject.tomlto PEP 621 with ahatchlingbuild backend, replacespoetry.lockwithuv.lock, and updatesmakefileand.github/workflows/pytest.ymlto useuv run/uv sync.tensordatagit dev dependency is pinned to the last commit (7c52287) before it bumped itsrequires-pythonto>=3.14, which is outside this project's supported range (>=3.11,<3.13); tracking the floatingmainbranch broke lockfile resolution.Fixes meyer-lab/lab-internals#68
Test plan
uv lock/uv syncresolve and install cleanlyoverlayCartoonagainst a real SVG figure + cartoon and visually verified the composited outputuv 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 incoupled.py, and reproduces consistently on this branch due to newer resolvednumpy/scipy/scikit-learnversions — not something introduced by the svgutils/uv migration.