forked from tensorflow/probability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
111 lines (100 loc) · 3.71 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
# Copyright 2018 The TensorFlow Probability Authors.
#
# 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.
# ============================================================================
"""Install tensorflow_probability."""
import os
import sys
from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install as InstallCommandBase
from setuptools.dist import Distribution
# To enable importing version.py directly, we add its path to sys.path.
version_path = os.path.join(
os.path.dirname(__file__), 'tensorflow_probability', 'python')
sys.path.append(version_path)
from version import __version__ # pylint: disable=g-import-not-at-top
REQUIRED_PACKAGES = [
'six >= 1.10.0',
'numpy >= 1.13.3',
'decorator',
'cloudpickle == 1.3', # TODO(b/155109696): Unpin cloudpickle version.
'gast >= 0.3.2', # For autobatching
'dm-tree' # For NumPy/JAX backends (hence, also for prefer_static)
]
if '--release' in sys.argv:
release = True
sys.argv.remove('--release')
else:
# Build a nightly package by default.
release = False
if release:
project_name = 'tensorflow-probability'
else:
project_name = 'tfp-nightly'
if release:
TFDS_PACKAGE = 'tensorflow-datasets >= 2.2.0'
else:
TFDS_PACKAGE = 'tfds-nightly'
class BinaryDistribution(Distribution):
"""This class is needed in order to create OS specific wheels."""
def has_ext_modules(self):
return False
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name=project_name,
version=__version__,
description='Probabilistic modeling and statistical '
'inference in TensorFlow',
long_description=long_description,
long_description_content_type='text/markdown',
author='Google LLC',
author_email='[email protected]',
url='http://github.com/tensorflow/probability',
license='Apache 2.0',
packages=find_packages(),
install_requires=REQUIRED_PACKAGES,
# Add in any packaged data.
include_package_data=True,
package_data={'': ['*.so']},
exclude_package_data={'': ['BUILD', '*.h', '*.cc']},
zip_safe=False,
distclass=BinaryDistribution,
cmdclass={
'pip_pkg': InstallCommandBase,
},
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='tensorflow probability statistics bayesian machine learning',
extras_require={ # e.g. `pip install tfp-nightly[jax]`
'jax': ['jax', 'jaxlib'],
'tfds': [TFDS_PACKAGE],
}
)