How to Override a Package’s __init__.py Without Breaking Submodule Imports in Python?
I’m working on a project where I need to override files located in the ./lib/python3.9/site-packages” directory. I have the following hook that does just that using importlib.util
and sys.meta_path.insert
: