diff --git a/changedetectionio/api/__init__.py b/changedetectionio/api/__init__.py index 2a7f7125..b8d14e55 100644 --- a/changedetectionio/api/__init__.py +++ b/changedetectionio/api/__init__.py @@ -38,16 +38,9 @@ def get_openapi_spec(): spec_path = os.path.join(os.path.dirname(__file__), '../../docs/api-spec.yaml') if not os.path.exists(spec_path): - # Possibly for pip3 packages (will be shipped with the package) + # Possibly for pip3 packages spec_path = os.path.join(os.path.dirname(__file__), '../docs/api-spec.yaml') - - # 3. Last resort: check if it's in the package root for pip/PyPI installations - if not os.path.exists(spec_path): - import changedetectionio - package_root = os.path.dirname(os.path.dirname(changedetectionio.__file__)) - spec_path = os.path.join(package_root, 'docs/api-spec.yaml') - with open(spec_path, 'r') as f: spec_dict = yaml.safe_load(f) _openapi_spec = OpenAPI.from_dict(spec_dict)