forked from tensorflow/quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
115 lines (96 loc) · 3.98 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""TensorFlow Quantum adds qauntum computing primitives to TensorFlow.
TensorFlow Quantum is an open source library for high performance batch
quantum computation on quantum simulators and quantum computers. The goal
of TensorFlow Quantum is to help researchers develop a deeper understanding
of quantum data and quantum systems via hybrid models.
TensorFlow Quantum was created in an ongoing collaboration between the
University of Waterloo and the Quantum AI team at Google along with help from
many other contributors within Google.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from datetime import date
from setuptools import Extension
from setuptools import find_packages
from setuptools import setup
from setuptools.dist import Distribution
from setuptools.command.install import install
DOCLINES = __doc__.split('\n')
class InstallPlatlib(install):
"""Workaround so .so files in generated wheels
can be seen by auditwheel."""
def finalize_options(self):
install.finalize_options(self)
if self.distribution.has_ext_modules():
self.install_lib = self.install_platlib
REQUIRED_PACKAGES = ['cirq-core==1.3.0', 'cirq-google==1.3.0', 'sympy == 1.12']
# placed as extra to not have required overwrite existing nightly installs if
# they exist.
EXTRA_PACKAGES = ['tensorflow == 2.15.0']
CUR_VERSION = '0.7.4'
class BinaryDistribution(Distribution):
"""This class is needed in order to create OS specific wheels."""
def has_ext_modules(self):
return True
nightly = False
if '--nightly' in sys.argv:
nightly = True
sys.argv.remove('--nightly')
project_name = 'tensorflow-quantum'
build_version = CUR_VERSION
if nightly:
project_name = 'tfq-nightly'
build_version = CUR_VERSION + '.dev' + str(date.today()).replace('-', '')
setup(
name=project_name,
version=build_version,
description=
'TensorFlow Quantum is a library for hybrid quantum-classical machine learning.',
long_description='\n'.join(DOCLINES[2:]),
author='Google Inc.',
author_email='[email protected]',
url='https://github.com/tensorflow/quantum/',
packages=find_packages(),
install_requires=REQUIRED_PACKAGES,
extras_require={'extras': EXTRA_PACKAGES},
# Add in any packaged data.
include_package_data=True,
#ext_modules=[Extension('_foo', ['stub.cc'])],
zip_safe=False,
distclass=BinaryDistribution,
# PyPI package information.
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Physics',
],
license='Apache 2.0',
keywords='tensorflow machine learning quantum qml',
cmdclass={'install': InstallPlatlib})