github.com/alwaysproblem/mlserving-tutorial@v0.0.0-20221124033215-121cfddbfbf4/TFserving/CustomOp/custom-op/setup.py (about)

     1  # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  # ==============================================================================
    15  """Setup for pip package."""
    16  from __future__ import absolute_import
    17  from __future__ import division
    18  from __future__ import print_function
    19  
    20  from setuptools import find_packages
    21  from setuptools import setup
    22  from setuptools.dist import Distribution
    23  from setuptools.command.install import install
    24  
    25  __version__ = '0.0.1'
    26  REQUIRED_PACKAGES = [
    27      'tensorflow >= 2.1.0',
    28  ]
    29  project_name = 'tensorflow-custom-ops'
    30  
    31  
    32  class InstallPlatlib(install):
    33  
    34    def finalize_options(self):
    35      install.finalize_options(self)
    36      self.install_lib = self.install_platlib
    37  
    38  
    39  class BinaryDistribution(Distribution):
    40    """This class is needed in order to create OS specific wheels."""
    41  
    42    def has_ext_modules(self):
    43      return True
    44  
    45    def is_pure(self):
    46      return False
    47  
    48  
    49  setup(
    50      name=project_name,
    51      version=__version__,
    52      description=(
    53          'tensorflow-custom-ops is an examples for custom ops for TensorFlow'
    54      ),
    55      author='Google Inc.',
    56      author_email='opensource@google.com',
    57      # Contained modules and scripts.
    58      packages=find_packages(),
    59      install_requires=REQUIRED_PACKAGES,
    60      # Add in any packaged data.
    61      include_package_data=True,
    62      zip_safe=False,
    63      distclass=BinaryDistribution,
    64      cmdclass={'install': InstallPlatlib},
    65      # PyPI package information.
    66      classifiers=[
    67          'Development Status :: 4 - Beta',
    68          'Intended Audience :: Developers',
    69          'Intended Audience :: Education',
    70          'Intended Audience :: Science/Research',
    71          'License :: OSI Approved :: Apache Software License',
    72          'Programming Language :: Python :: 2.7',
    73          'Programming Language :: Python :: 3.4',
    74          'Programming Language :: Python :: 3.5',
    75          'Programming Language :: Python :: 3.6',
    76          'Topic :: Scientific/Engineering :: Mathematics',
    77          'Topic :: Software Development :: Libraries :: Python Modules',
    78          'Topic :: Software Development :: Libraries',
    79      ],
    80      license='Apache 2.0',
    81      keywords='tensorflow custom op machine learning',
    82  )