blob: 9bdb4ef20ab6979bc2da961615405d9c05625266 [file] [log] [blame]
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -08001# Copyright 2018 Google LLC
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -07002#
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
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080015import io
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -070016import os
17
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080018import setuptools
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -070019
Dan Leeed092272021-04-16 17:28:56 -040020# Disable version normalization performed by setuptools.setup()
21# Including this workaround for Python2.7 support
22try:
23 # Try the approach of using sic(), added in setuptools 46.1.0
24 from setuptools import sic
25except ImportError:
26 # Try the approach of replacing packaging.version.Version
27 sic = lambda v: v
28 try:
29 # setuptools >=39.0.0 uses packaging from setuptools.extern
30 from setuptools.extern import packaging
31 except ImportError:
32 # setuptools <39.0.0 uses packaging from pkg_resources.extern
33 from pkg_resources.extern import packaging
34 packaging.version.Version = packaging.version.LegacyVersion
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -070035
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080036# Package metadata.
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -070037
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080038name = "google-api-core"
39description = "Google API client core library"
Christopher Wilcoxd480d972020-10-05 12:06:00 -070040
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080041# Should be one of:
42# 'Development Status :: 3 - Alpha'
43# 'Development Status :: 4 - Beta'
Jon Wayne Parrotta7309d72018-03-15 08:52:22 -070044# 'Development Status :: 5 - Production/Stable'
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080045release_status = "Development Status :: 5 - Production/Stable"
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080046dependencies = [
Tres Seaver13eea092019-07-17 14:46:56 -040047 "googleapis-common-protos >= 1.6.0, < 2.0dev",
Bu Sun Kim1ba60952020-06-16 09:40:08 -070048 "protobuf >= 3.12.0",
arithmetic17288f8ee782020-09-03 11:15:13 -070049 "google-auth >= 1.21.1, < 2.0dev",
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080050 "requests >= 2.18.0, < 3.0.0dev",
Bu Sun Kimc5fee892021-01-13 14:46:03 -070051 "setuptools >= 40.3.0",
Bu Sun Kim94c76e02021-02-05 10:26:54 -070052 "packaging >= 14.3",
Bu Sun Kima7a8b982020-10-02 14:07:39 -060053 "six >= 1.13.0",
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080054 "pytz",
55 'futures >= 3.2.0; python_version < "3.2"',
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080056]
57extras = {
Lidi Zheng4b114222020-06-05 19:21:33 -070058 "grpc": "grpcio >= 1.29.0, < 2.0dev",
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080059 "grpcgcp": "grpcio-gcp >= 0.2.2",
60 "grpcio-gcp": "grpcio-gcp >= 0.2.2",
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080061}
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -070062
63
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080064# Setup boilerplate below this line.
65
66package_root = os.path.abspath(os.path.dirname(__file__))
67
Christopher Wilcoxdb8e6362020-10-06 10:33:09 -070068
69version = {}
70with open(os.path.join(package_root, "google/api_core/version.py")) as fp:
71 exec(fp.read(), version)
Tres Seaverfdbed0f2020-12-10 15:19:02 -050072version = version["__version__"]
Christopher Wilcoxdb8e6362020-10-06 10:33:09 -070073
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080074readme_filename = os.path.join(package_root, "README.rst")
75with io.open(readme_filename, encoding="utf-8") as readme_file:
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080076 readme = readme_file.read()
77
78# Only include packages under the 'google' namespace. Do not include tests,
79# benchmarks, etc.
80packages = [
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080081 package for package in setuptools.find_packages() if package.startswith("google")
82]
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080083
84# Determine which namespaces are needed.
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080085namespaces = ["google"]
86if "google.cloud" in packages:
87 namespaces.append("google.cloud")
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080088
89
90setuptools.setup(
91 name=name,
Dan Leeed092272021-04-16 17:28:56 -040092 version=sic(version),
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080093 description=description,
94 long_description=readme,
Christopher Wilcox6f4070d2018-11-29 11:02:52 -080095 author="Google LLC",
96 author_email="googleapis-packages@google.com",
97 license="Apache 2.0",
Bu Sun Kime72202e2020-02-19 17:58:47 -080098 url="https://github.com/googleapis/python-api-core",
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -080099 classifiers=[
100 release_status,
Christopher Wilcox6f4070d2018-11-29 11:02:52 -0800101 "Intended Audience :: Developers",
102 "License :: OSI Approved :: Apache Software License",
103 "Programming Language :: Python",
104 "Programming Language :: Python :: 2",
105 "Programming Language :: Python :: 2.7",
106 "Programming Language :: Python :: 3",
107 "Programming Language :: Python :: 3.5",
108 "Programming Language :: Python :: 3.6",
109 "Programming Language :: Python :: 3.7",
Tres Seaverfdbed0f2020-12-10 15:19:02 -0500110 "Programming Language :: Python :: 3.8",
111 "Programming Language :: Python :: 3.9",
Christopher Wilcox6f4070d2018-11-29 11:02:52 -0800112 "Operating System :: OS Independent",
113 "Topic :: Internet",
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -0700114 ],
Christopher Wilcox6f4070d2018-11-29 11:02:52 -0800115 platforms="Posix; MacOS X; Windows",
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -0800116 packages=packages,
117 namespace_packages=namespaces,
118 install_requires=dependencies,
119 extras_require=extras,
Tres Seaver9ac37082020-12-14 12:44:10 -0500120 python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*",
Jon Wayne Parrottc0f12e22018-02-22 10:28:50 -0800121 include_package_data=True,
122 zip_safe=False,
Jon Wayne Parrott77fb0f22017-10-18 12:52:35 -0700123)