# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import io
import os

import setuptools


# Package metadata.

name = 'google-cloud-pubsub'
description = 'Google Cloud Pub/Sub API client library'
version = '0.38.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = 'Development Status :: 4 - Beta'
dependencies = [
    'google-api-core[grpc] >= 1.1.0, < 2.0.0dev',
    'grpc-google-iam-v1 >= 0.11.1, < 0.12dev',
    'enum34; python_version < "3.4"',
]
extras = {
}


# Setup boilerplate below this line.

package_root = os.path.abspath(os.path.dirname(__file__))

readme_filename = os.path.join(package_root, 'README.rst')
with io.open(readme_filename, encoding='utf-8') as readme_file:
    readme = readme_file.read()

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
    package for package in setuptools.find_packages()
    if package.startswith('google')]

# Determine which namespaces are needed.
namespaces = ['google']
if 'google.cloud' in packages:
    namespaces.append('google.cloud')


setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author='Google LLC',
    author_email='googleapis-packages@google.com',
    license='Apache 2.0',
    url='https://github.com/GoogleCloudPlatform/google-cloud-python',
    classifiers=[
        release_status,
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Operating System :: OS Independent',
        'Topic :: Internet',
    ],
    platforms='Posix; MacOS X; Windows',
    packages=packages,
    namespace_packages=namespaces,
    install_requires=dependencies,
    extras_require=extras,
    include_package_data=True,
    zip_safe=False,
)

pubsub/setup.py
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import io
import os

import setuptools


# Package metadata.

name = 'google-cloud-pubsub'
description = 'Google Cloud Pub/Sub API client library'
version = '0.38.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = 'Development Status :: 4 - Beta'
dependencies = [
    'google-api-core[grpc] >= 1.4.1, < 2.0.0dev',
    'grpc-google-iam-v1 >= 0.11.1, < 0.12dev',
    'enum34; python_version < "3.4"',
]
extras = {
}


# Setup boilerplate below this line.

package_root = os.path.abspath(os.path.dirname(__file__))

readme_filename = os.path.join(package_root, 'README.rst')
with io.open(readme_filename, encoding='utf-8') as readme_file:
    readme = readme_file.read()

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [
    package for package in setuptools.find_packages()
    if package.startswith('google')]

# Determine which namespaces are needed.
namespaces = ['google']
if 'google.cloud' in packages:
    namespaces.append('google.cloud')


setuptools.setup(
    name=name,
    version=version,
    description=description,
    long_description=readme,
    author='Google LLC',
    author_email='googleapis-packages@google.com',
    license='Apache 2.0',
    url='https://github.com/GoogleCloudPlatform/google-cloud-python',
    classifiers=[
        release_status,
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Operating System :: OS Independent',
        'Topic :: Internet',
    ],
    platforms='Posix; MacOS X; Windows',
    packages=packages,
    namespace_packages=namespaces,
    install_requires=dependencies,
    extras_require=extras,
    include_package_data=True,
    zip_safe=False,
)

pubsub/setup.py
diff --git a/pubsub/setup.py b/pubsub/setup.py
index ee5677565a12..f34758421dab 100644
--- a/pubsub/setup.py
+++ b/pubsub/setup.py
@@ -29,7 +29,7 @@
 # 'Development Status :: 5 - Production/Stable'
 release_status = 'Development Status :: 4 - Beta'
 dependencies = [
-    'google-api-core[grpc] >= 1.1.0, < 2.0.0dev',
+    'google-api-core[grpc] >= 1.4.1, < 2.0.0dev',
     'grpc-google-iam-v1 >= 0.11.1, < 0.12dev',
     'enum34; python_version < "3.4"',
 ]

PubSub protobuf dependency requirements incorrect
I think the minimum version for the `protobuf` package dependency is not correct.  google-cloud-python has the version requirements as protobuf>=3.0.0, but it fails to import when using version up to and including protobuf==3.3.0.  I'm not sure what the exact correct version is, but the last version of google-cloud-pubsub to work with protobuf==3.3.0 is google-cloud-pubsub==0.35.4.  I believe after this commit (https://github.com/GoogleCloudPlatform/google-cloud-python/commit/371333a51165e99d4d02876b1ef133618485b6fc#diff-29280288794caf553b0b008084a0e854), a protobuf version >3.3.0 is required:

Python version
```
$ python --version
Python 2.7.15rc1
```

Package versions:
```
$ pip list | grep -E '(cloud|protobuf)'
google-cloud-core                  0.28.1      
google-cloud-datastore             1.7.0       
google-cloud-pubsub                0.38.0      
google-cloud-storage               1.12.0      
protobuf                           3.3.0 
```

Getting a stack track just importing pubsub (in ipython here)
```
In [1]: from google.cloud import pubsub
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-8fba37b708ad> in <module>()
----> 1 from google.cloud import pubsub

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub.py in <module>()
     17 from __future__ import absolute_import
     18 
---> 19 from google.cloud.pubsub_v1 import PublisherClient
     20 from google.cloud.pubsub_v1 import SubscriberClient
     21 from google.cloud.pubsub_v1 import types

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub_v1/__init__.py in <module>()
     15 from __future__ import absolute_import
     16 
---> 17 from google.cloud.pubsub_v1 import types
     18 from google.cloud.pubsub_v1 import publisher
     19 from google.cloud.pubsub_v1 import subscriber

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub_v1/types.py in <module>()
     28 
     29 from google.api_core.protobuf_helpers import get_messages
---> 30 from google.cloud.pubsub_v1.proto import pubsub_pb2
     31 
     32 

/home/aaronpeterson/.local/share/virtualenvs/turbinia-docs-oOHvuNoj/local/lib/python2.7/site-packages/google/cloud/pubsub_v1/proto/pubsub_pb2.py in <module>()
     45       message_type=None, enum_type=None, containing_type=None,
     46       is_extension=False, extension_scope=None,
---> 47       options=None, file=DESCRIPTOR),
     48   ],
     49   extensions=[

TypeError: __new__() got an unexpected keyword argument 'file'
```

Snipped the pubsub section from pipdeptree output showing the protobuf requirement is >=3.0.0:
```
 - google-cloud-pubsub [required: Any, installed: 0.38.0]
    - enum34 [required: Any, installed: 1.1.6]
    - google-api-core [required: >=1.1.0,<2.0.0dev, installed: 1.4.0]
      - futures [required: >=3.2.0, installed: 3.2.0]
      - google-auth [required: >=0.4.0,<2.0.0dev, installed: 1.5.1]
        - cachetools [required: >=2.0.0, installed: 2.1.0]
        - pyasn1-modules [required: >=0.2.1, installed: 0.2.2]
          - pyasn1 [required: >=0.4.1,<0.5.0, installed: 0.4.4]
        - rsa [required: >=3.1.4, installed: 4.0]
          - pyasn1 [required: >=0.1.3, installed: 0.4.4]
        - six [required: >=1.9.0, installed: 1.11.0]
      - googleapis-common-protos [required: >=1.5.3,<2.0dev, installed: 1.5.3]
        - protobuf [required: >=3.0.0, installed: 3.3.0]
          - setuptools [required: Any, installed: 40.4.3]
          - six [required: >=1.9, installed: 1.11.0]
      - protobuf [required: >=3.0.0, installed: 3.3.0]
        - setuptools [required: Any, installed: 40.4.3]
        - six [required: >=1.9, installed: 1.11.0]
```
