Problem
Integration.load() without a config_path argument uses a hardcoded 3-level-up path resolution from the SDK's own integration.py:
# src/autohive_integrations_sdk/integration.py
if config_path is None:
config_path = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
'config.json'
)
This only resolves to the integration's config.json when the SDK is vendored via pip install -r requirements.txt --target dependencies, placing the SDK at dependencies/autohive_integrations_sdk/integration.py (3 levels up = integration root).
With a standard pip install into a venv, the SDK lands in .venv/lib/python3.13/site-packages/autohive_integrations_sdk/integration.py, and 3 levels up resolves to .venv/lib/ — not the integration root. This raises a ConfigurationError.
Current workarounds
- Vendored install:
pip install -r requirements.txt --target dependencies — works but is a legacy pattern we're moving away from.
- Explicit path:
Integration.load(os.path.join(os.path.dirname(__file__), "config.json")) — works everywhere but triggers an advisory warning in CI tooling, which checks for the literal string Integration.load().
Impact
- The
samples/template/ README tells users to run pip install -r requirements.txt (no --target), but the template code uses Integration.load() (no args). These are incompatible.
- Documentation recommends
Integration.load() for single-file integrations, but this silently depends on the vendored install pattern.
- Multi-file integrations already use explicit
config_path, so they're unaffected.
Suggested fix
Update the default path resolution to locate config.json relative to the calling module (e.g., using inspect.stack() or requiring the caller to pass __file__), rather than relative to the SDK's own source file. This would make Integration.load() work regardless of how the SDK is installed.
Discovered during the documentation unification audit (see integrations-sdk#13, integrations-sdk#15).
Problem
Integration.load()without aconfig_pathargument uses a hardcoded 3-level-up path resolution from the SDK's ownintegration.py:This only resolves to the integration's
config.jsonwhen the SDK is vendored viapip install -r requirements.txt --target dependencies, placing the SDK atdependencies/autohive_integrations_sdk/integration.py(3 levels up = integration root).With a standard
pip installinto a venv, the SDK lands in.venv/lib/python3.13/site-packages/autohive_integrations_sdk/integration.py, and 3 levels up resolves to.venv/lib/— not the integration root. This raises aConfigurationError.Current workarounds
pip install -r requirements.txt --target dependencies— works but is a legacy pattern we're moving away from.Integration.load(os.path.join(os.path.dirname(__file__), "config.json"))— works everywhere but triggers an advisory warning in CI tooling, which checks for the literal stringIntegration.load().Impact
samples/template/README tells users to runpip install -r requirements.txt(no--target), but the template code usesIntegration.load()(no args). These are incompatible.Integration.load()for single-file integrations, but this silently depends on the vendored install pattern.config_path, so they're unaffected.Suggested fix
Update the default path resolution to locate
config.jsonrelative to the calling module (e.g., usinginspect.stack()or requiring the caller to pass__file__), rather than relative to the SDK's own source file. This would makeIntegration.load()work regardless of how the SDK is installed.Discovered during the documentation unification audit (see integrations-sdk#13, integrations-sdk#15).