1# Copyright 2018 Google LLC
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
15import io
16import os
17
18import setuptools
19
20
21# Package metadata.
22
23name = "google-api-core"
24description = "Google API client core library"
25
26# Should be one of:
27# 'Development Status :: 3 - Alpha'
28# 'Development Status :: 4 - Beta'
29# 'Development Status :: 5 - Production/Stable'
30release_status = "Development Status :: 5 - Production/Stable"
31dependencies = [
32    "googleapis-common-protos >= 1.52.0, < 2.0dev",
33    "protobuf >= 3.12.0",
34    "google-auth >= 1.25.0, < 3.0dev",
35    "requests >= 2.18.0, < 3.0.0dev",
36    "setuptools >= 40.3.0",
37]
38extras = {
39    "grpc": ["grpcio >= 1.33.2, < 2.0dev", "grpcio-status >= 1.33.2, < 2.0dev"],
40    "grpcgcp": "grpcio-gcp >= 0.2.2",
41    "grpcio-gcp": "grpcio-gcp >= 0.2.2",
42}
43
44
45# Setup boilerplate below this line.
46
47package_root = os.path.abspath(os.path.dirname(__file__))
48
49
50version = {}
51with open(os.path.join(package_root, "google/api_core/version.py")) as fp:
52    exec(fp.read(), version)
53version = version["__version__"]
54
55readme_filename = os.path.join(package_root, "README.rst")
56with io.open(readme_filename, encoding="utf-8") as readme_file:
57    readme = readme_file.read()
58
59# Only include packages under the 'google' namespace. Do not include tests,
60# benchmarks, etc.
61packages = [
62    package for package in setuptools.find_packages() if package.startswith("google")
63]
64
65# Determine which namespaces are needed.
66namespaces = ["google"]
67if "google.cloud" in packages:
68    namespaces.append("google.cloud")
69
70
71setuptools.setup(
72    name=name,
73    version=version,
74    description=description,
75    long_description=readme,
76    author="Google LLC",
77    author_email="[email protected]",
78    license="Apache 2.0",
79    url="https://github.com/googleapis/python-api-core",
80    classifiers=[
81        release_status,
82        "Intended Audience :: Developers",
83        "License :: OSI Approved :: Apache Software License",
84        "Programming Language :: Python",
85        "Programming Language :: Python :: 3",
86        "Programming Language :: Python :: 3.6",
87        "Programming Language :: Python :: 3.7",
88        "Programming Language :: Python :: 3.8",
89        "Programming Language :: Python :: 3.9",
90        "Programming Language :: Python :: 3.10",
91        "Operating System :: OS Independent",
92        "Topic :: Internet",
93    ],
94    platforms="Posix; MacOS X; Windows",
95    packages=packages,
96    namespace_packages=namespaces,
97    install_requires=dependencies,
98    extras_require=extras,
99    python_requires=">=3.6",
100    include_package_data=True,
101    zip_safe=False,
102)
103