-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup.py
77 lines (69 loc) · 2.52 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import os
import sys
import re
import subprocess as sp
import shutil
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
# module's descriptor
module_name = "dqc"
github_url = "https://github.com/diffqc/dqc/tree/master/"
raw_github_url = "https://raw.githubusercontent.com/diffqc/dqc/master/"
file_dir = os.path.dirname(os.path.realpath(__file__))
absdir = lambda p: os.path.join(file_dir, p)
# get the long description from README
# open readme and convert all relative path to absolute path
with open("README.md", "r") as f:
long_desc = f.read()
link_pattern = re.compile(r"\]\(([\w\-/]+)\)")
img_pattern = re.compile(r"\]\(([\w\-/\.]+)\)")
link_repl = r"](%s\1)" % github_url
img_repl = r"](%s\1)" % raw_github_url
long_desc = re.sub(link_pattern, link_repl, long_desc)
long_desc = re.sub(img_pattern, img_repl, long_desc)
############### versioning ###############
verfile = os.path.abspath(os.path.join(module_name, "_version.py"))
version = {"__file__": verfile}
with open(verfile, "r") as fp:
exec(fp.read(), version)
# execute _version.py to create _version.txt
cmd = [sys.executable, verfile]
sp.run(cmd)
vers = version["get_version"]()
setup(
name=module_name,
version=vers,
description='Differentiable Quantum Chemistry',
url='https://github.com/diffqc/dqc/',
long_description=long_desc,
long_description_content_type="text/markdown",
author='mfkasim1',
author_email='[email protected]',
license='Apache License 2.0',
packages=find_packages(),
package_data={module_name: ["_version.txt", "datasets/lebedevquad/lebedev_*.txt"]},
python_requires=">=3.7",
install_requires=[
"numpy>=1.8.2",
"scipy>=0.15",
"basis_set_exchange",
"h5py==3.1.0", # temporary == because pyscf 1.7.6 is not compatible to 3.4.0
"pylibxc2>=6.0.0",
"dqclibs>=0.1.0",
"xitorch>=0.3",
"torch>=1.8", # ideally the nightly build
],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Mathematics",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
keywords="project library deep-learning dft quantum-chemistry",
zip_safe=False
)