-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathsetup.py
87 lines (77 loc) · 2.23 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
78
79
80
81
82
83
84
85
86
87
# Installation script for python
import os
import re
from setuptools import find_packages, setup
PACKAGE = "qibo"
# Returns the qibo version
def get_version():
"""Gets the version from the package's __init__ file
if there is some problem, let it happily fail"""
VERSIONFILE = os.path.join("src", PACKAGE, "__init__.py")
initfile_lines = open(VERSIONFILE).readlines()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
for line in initfile_lines:
mo = re.search(VSRE, line, re.M)
if mo:
return mo.group(1)
# load long description from README
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
# read Tensorflow version requirement
BACKENDFILE = os.path.join("src", PACKAGE, "config.py")
with open(BACKENDFILE) as f:
content = f.readlines()
for line in content:
if "TF_MIN_VERSION" in line:
TF_MIN_VERSION = str(line.split()[2].replace("'", ""))
break
setup(
name="qibo",
version=get_version(),
description="A framework for quantum computing with hardware acceleration.",
author="The Qibo team",
author_email="",
url="https://github.com/qiboteam/qibo",
packages=find_packages("src"),
package_dir={"": "src"},
package_data={"": ["*.out", "*.yml"]},
include_package_data=True,
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Physics",
],
install_requires=[
"scipy",
"sympy",
"cma",
"joblib",
"matplotlib",
"psutil",
"tabulate",
"nlopt",
],
extras_require={
"docs": [
"sphinx",
"furo",
"recommonmark",
"sphinxcontrib-bibtex",
"sphinx_markdown_tables",
"nbsphinx",
"IPython",
],
"tests": [
"pytest",
"pytest-cov",
"cirq",
"ply",
"scikit-learn",
"dill",
],
},
python_requires=">=3.7.0",
long_description=long_description,
long_description_content_type="text/markdown",
)