Skip to content

Commit 1394b51

Browse files
committed
fix: Handle when BUNDLED_SCHEMA_PATH resolves to site-packages...
instead of the repo root.
1 parent d964299 commit 1394b51

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/check_schema_compatibility.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818

1919
GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"
2020
REPO_ROOT = Path(__file__).parent.parent
21-
SCHEMA_RELATIVE_PATH = BUNDLED_SCHEMA_PATH.relative_to(REPO_ROOT)
21+
try:
22+
SCHEMA_RELATIVE_PATH = BUNDLED_SCHEMA_PATH.relative_to(REPO_ROOT)
23+
except ValueError:
24+
# When installed as a package, the schema lives in site-packages, not the repo.
25+
SCHEMA_RELATIVE_PATH = Path("openhexa/graphql/schema.generated.graphql")
2226

2327
PRODUCTION_URL = "https://api.openhexa.org"
2428

0 commit comments

Comments
 (0)