-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsetup.py
53 lines (44 loc) · 1.43 KB
/
setup.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import setuptools
import ml4chem
import pip
try:
with open("README.md", "r") as fh:
long_description = fh.read()
except FileNotFoundError:
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
with open(dir_path + "/README.md", "r") as fh:
long_description = fh.read()
# Load requirements from requirements.txt
try:
# for pip >= 10
from pip._internal.req import parse_requirements
except ImportError:
# for pip <= 9.0.3
from pip.req import parse_requirements
def load_requirements(fname):
reqs = parse_requirements(fname, session="test")
return [str(ir.req) for ir in reqs]
version = ml4chem.__version__
try:
install_requires = load_requirements("requirements.txt")
except pip._internal.exceptions.InstallationError:
install_requires = load_requirements("../requirements.txt")
setuptools.setup(
name="ml4chem",
version=version,
author="Muammar El Khatib",
description="Machine learning for chemistry and materials.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/muammar/ml4chem",
packages=setuptools.find_packages(),
install_requires=install_requires,
scripts=["bin/ml4chem"],
data_files=[("", ["LICENSE"])],
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
)