|
1 |
| -# Copyright 2016 Google LLC |
| 1 | +# Copyright 2018 Google LLC |
2 | 2 | #
|
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License");
|
4 | 4 | # you may not use this file except in compliance with the License.
|
|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
| 15 | +import io |
15 | 16 | import os
|
16 | 17 |
|
17 |
| -from setuptools import find_packages |
18 |
| -from setuptools import setup |
| 18 | +import setuptools |
19 | 19 |
|
20 | 20 |
|
21 |
| -PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) |
| 21 | +# Package metadata. |
22 | 22 |
|
23 |
| -with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: |
24 |
| - README = file_obj.read() |
| 23 | +name = 'google-api-core' |
| 24 | +description = 'Google API client core library' |
| 25 | +version = '0.1.5.dev1' |
| 26 | +# Should be one of: |
| 27 | +# 'Development Status :: 3 - Alpha' |
| 28 | +# 'Development Status :: 4 - Beta' |
| 29 | +# 'Development Status :: 5 - Stable' |
| 30 | +release_status = 'Development Status :: 4 - Beta' |
| 31 | +dependencies = [ |
| 32 | + 'googleapis-common-protos<2.0dev,>=1.5.3', |
| 33 | + 'protobuf>=3.0.0', |
| 34 | + 'google-auth<2.0.0dev,>=0.4.0', |
| 35 | + 'requests<3.0.0dev,>=2.18.0', |
| 36 | + 'setuptools>=34.0.0', |
| 37 | + 'six>=1.10.0', |
| 38 | + 'pytz', |
| 39 | +] |
| 40 | +extras = { |
| 41 | + 'grpc': 'grpcio>=1.8.2', |
| 42 | + ':python_version < "3.2"': 'futures>=3.2.0', |
| 43 | +} |
| 44 | + |
| 45 | + |
| 46 | +# Setup boilerplate below this line. |
25 | 47 |
|
| 48 | +package_root = os.path.abspath(os.path.dirname(__file__)) |
26 | 49 |
|
27 |
| -SETUP_BASE = { |
28 |
| - 'author': 'Google Cloud Platform', |
29 |
| - 'author_email': '[email protected]', |
30 |
| - 'scripts': [], |
31 |
| - 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', |
32 |
| - 'license': 'Apache 2.0', |
33 |
| - 'platforms': 'Posix; MacOS X; Windows', |
34 |
| - 'include_package_data': True, |
35 |
| - 'zip_safe': False, |
36 |
| - 'classifiers': [ |
37 |
| - 'Development Status :: 4 - Beta', |
| 50 | +readme_filename = os.path.join(package_root, 'README.rst') |
| 51 | +with io.open(readme_filename, encoding='utf-8') as readme_file: |
| 52 | + readme = readme_file.read() |
| 53 | + |
| 54 | +# Only include packages under the 'google' namespace. Do not include tests, |
| 55 | +# benchmarks, etc. |
| 56 | +packages = [ |
| 57 | + package for package in setuptools.find_packages() |
| 58 | + if package.startswith('google')] |
| 59 | + |
| 60 | +# Determine which namespaces are needed. |
| 61 | +namespaces = ['google'] |
| 62 | +if 'google.cloud' in packages: |
| 63 | + namespaces.append('google.cloud') |
| 64 | + |
| 65 | + |
| 66 | +setuptools.setup( |
| 67 | + name=name, |
| 68 | + version=version, |
| 69 | + description=description, |
| 70 | + long_description=readme, |
| 71 | + author='Google LLC', |
| 72 | + |
| 73 | + license='Apache 2.0', |
| 74 | + url='https://github.com/GoogleCloudPlatform/google-cloud-python', |
| 75 | + classifiers=[ |
| 76 | + release_status, |
38 | 77 | 'Intended Audience :: Developers',
|
39 | 78 | 'License :: OSI Approved :: Apache Software License',
|
40 |
| - 'Operating System :: OS Independent', |
| 79 | + 'Programming Language :: Python', |
41 | 80 | 'Programming Language :: Python :: 2',
|
42 | 81 | 'Programming Language :: Python :: 2.7',
|
43 | 82 | 'Programming Language :: Python :: 3',
|
44 | 83 | 'Programming Language :: Python :: 3.4',
|
45 | 84 | 'Programming Language :: Python :: 3.5',
|
46 | 85 | 'Programming Language :: Python :: 3.6',
|
| 86 | + 'Operating System :: OS Independent', |
47 | 87 | 'Topic :: Internet',
|
48 | 88 | ],
|
49 |
| -} |
50 |
| - |
51 |
| - |
52 |
| -REQUIREMENTS = [ |
53 |
| - 'googleapis-common-protos >= 1.5.3, < 2.0dev', |
54 |
| - 'protobuf >= 3.0.0', |
55 |
| - 'google-auth >= 0.4.0, < 2.0.0dev', |
56 |
| - 'requests >= 2.18.0, < 3.0.0dev', |
57 |
| - 'setuptools >= 34.0.0', |
58 |
| - 'six >= 1.10.0', |
59 |
| - # pytz does not adhere to semver and uses a year.month based scheme. |
60 |
| - # Any valid version of pytz should work for us. |
61 |
| - 'pytz', |
62 |
| -] |
63 |
| - |
64 |
| -EXTRAS_REQUIREMENTS = { |
65 |
| - ':python_version<"3.2"': ['futures >= 3.2.0'], |
66 |
| - 'grpc': ['grpcio >= 1.8.2'], |
67 |
| -} |
68 |
| - |
69 |
| -setup( |
70 |
| - name='google-api-core', |
71 |
| - version='0.1.5.dev1', |
72 |
| - description='Core Google API Client Library', |
73 |
| - long_description=README, |
74 |
| - namespace_packages=['google'], |
75 |
| - packages=find_packages(exclude=('tests*',)), |
76 |
| - install_requires=REQUIREMENTS, |
77 |
| - extras_require=EXTRAS_REQUIREMENTS, |
78 |
| - **SETUP_BASE |
| 89 | + platforms='Posix; MacOS X; Windows', |
| 90 | + packages=packages, |
| 91 | + namespace_packages=namespaces, |
| 92 | + install_requires=dependencies, |
| 93 | + extras_require=extras, |
| 94 | + include_package_data=True, |
| 95 | + zip_safe=False, |
79 | 96 | )
|
0 commit comments