Skip to content

Commit c0f12e2

Browse files
author
Jon Wayne Parrott
authored
Normalize all setup.py files (#4909)
1 parent 5527d2a commit c0f12e2

File tree

1 file changed

+65
-48
lines changed

1 file changed

+65
-48
lines changed

setup.py

Lines changed: 65 additions & 48 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,68 +12,85 @@
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.
2222

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.
2547

48+
package_root = os.path.abspath(os.path.dirname(__file__))
2649

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+
author_email='[email protected]',
73+
license='Apache 2.0',
74+
url='https://github.com/GoogleCloudPlatform/google-cloud-python',
75+
classifiers=[
76+
release_status,
3877
'Intended Audience :: Developers',
3978
'License :: OSI Approved :: Apache Software License',
40-
'Operating System :: OS Independent',
79+
'Programming Language :: Python',
4180
'Programming Language :: Python :: 2',
4281
'Programming Language :: Python :: 2.7',
4382
'Programming Language :: Python :: 3',
4483
'Programming Language :: Python :: 3.4',
4584
'Programming Language :: Python :: 3.5',
4685
'Programming Language :: Python :: 3.6',
86+
'Operating System :: OS Independent',
4787
'Topic :: Internet',
4888
],
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,
7996
)

0 commit comments

Comments
 (0)