-
-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathfind-pyperformance.py
More file actions
25 lines (22 loc) · 806 Bytes
/
find-pyperformance.py
File metadata and controls
25 lines (22 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sys
try:
import pyperformance
except ModuleNotFoundError:
sys.exit(0)
else:
print(pyperformance.PKG_ROOT)
# Make sure pyperformance.PKG_ROOT matches expectations.
import os.path
datadir = os.path.dirname(os.path.abspath(__file__))
testsroot = os.path.dirname(datadir)
pkgroot = os.path.dirname(testsroot)
reporoot = os.path.realpath(os.path.dirname(pkgroot))
marker = os.path.join(reporoot, "pyproject.toml")
if not os.path.exists(marker):
sys.exit(f"ERROR: pyperformance is not an editable install ({reporoot})")
actual = os.path.realpath(os.path.abspath(pyperformance.PKG_ROOT))
if actual != os.path.join(reporoot, "pyperformance"):
print("ERROR: mismatch on pyperformance repo root:")
print(f" actual: {actual}")
print(f" expected: {reporoot}")
sys.exit(1)