1#! /usr/bin/env python3 2# Copyright 2021 The gRPC Authors 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15"""A PyPI package for xDS protos generated Python code.""" 16 17import os 18 19import setuptools 20 21import grpc_version 22import python_version 23 24WORK_DIR = os.path.dirname(os.path.abspath(__file__)) 25 26# Ensure we're in the proper directory whether or not we're being used by pip. 27os.chdir(WORK_DIR) 28 29EXCLUDE_PYTHON_FILES = ["generated_file_import_test.py", "build.py"] 30 31# Use setuptools to build Python package 32with open(os.path.join(WORK_DIR, "README.rst"), "r") as f: 33 LONG_DESCRIPTION = f.read() 34PACKAGES = setuptools.find_packages(where=".", exclude=EXCLUDE_PYTHON_FILES) 35CLASSIFIERS = [ 36 "Development Status :: 3 - Alpha", 37 "Programming Language :: Python", 38 "Programming Language :: Python :: 3", 39 "License :: OSI Approved :: Apache Software License", 40] 41INSTALL_REQUIRES = [ 42 "grpcio>=1.49.0", 43 "protobuf>=5.26.1,<6.0dev", 44] 45 46SETUP_REQUIRES = INSTALL_REQUIRES + ["grpcio-tools>=1.49.0"] 47 48 49setuptools.setup( 50 name="xds-protos", 51 version=grpc_version.VERSION, 52 packages=PACKAGES, 53 description="Generated Python code from envoyproxy/data-plane-api", 54 long_description_content_type="text/x-rst", 55 long_description=LONG_DESCRIPTION, 56 author="The gRPC Authors", 57 author_email="grpc-io@googlegroups.com", 58 url="https://grpc.io", 59 license="Apache License 2.0", 60 python_requires=f">={python_version.MIN_PYTHON_VERSION}", 61 install_requires=INSTALL_REQUIRES, 62 setup_requires=SETUP_REQUIRES, 63 classifiers=CLASSIFIERS, 64) 65