diff --git a/my/core/__init__.py b/my/core/__init__.py index 78e20e7..a7af46c 100644 --- a/my/core/__init__.py +++ b/my/core/__init__.py @@ -37,3 +37,13 @@ __all__ = [ 'dataclass', 'Path', ] + + +## experimental for now +# you could put _init_hook.py next to your private my/config +# that way you can configure logging/warnings/env variables on every HPI import +try: + import my._init_hook # type: ignore[import] +except: + pass +## diff --git a/my/core/init.py b/my/core/init.py index 2e47e87..6bf766e 100644 --- a/my/core/init.py +++ b/my/core/init.py @@ -1,5 +1,6 @@ ''' A hook to insert user's config directory into Python's search path. +Note that this file is imported only if we don't have custom user config (under my.config namespace) in PYTHONPATH Ideally that would be in __init__.py (so it's executed without having to import explicitly) But, with namespace packages, we can't have __init__.py in the parent subpackage