Skip to content

fix: recognize Python compatibility import entry points - #690

Open
ApexWorm wants to merge 1 commit into
peteromallet:mainfrom
ApexWorm:fix/orphaned-compat-aliases
Open

fix: recognize Python compatibility import entry points#690
ApexWorm wants to merge 1 commit into
peteromallet:mainfrom
ApexWorm:fix/orphaned-compat-aliases

Conversation

@ApexWorm

@ApexWorm ApexWorm commented Aug 1, 2026

Copy link
Copy Markdown

Problem

Python orphan detection only followed literal importlib.import_module calls. It therefore flagged physical install_legacy_module_alias(name, canonical) wrappers and child modules selected from a static lazy package export map as orphaned despite their runtime import contracts.

Fix

  • Treat top-level explicit legacy-module-alias wrappers as import entry points.
  • Follow from-importlib import_module bindings and literal getattr lazy-export maps of the form f"{name}.{module_name}".
  • Add focused detector and integration regressions.

Verification

  • python -m pytest -q -p no:cacheprovider -o addopts='' desloppify/languages/python/tests/test_py_deps.py desloppify/tests/detectors/test_orphaned.py (84 passed)
  • ruff check and format checks on changed files
  • Direct detector checks against the downstream MonoRepo no longer report its invite-code lazy export or two explicit contracts compatibility aliases.

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