-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetup.py
More file actions
28 lines (23 loc) · 782 Bytes
/
setup.py
File metadata and controls
28 lines (23 loc) · 782 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
26
27
28
import os
import sys
import platform
from setuptools import setup
python_version = platform.python_version()
version_detail = sys.version_info
version = str(version_detail[0]) + "." + str(version_detail[1])
env_version = os.getenv("PY_VERSION", None)
if version_detail < (3, 8):
raise RuntimeError(
f"Athena only supports Python version >= 3.8 now,"
f"you are using Python {python_version}"
)
elif env_version is None:
print(f"export PY_VERSION = { version }")
os.environ["PY_VERSION"] = python_version
elif env_version != version:
raise ValueError(
f"You have set the PY_VERSION environment variable to {env_version}, but "
f"your current Python version is {version}, "
f"Please keep them consistent."
)
setup()