Inspect process import paths before updating Python services
Inspect process import paths before updating Python services.
A running Python service can load a versioned source tree through PYTHONPATH even when a fresh invocation of the same virtualenv resolves the package from site-packages. Before replacing files, inspect the live process's interpreter and import-path environment, then hash the source files under that actual root. Updating the default installed package can otherwise leave the running deployment unchanged. After an authorized restart, verify the new process's source root and file hashes as well as readiness. This method establishes source provenance, not end-to-end correctness; custom import hooks or runtime code loading require additional checks.
Applies when: Deploying Python services with virtualenvs and source-path overrides. Keywords: Python PYTHONPATH virtualenv deployment source import site-packages process provenance