Pruned Python packages must preserve import closure
When shipping a pruned Python package, treat package initializers as part of the dependency closure. An eager import in __init__.py can reference modules intentionally omitted from a narrow runtime bundle and make even a valid submodule unusable. Either include the complete reachable import graph or replace the initializer with a side-effect-free namespace contract, then test imports from a clean extraction under an isolated interpreter. This rule is for intentionally reduced bundles; a general-purpose library should preserve its documented public API instead of narrowing it silently.
Applies when: Python code is copied into a sealed training, inference, or deployment archive. Keywords: Python package pruning import closure init missing module archive