forked from unitaryfund/mitiq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
75 lines (64 loc) · 2.44 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
# Copyright (C) Unitary Fund
#
# This source code is licensed under the GPL license (v3) found in the
# LICENSE file in the root directory of this source tree.
from setuptools import find_packages, setup
def load_requirements(filename):
with open(f"requirements/{filename}", "r") as file:
return file.read().splitlines()
with open("INTEGRATIONS.txt", "r") as f:
integrations = f.read().splitlines()
with open("VERSION.txt", "r") as f:
__version__ = f.read().strip()
# save the source code in _version.py
with open("mitiq/_version.py", "r") as f:
version_file_source = f.read()
# overwrite _version.py in the source distribution
with open("mitiq/_version.py", "w") as f:
f.write(f"__version__ = '{__version__}'\n")
third_party_integration_requirements = {
k: load_requirements(f"requirements-{k}.txt") for k in integrations
}
setup(
name="mitiq",
version=__version__,
install_requires=load_requirements("requirements.txt"),
extras_require={
"development": set().union(
*third_party_integration_requirements.values(),
load_requirements("requirements-dev.txt"),
)
}
| third_party_integration_requirements,
packages=find_packages(),
include_package_data=True,
description="Mitiq is an open source toolkit for implementing error "
"mitigation techniques on most current intermediate-scale quantum "
"computers.",
long_description=open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
author="Unitary Fund",
author_email="[email protected]",
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Compilers",
"Typing :: Typed",
],
license="GPL v3.0",
url="https://unitary.fund",
project_urls={
"Bug Tracker": "https://github.com/unitaryfund/mitiq/issues/",
"Documentation": "https://mitiq.readthedocs.io/en/stable/",
"Source": "https://github.com/unitaryfund/mitiq/",
},
python_requires=">=3.10,<3.13",
)
# restore _version.py to its previous state
with open("mitiq/_version.py", "w") as f:
f.write(version_file_source)