Skip to content

Commit b6f5392

Browse files
author
Jon Wayne Parrott
authored
Normalize all setup.py files (googleapis#4909)
1 parent 66c1713 commit b6f5392

File tree

26 files changed

+1517
-982
lines changed

26 files changed

+1517
-982
lines changed

api_core/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': 'googleapis-publisher@google.com',
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='googleapis-packages@google.com',
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
)

bigquery/setup.py

Lines changed: 61 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,67 +12,80 @@
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-cloud-bigquery'
24+
description = 'Google BigQuery API client library'
25+
version = '0.30.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 :: 4 - Beta'
31+
dependencies = [
32+
'google-cloud-core<0.29dev,>=0.28.0',
33+
'google-api-core<0.2.0dev,>=0.1.1',
34+
'google-resumable-media>=0.2.1',
35+
]
36+
extras = {
37+
'pandas': 'pandas>=0.17.1',
38+
}
39+
40+
41+
# Setup boilerplate below this line.
42+
43+
package_root = os.path.abspath(os.path.dirname(__file__))
2544

26-
# NOTE: This is duplicated throughout and we should try to
27-
# consolidate.
28-
SETUP_BASE = {
29-
'author': 'Google Cloud Platform',
30-
'author_email': 'googleapis-publisher@google.com',
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 :: 4 - Beta',
45+
readme_filename = os.path.join(package_root, 'README.rst')
46+
with io.open(readme_filename, encoding='utf-8') as readme_file:
47+
readme = readme_file.read()
48+
49+
# Only include packages under the 'google' namespace. Do not include tests,
50+
# benchmarks, etc.
51+
packages = [
52+
package for package in setuptools.find_packages()
53+
if package.startswith('google')]
54+
55+
# Determine which namespaces are needed.
56+
namespaces = ['google']
57+
if 'google.cloud' in packages:
58+
namespaces.append('google.cloud')
59+
60+
61+
setuptools.setup(
62+
name=name,
63+
version=version,
64+
description=description,
65+
long_description=readme,
66+
author='Google LLC',
67+
author_email='googleapis-packages@google.com',
68+
license='Apache 2.0',
69+
url='https://github.com/GoogleCloudPlatform/google-cloud-python',
70+
classifiers=[
71+
release_status,
3972
'Intended Audience :: Developers',
4073
'License :: OSI Approved :: Apache Software License',
41-
'Operating System :: OS Independent',
74+
'Programming Language :: Python',
4275
'Programming Language :: Python :: 2',
4376
'Programming Language :: Python :: 2.7',
4477
'Programming Language :: Python :: 3',
4578
'Programming Language :: Python :: 3.4',
4679
'Programming Language :: Python :: 3.5',
4780
'Programming Language :: Python :: 3.6',
81+
'Operating System :: OS Independent',
4882
'Topic :: Internet',
4983
],
50-
}
51-
52-
53-
REQUIREMENTS = [
54-
'google-cloud-core >= 0.28.0, < 0.29dev',
55-
'google-api-core >= 0.1.1, < 0.2.0dev',
56-
'google-auth >= 1.0.0',
57-
'google-resumable-media >= 0.2.1',
58-
'requests >= 2.18.0',
59-
]
60-
61-
EXTRAS_REQUIREMENTS = {
62-
'pandas': ['pandas >= 0.17.1'],
63-
}
64-
65-
setup(
66-
name='google-cloud-bigquery',
67-
version='0.30.0',
68-
description='Python Client for Google BigQuery',
69-
long_description=README,
70-
namespace_packages=[
71-
'google',
72-
'google.cloud',
73-
],
74-
packages=find_packages(exclude=('tests*',)),
75-
install_requires=REQUIREMENTS,
76-
extras_require=EXTRAS_REQUIREMENTS,
77-
**SETUP_BASE
84+
platforms='Posix; MacOS X; Windows',
85+
packages=packages,
86+
namespace_packages=namespaces,
87+
install_requires=dependencies,
88+
extras_require=extras,
89+
include_package_data=True,
90+
zip_safe=False,
7891
)

bigquery_datatransfer/setup.py

Lines changed: 53 additions & 28 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,35 +12,60 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""A setup module for the GAPIC BigQuery Data Transfer API library.
15+
import io
16+
import os
1617

17-
See:
18-
https://packaging.python.org/en/latest/distributing.html
19-
https://github.com/pypa/sampleproject
20-
"""
18+
import setuptools
2119

22-
from setuptools import setup, find_packages
23-
import io
24-
import sys
2520

26-
install_requires = [
27-
'google-api-core>=0.1.0, <0.2.0dev',
28-
'google-auth>=1.0.2, <2.0dev',
29-
'googleapis-common-protos[grpc]>=1.5.2, <2.0dev',
30-
'requests>=2.18.4, <3.0dev',
21+
# Package metadata.
22+
23+
name = 'google-cloud-bigquery-datatransfer'
24+
description = 'BigQuery Data Transfer API client library'
25+
version = '0.1.1.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 :: 3 - Alpha'
31+
dependencies = [
32+
'google-api-core[grpc]<0.2.0dev,>=0.1.0',
3133
]
34+
extras = {
35+
}
36+
37+
38+
# Setup boilerplate below this line.
39+
40+
package_root = os.path.abspath(os.path.dirname(__file__))
41+
42+
readme_filename = os.path.join(package_root, 'README.rst')
43+
with io.open(readme_filename, encoding='utf-8') as readme_file:
44+
readme = readme_file.read()
3245

33-
with io.open('README.rst', 'r', encoding='utf-8') as readme_file:
34-
long_description = readme_file.read()
46+
# Only include packages under the 'google' namespace. Do not include tests,
47+
# benchmarks, etc.
48+
packages = [
49+
package for package in setuptools.find_packages()
50+
if package.startswith('google')]
3551

36-
setup(
37-
name='google-cloud-bigquery-datatransfer',
38-
version='0.1.1.dev1',
52+
# Determine which namespaces are needed.
53+
namespaces = ['google']
54+
if 'google.cloud' in packages:
55+
namespaces.append('google.cloud')
56+
57+
58+
setuptools.setup(
59+
name=name,
60+
version=version,
61+
description=description,
62+
long_description=readme,
3963
author='Google LLC',
4064
author_email='googleapis-packages@google.com',
65+
license='Apache 2.0',
66+
url='https://github.com/GoogleCloudPlatform/google-cloud-python',
4167
classifiers=[
42-
'Intended Audience :: Developers',
43-
'Development Status :: 3 - Alpha',
68+
release_status,
4469
'Intended Audience :: Developers',
4570
'License :: OSI Approved :: Apache Software License',
4671
'Programming Language :: Python',
@@ -50,14 +75,14 @@
5075
'Programming Language :: Python :: 3.4',
5176
'Programming Language :: Python :: 3.5',
5277
'Programming Language :: Python :: 3.6',
78+
'Operating System :: OS Independent',
79+
'Topic :: Internet',
5380
],
54-
description='GAPIC library for the BigQuery Data Transfer API',
81+
platforms='Posix; MacOS X; Windows',
82+
packages=packages,
83+
namespace_packages=namespaces,
84+
install_requires=dependencies,
85+
extras_require=extras,
5586
include_package_data=True,
56-
long_description=long_description,
57-
install_requires=install_requires,
58-
license='Apache 2.0',
59-
packages=find_packages(exclude=('tests*',)),
60-
namespace_packages=['google', 'google.cloud'],
6187
zip_safe=False,
62-
url='https://github.com/GoogleCloudPlatform/google-cloud-python',
6388
)

0 commit comments

Comments
 (0)