Skip to content

BUG: fix Python 3.12+ compatibility via importlib.metadata#8

Open
jotelha wants to merge 3 commits into
masterfrom
bug/python312-importlib-metadata-compat
Open

BUG: fix Python 3.12+ compatibility via importlib.metadata#8
jotelha wants to merge 3 commits into
masterfrom
bug/python312-importlib-metadata-compat

Conversation

@jotelha
Copy link
Copy Markdown
Member

@jotelha jotelha commented May 14, 2026

Summary

  • Replace from pkg_resources import iter_entry_points with an importlib.metadata shim — pkg_resources is no longer bundled with Python 3.12+ by default, breaking every downstream package that imports dtool-cli
  • Add pyproject.toml for modern pip build system compatibility
  • Defer pretty_version_text() evaluation to avoid import-time failure in PyInstaller environments

Johannes Laurin Hoermann added 3 commits March 26, 2026 12:17
… compat

pkg_resources is no longer bundled by default with Python 3.12+ (it requires
setuptools to be installed explicitly). Use importlib.metadata.entry_points
as the primary implementation and fall back to pkg_resources for older Python
versions where importlib.metadata may not be available.
…staller

pretty_version_text() is called as a default argument at module import
time. It invokes iter_entry_points() and __import__() on storage broker
packages, which fails in PyInstaller's isolated analysis subprocess where
no entry points are registered. This causes PyInstaller to silently exclude
dtool_cli.cli from the bundle.

Defer the call using sys._MEIPASS check so it only runs when the CLI
is actually invoked, not during bundled-app import.
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