-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Copy pathsetup.py
104 lines (92 loc) · 3.96 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
# Copyright 2017 Google Inc. 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 Serving Python API.
TensorFlow Serving is a flexible, high-performance serving system for machine
learning models, designed for production environments.TensorFlow Serving makes
it easy to deploy new algorithms and experiments, while keeping the same server
architecture and APIs. TensorFlow Serving provides out-of-the-box integration
with TensorFlow models, but can be easily extended to serve other types of
models and data.
This package contains the TensorFlow Serving Python APIs.
"""
import sys
from setuptools import find_packages
from setuptools import setup
DOCLINES = __doc__.split('\n')
# Set when releasing a new version of TensorFlow Serving (e.g. 1.0.0).
_VERSION = '0.0.0'
# Have this by default be open; releasing a new version will lock to TF version
_TF_VERSION = '>=1.2.0,<3'
_TF_VERSION_SANITIZED = _TF_VERSION.replace('-', '')
project_name = 'tensorflow-serving-api'
# Set when building the pip package
if '--project_name' in sys.argv:
project_name_idx = sys.argv.index('--project_name')
project_name = sys.argv[project_name_idx + 1]
sys.argv.remove('--project_name')
sys.argv.pop(project_name_idx)
_TF_REQ = ['tensorflow'+_TF_VERSION_SANITIZED]
# GPU build (note: the only difference is we depend on tensorflow-gpu so
# pip doesn't overwrite it with the CPU build. And tensorflow-gpu has been the
# same package starting v2.1 according to
# https://pypi.org/project/tensorflow-gpu/2.12.0/, so only check against TF
# versions prior to v2.1.)
if (
'tensorflow-serving-api-gpu' in project_name
and _VERSION < '2.1'
and _VERSION != '0.0.0'
):
_TF_REQ = ['tensorflow-gpu'+_TF_VERSION_SANITIZED]
REQUIRED_PACKAGES = [
# Match versions to what TF needs here:
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py
'grpcio >= 1.24.3, < 2.0',
'protobuf>=3.20.3,<5.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5',
] + _TF_REQ
setup(
name=project_name,
version=_VERSION.replace('-', ''),
author='Google Inc.',
author_email='[email protected]',
packages=find_packages(),
description=DOCLINES[0],
long_description='\n'.join(DOCLINES[2:]),
license='Apache 2.0',
url='http://tensorflow.org/serving',
keywords='tensorflow serving machine learning api libraries',
install_requires=REQUIRED_PACKAGES,
# Supported Python versions. Match to what TF needs here:
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py
python_requires='>=3.9',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3 :: Only',
'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',
],
extras_require={
'lint': ['pre-commit'],
},
)