Skip to content

Build: Remove Matplotlib runtime dependency - #535

Merged
Minseok Song (skytin1004) merged 1 commit into
Azure:mainfrom
skytin1004:build/remove-matplotlib-runtime
Sep 17, 2026
Merged

Minseok Song (skytin1004) merged 1 commit into
Azure:mainfrom
skytin1004:build/remove-matplotlib-runtime

Conversation

@skytin1004

@skytin1004 Minseok Song (skytin1004) commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Remove a runtime dependency that is not part of translation. Matplotlib and five packages from its dependency chain were installed only to render two optional debugging previews.

Pillow is already required for image translation, and its Image.show() API is intended for debugging displays. Using that existing dependency keeps the previews while reducing the default installation footprint.

Description

  • Build the same labeled, side-by-side image comparisons with Pillow and open them through the system image viewer.
  • Flatten transparent RGBA and palette images onto white so their preview matches the visible image instead of exposing hidden RGB values.
  • Reserve enough space for each title so labels do not overlap on narrow images.
  • Close source image files through context managers after composing the in-memory preview.
  • Remove Matplotlib, contourpy, cycler, fonttools, kiwisolver, and pyparsing from the runtime dependency manifests.
  • Add regression coverage for preview behavior and importing without Matplotlib.

Official Pillow references:

Related Issue

None.

Does this introduce a breaking change?

Will this change require users to update commands, configuration, environment variables, generated translation output, or public Python/MCP APIs?
If you're not sure, test the affected CLI, API, documentation, or GitHub Actions workflow before marking this as "No."

  • Yes
  • No

Type of change

  • Bugfix
  • Feature
  • Code style update (e.g., formatting, local variables)
  • Refactoring (no functional or API changes)
  • Documentation content changes
  • Other: runtime dependency cleanup

Checklist

Before submitting your pull request, please confirm the following:

  • I have thoroughly tested my changes: I confirm that I have run the code and manually tested all affected areas.
  • All existing tests pass: I have run all tests and confirmed that nothing is broken.
  • I have added new tests (if applicable): I have written tests that cover the new functionality introduced by my code changes.
  • I have followed the Co-op Translator coding conventions: My code adheres to the style guide and coding conventions outlined in the repository.
  • I have documented my changes (if applicable): No user-facing commands, configuration, or APIs changed, so no documentation update is required.

Additional context

A clean Python 3.12 runtime installation measured 469.6 MiB in site-packages on the base revision and 441.1 MiB on this branch, a 28.5 MiB reduction. The regenerated lock and runtime requirements remove six packages.

Validation completed:

  • 417 passed, 50 warnings with API-key tests excluded.
  • 17 passed for image-preview and dependency-manifest coverage.
  • Black, Ruff, and mypy passed on the changed Python files.
  • poetry check --lock, git diff --check, and uv pip check passed.
  • A rebuilt wheel contains no Requires-Dist: matplotlib metadata.
  • Manually inspected an RGB/RGBA comparison generated by the final helper.

@github-actions github-actions Bot added documentation Improvements or additions to documentation build Related to the build process, dependency management, and CI/CD configurations tests labels Sep 16, 2026
@skytin1004
Minseok Song (skytin1004) force-pushed the build/remove-matplotlib-runtime branch from 51b0d67 to 90c2390 Compare September 16, 2026 14:40
@skytin1004
Minseok Song (skytin1004) marked this pull request as ready for review September 17, 2026 04:44
@skytin1004
Minseok Song (skytin1004) merged commit 8e82fdc into Azure:main Sep 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Related to the build process, dependency management, and CI/CD configurations documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant