|
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 | + |
| 23 | +name = 'google-cloud-logging' |
| 24 | +description = 'Stackdriver Logging API client library' |
| 25 | +version = '1.5.0' |
| 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 :: 5 - Production/Stable' |
| 31 | +dependencies = [ |
| 32 | + 'google-cloud-core<0.29dev,>=0.28.0', |
| 33 | + 'google-api-core[grpc]<0.2.0dev,>=0.1.1', |
| 34 | +] |
| 35 | +extras = { |
| 36 | +} |
| 37 | + |
| 38 | + |
| 39 | +# Setup boilerplate below this line. |
| 40 | + |
| 41 | +package_root = os.path.abspath(os.path.dirname(__file__)) |
| 42 | + |
| 43 | +readme_filename = os.path.join(package_root, 'README.rst') |
| 44 | +with io.open(readme_filename, encoding='utf-8') as readme_file: |
| 45 | + readme = readme_file.read() |
| 46 | + |
| 47 | +# Only include packages under the 'google' namespace. Do not include tests, |
| 48 | +# benchmarks, etc. |
| 49 | +packages = [ |
| 50 | + package for package in setuptools.find_packages() |
| 51 | + if package.startswith('google')] |
| 52 | + |
| 53 | +# Determine which namespaces are needed. |
| 54 | +namespaces = ['google'] |
| 55 | +if 'google.cloud' in packages: |
| 56 | + namespaces.append('google.cloud') |
22 | 57 |
|
23 | | -with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj: |
24 | | - README = file_obj.read() |
25 | 58 |
|
26 | | -# NOTE: This is duplicated throughout and we should try to |
27 | | -# consolidate. |
28 | | -SETUP_BASE = { |
29 | | - 'author': 'Google Cloud Platform', |
30 | | - 'author_email': '[email protected]', |
31 | | - 'scripts': [], |
32 | | - 'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python', |
33 | | - 'license': 'Apache 2.0', |
34 | | - 'platforms': 'Posix; MacOS X; Windows', |
35 | | - 'include_package_data': True, |
36 | | - 'zip_safe': False, |
37 | | - 'classifiers': [ |
38 | | - 'Development Status :: 5 - Production/Stable', |
| 59 | +setuptools.setup( |
| 60 | + name=name, |
| 61 | + version=version, |
| 62 | + description=description, |
| 63 | + long_description=readme, |
| 64 | + author='Google LLC', |
| 65 | + |
| 66 | + license='Apache 2.0', |
| 67 | + url='https://github.com/GoogleCloudPlatform/google-cloud-python', |
| 68 | + classifiers=[ |
| 69 | + release_status, |
39 | 70 | 'Intended Audience :: Developers', |
40 | 71 | 'License :: OSI Approved :: Apache Software License', |
41 | | - 'Operating System :: OS Independent', |
| 72 | + 'Programming Language :: Python', |
42 | 73 | 'Programming Language :: Python :: 2', |
43 | 74 | 'Programming Language :: Python :: 2.7', |
44 | 75 | 'Programming Language :: Python :: 3', |
45 | 76 | 'Programming Language :: Python :: 3.4', |
46 | 77 | 'Programming Language :: Python :: 3.5', |
47 | 78 | 'Programming Language :: Python :: 3.6', |
| 79 | + 'Operating System :: OS Independent', |
48 | 80 | 'Topic :: Internet', |
49 | 81 | ], |
50 | | -} |
51 | | - |
52 | | - |
53 | | -REQUIREMENTS = [ |
54 | | - 'google-cloud-core >= 0.28.0, < 0.29dev', |
55 | | - 'google-api-core[grpc] >= 0.1.1, < 0.2.0dev', |
56 | | -] |
57 | | - |
58 | | -setup( |
59 | | - name='google-cloud-logging', |
60 | | - version='1.5.0', |
61 | | - description='Python Client for Stackdriver Logging', |
62 | | - long_description=README, |
63 | | - namespace_packages=[ |
64 | | - 'google', |
65 | | - 'google.cloud', |
66 | | - ], |
67 | | - packages=find_packages(exclude=('tests*',)), |
68 | | - install_requires=REQUIREMENTS, |
69 | | - **SETUP_BASE |
| 82 | + platforms='Posix; MacOS X; Windows', |
| 83 | + packages=packages, |
| 84 | + namespace_packages=namespaces, |
| 85 | + install_requires=dependencies, |
| 86 | + extras_require=extras, |
| 87 | + include_package_data=True, |
| 88 | + zip_safe=False, |
70 | 89 | ) |
0 commit comments