-
Notifications
You must be signed in to change notification settings - Fork 351
/
Copy pathsetup.py
115 lines (97 loc) · 3.63 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
# coding=utf-8
# Copyright 2024 TF.Text 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.
"""TF.Text is a TensorFlow library of text related ops, modules, and subgraphs.
TF.Text is a TensorFlow library of text related ops, modules, and subgraphs. The
library can perform the preprocessing regularly required by text-based models,
and includes other features useful for sequence modeling not provided by core
TensorFlow.
See the README on GitHub for further documentation.
http://github.com/tensorflow/text
"""
import os
from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install
from setuptools.dist import Distribution
project_name = 'tensorflow-text'
project_version = '2.13.0'
class BinaryDistribution(Distribution):
"""This class is needed in order to create OS specific wheels."""
def is_pure(self):
return False
def has_ext_modules(self):
return True
class InstallPlatlib(install):
"""This is needed to set the library to platlib compliant."""
def finalize_options(self):
"""For more info; see http://github.com/google/or-tools/issues/616 ."""
install.finalize_options(self)
self.install_lib = self.install_platlib
self.install_libbase = self.install_lib
self.install_lib = os.path.join(self.install_lib, self.extra_dirs)
DOCLINES = __doc__.split('\n')
setup(
name=project_name,
version=project_version.replace('-', ''),
description=DOCLINES[0],
long_description='\n'.join(DOCLINES[2:]),
author='Google Inc.',
url='http://github.com/tensorflow/text',
license='Apache 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
cmdclass={'install': InstallPlatlib},
distclass=BinaryDistribution,
install_requires=[
(
'tensorflow>=2.15.0, <2.16; platform_machine != "arm64" or'
' platform_system != "Darwin"'
),
(
'tensorflow-macos>=2.15.0, <2.16; platform_machine == "arm64" and'
' platform_system == "Darwin"'
),
],
extras_require={
'tensorflow_cpu': [
'tensorflow-cpu>=2.15.0, <2.16',
],
'tests': [
'absl-py',
'pytest',
'tensorflow-datasets>=3.2.0',
],
},
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.11',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='tensorflow text machine learning',
)