Skip to content

Commit 64c38dc

Browse files
author
Jon Wayne Parrott
authored
Normalize all setup.py files (#4909)
1 parent 1726fd6 commit 64c38dc

File tree

1 file changed

+59
-40
lines changed

1 file changed

+59
-40
lines changed

setup.py

Lines changed: 59 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2016 Google LLC
1+
# Copyright 2018 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,59 +12,78 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import io
1516
import os
1617

17-
from setuptools import find_packages
18-
from setuptools import setup
18+
import setuptools
1919

2020

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')
2257

23-
with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj:
24-
README = file_obj.read()
2558

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+
author_email='[email protected]',
66+
license='Apache 2.0',
67+
url='https://github.com/GoogleCloudPlatform/google-cloud-python',
68+
classifiers=[
69+
release_status,
3970
'Intended Audience :: Developers',
4071
'License :: OSI Approved :: Apache Software License',
41-
'Operating System :: OS Independent',
72+
'Programming Language :: Python',
4273
'Programming Language :: Python :: 2',
4374
'Programming Language :: Python :: 2.7',
4475
'Programming Language :: Python :: 3',
4576
'Programming Language :: Python :: 3.4',
4677
'Programming Language :: Python :: 3.5',
4778
'Programming Language :: Python :: 3.6',
79+
'Operating System :: OS Independent',
4880
'Topic :: Internet',
4981
],
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,
7089
)

0 commit comments

Comments
 (0)