forked from metatensor/metatomic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
32 lines (23 loc) · 1.12 KB
/
setup.py
File metadata and controls
32 lines (23 loc) · 1.12 KB
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
29
30
31
32
import os
from setuptools import setup
ROOT = os.path.realpath(os.path.dirname(__file__))
METATOMIC_TORCH = os.path.join(ROOT, "python", "metatomic_torch")
METATOMIC_TORCHSIM = os.path.join(ROOT, "python", "metatomic_torchsim")
if __name__ == "__main__":
extras_require = {}
# when packaging a sdist for release, we should never use local dependencies
METATOMIC_NO_LOCAL_DEPS = os.environ.get("METATOMIC_NO_LOCAL_DEPS", "0") == "1"
if not METATOMIC_NO_LOCAL_DEPS and os.path.exists(METATOMIC_TORCH):
# we are building from a git checkout
extras_require["torch"] = f"metatomic-torch @ file://{METATOMIC_TORCH}"
else:
# we are building from a sdist/installing from a wheel
extras_require["torch"] = "metatomic-torch"
if not METATOMIC_NO_LOCAL_DEPS and os.path.exists(METATOMIC_TORCHSIM):
extras_require["torchsim"] = f"metatomic-torchsim @ file://{METATOMIC_TORCHSIM}"
else:
extras_require["torchsim"] = "metatomic-torchsim"
setup(
author=", ".join(open(os.path.join(ROOT, "AUTHORS")).read().splitlines()),
extras_require=extras_require,
)