We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
discovery_cache module not packaged during installation.
I've installed `google-api-python-client` from source, but when at some point my application was failing with this message:

```
  ...
  ...
  File "build/bdist.linux-x86_64/egg/oauth2client/util.py", line 142, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "build/bdist.linux-x86_64/egg/googleapiclient/discovery.py", line 193, in build
    content = _retrieve_discovery_doc(requested_url, http, cache_discovery, cache)
  File "build/bdist.linux-x86_64/egg/googleapiclient/discovery.py", line 215, in _retrieve_discovery_doc
    from . import discovery_cache
ImportError: cannot import name discovery_cache
```

I've checked if `discovery_cache` module was actually part of the `egg`, and unfortunately it was not:

```
[root@e42fb97ce657 unit]# python
Python 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import googleapiclient.discovery_cache
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named discovery_cache
>>> 
```

Here are all the files in `egg`

```
[root@e42fb97ce657 ~]# unzip -l /usr/lib/python2.7/site-packages/google_api_python_client-1.4.1-py2.7.egg 
Archive:  /usr/lib/python2.7/site-packages/google_api_python_client-1.4.1-py2.7.egg
  Length      Date    Time    Name
---------  ---------- -----   ----
     1169  09-03-2015 16:09   apiclient/__init__.py
     1301  09-03-2015 16:09   apiclient/__init__.pyc
        1  09-03-2015 16:09   EGG-INFO/dependency_links.txt
       62  09-03-2015 16:09   EGG-INFO/requires.txt
       26  09-03-2015 16:09   EGG-INFO/top_level.txt
      969  09-03-2015 16:09   EGG-INFO/PKG-INFO
        1  09-03-2015 16:09   EGG-INFO/zip-safe
      545  09-03-2015 16:09   EGG-INFO/SOURCES.txt
    53575  09-03-2015 16:09   googleapiclient/http.py
     9910  09-03-2015 16:09   googleapiclient/channel.py
    40890  09-03-2015 16:09   googleapiclient/discovery.py
     9907  09-03-2015 16:09   googleapiclient/schema.pyc
      620  09-03-2015 16:09   googleapiclient/__init__.py
     9317  09-03-2015 16:09   googleapiclient/schema.py
    11830  09-03-2015 16:09   googleapiclient/model.py
     4047  09-03-2015 16:09   googleapiclient/sample_tools.py
     6552  09-03-2015 16:09   googleapiclient/mimeparse.py
    53976  09-03-2015 16:09   googleapiclient/http.pyc
     7043  09-03-2015 16:09   googleapiclient/mimeparse.pyc
     6333  09-03-2015 16:09   googleapiclient/errors.pyc
     3131  09-03-2015 16:09   googleapiclient/sample_tools.pyc
     3622  09-03-2015 16:09   googleapiclient/errors.py
    35534  09-03-2015 16:09   googleapiclient/discovery.pyc
    14028  09-03-2015 16:09   googleapiclient/model.pyc
      175  09-03-2015 16:09   googleapiclient/__init__.pyc
    10690  09-03-2015 16:09   googleapiclient/channel.pyc
---------                     -------
   285254                     26 files
[root@e42fb97ce657 ~]# 
```

As a workaround I had to add `googleapiclient/discovery_cache` to the `packages` in `setup.py` so it looked like that:

```
[root@e42fb97ce657 google-api-python-client]# more setup.py | grep packages -A 4 -m1
packages = [
    'apiclient',
    'googleapiclient',
    'googleapiclient/discovery_cache'
]
```

Then installed and everything magically started working.

```
[root@e42fb97ce657 google-api-python-client]# python
Python 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import googleapiclient.discovery_cache
>>> 
```

Here is a quick sample that looks similar to my environment using `Docker`:

```
FROM centos:centos7

RUN yum install -y git python-devel python-setuptools unzip
RUN easy_install pip
RUN cd /tmp ;\
    git clone https://github.com/google/google-api-python-client && \
    cd google-api-python-client && \
    python setup.py install 
```

I've also tried to follow preferred suggestion from the `README.md` and install it from `pip` but it ended up in the same situation.

Please advice on how to proceed without making "manual" modifications to the official package?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 # Copyright 2014 Google Inc. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 """Setup script for Google API Python client.
16 
17 Also installs included versions of third party libraries, if those libraries
18 are not already installed.
19 """
20 from __future__ import print_function
21 
22 import sys
23 
24 if sys.version_info < (2, 6):
25   print('google-api-python-client requires python version >= 2.6.',
26         file=sys.stderr)
27   sys.exit(1)
28 if (3, 1) <= sys.version_info < (3, 3):
29   print('google-api-python-client requires python3 version >= 3.3.',
30         file=sys.stderr)
31   sys.exit(1)
32 
33 from setuptools import setup
34 import pkg_resources
35 
36 def _DetectBadness():
37   import os
38   if 'SKIP_GOOGLEAPICLIENT_COMPAT_CHECK' in os.environ:
39     return
40   o2c_pkg = None
41   try:
42     o2c_pkg = pkg_resources.get_distribution('oauth2client')
43   except pkg_resources.DistributionNotFound:
44     pass
45   oauth2client = None
46   try:
47     import oauth2client
48   except ImportError:
49     pass
50   if o2c_pkg is None and oauth2client is not None:
51     raise RuntimeError(
52         'Previous version of google-api-python-client detected; due to a '
53         'packaging issue, we cannot perform an in-place upgrade. Please remove '
54         'the old version and re-install this package.'
55     )
56 
57 _DetectBadness()
58 
59 packages = [
60     'apiclient',
61     'googleapiclient',
62 ]
63 
64 install_requires = [
65     'httplib2>=0.8',
66     'oauth2client>=1.4.6',
67     'six>=1.6.1',
68     'uritemplate>=0.6',
69 ]
70 
71 if sys.version_info < (2, 7):
72   install_requires.append('argparse')
73 
74 long_desc = """The Google API Client for Python is a client library for
75 accessing the Plus, Moderator, and many other Google APIs."""
76 
77 import googleapiclient
78 version = googleapiclient.__version__
79 
80 setup(
81     name="google-api-python-client",
82     version=version,
83     description="Google API Client Library for Python",
84     long_description=long_desc,
85     author="Google Inc.",
86     url="http://github.com/google/google-api-python-client/",
87     install_requires=install_requires,
88     packages=packages,
89     package_data={},
90     license="Apache 2.0",
91     keywords="google api client",
92     classifiers=[
93         'Programming Language :: Python :: 2',
94         'Programming Language :: Python :: 2.6',
95         'Programming Language :: Python :: 2.7',
96         'Programming Language :: Python :: 3',
97         'Programming Language :: Python :: 3.3',
98         'Programming Language :: Python :: 3.4',
99         'Development Status :: 5 - Production/Stable',
100         'Intended Audience :: Developers',
101         'License :: OSI Approved :: Apache Software License',
102         'Operating System :: OS Independent',
103         'Topic :: Internet :: WWW/HTTP',
104     ],
105 )
106
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -59,6 +59,7 @@
 packages = [
     'apiclient',
     'googleapiclient',
+    'googleapiclient/discovery_cache',
 ]
 
 install_requires = [

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -59,6 +59,7 @@\n packages = [\n     'apiclient',\n     'googleapiclient',\n+    'googleapiclient/discovery_cache',\n ]\n \n install_requires = [\n", "issue": "discovery_cache module not packaged during installation.\nI've installed `google-api-python-client` from source, but when at some point my application was failing with this message:\n\n```\n  ...\n  ...\n  File \"build/bdist.linux-x86_64/egg/oauth2client/util.py\", line 142, in positional_wrapper\n    return wrapped(*args, **kwargs)\n  File \"build/bdist.linux-x86_64/egg/googleapiclient/discovery.py\", line 193, in build\n    content = _retrieve_discovery_doc(requested_url, http, cache_discovery, cache)\n  File \"build/bdist.linux-x86_64/egg/googleapiclient/discovery.py\", line 215, in _retrieve_discovery_doc\n    from . import discovery_cache\nImportError: cannot import name discovery_cache\n```\n\nI've checked if `discovery_cache` module was actually part of the `egg`, and unfortunately it was not:\n\n```\n[root@e42fb97ce657 unit]# python\nPython 2.7.5 (default, Jun 24 2015, 00:41:19) \n[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import googleapiclient.discovery_cache\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nImportError: No module named discovery_cache\n>>> \n```\n\nHere are all the files in `egg`\n\n```\n[root@e42fb97ce657 ~]# unzip -l /usr/lib/python2.7/site-packages/google_api_python_client-1.4.1-py2.7.egg \nArchive:  /usr/lib/python2.7/site-packages/google_api_python_client-1.4.1-py2.7.egg\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n     1169  09-03-2015 16:09   apiclient/__init__.py\n     1301  09-03-2015 16:09   apiclient/__init__.pyc\n        1  09-03-2015 16:09   EGG-INFO/dependency_links.txt\n       62  09-03-2015 16:09   EGG-INFO/requires.txt\n       26  09-03-2015 16:09   EGG-INFO/top_level.txt\n      969  09-03-2015 16:09   EGG-INFO/PKG-INFO\n        1  09-03-2015 16:09   EGG-INFO/zip-safe\n      545  09-03-2015 16:09   EGG-INFO/SOURCES.txt\n    53575  09-03-2015 16:09   googleapiclient/http.py\n     9910  09-03-2015 16:09   googleapiclient/channel.py\n    40890  09-03-2015 16:09   googleapiclient/discovery.py\n     9907  09-03-2015 16:09   googleapiclient/schema.pyc\n      620  09-03-2015 16:09   googleapiclient/__init__.py\n     9317  09-03-2015 16:09   googleapiclient/schema.py\n    11830  09-03-2015 16:09   googleapiclient/model.py\n     4047  09-03-2015 16:09   googleapiclient/sample_tools.py\n     6552  09-03-2015 16:09   googleapiclient/mimeparse.py\n    53976  09-03-2015 16:09   googleapiclient/http.pyc\n     7043  09-03-2015 16:09   googleapiclient/mimeparse.pyc\n     6333  09-03-2015 16:09   googleapiclient/errors.pyc\n     3131  09-03-2015 16:09   googleapiclient/sample_tools.pyc\n     3622  09-03-2015 16:09   googleapiclient/errors.py\n    35534  09-03-2015 16:09   googleapiclient/discovery.pyc\n    14028  09-03-2015 16:09   googleapiclient/model.pyc\n      175  09-03-2015 16:09   googleapiclient/__init__.pyc\n    10690  09-03-2015 16:09   googleapiclient/channel.pyc\n---------                     -------\n   285254                     26 files\n[root@e42fb97ce657 ~]# \n```\n\nAs a workaround I had to add `googleapiclient/discovery_cache` to the `packages` in `setup.py` so it looked like that:\n\n```\n[root@e42fb97ce657 google-api-python-client]# more setup.py | grep packages -A 4 -m1\npackages = [\n    'apiclient',\n    'googleapiclient',\n    'googleapiclient/discovery_cache'\n]\n```\n\nThen installed and everything magically started working.\n\n```\n[root@e42fb97ce657 google-api-python-client]# python\nPython 2.7.5 (default, Jun 24 2015, 00:41:19) \n[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import googleapiclient.discovery_cache\n>>> \n```\n\nHere is a quick sample that looks similar to my environment using `Docker`:\n\n```\nFROM centos:centos7\n\nRUN yum install -y git python-devel python-setuptools unzip\nRUN easy_install pip\nRUN cd /tmp ;\\\n    git clone https://github.com/google/google-api-python-client && \\\n    cd google-api-python-client && \\\n    python setup.py install \n```\n\nI've also tried to follow preferred suggestion from the `README.md` and install it from `pip` but it ended up in the same situation.\n\nPlease advice on how to proceed without making \"manual\" modifications to the official package?\n\n", "before_files": [{"content": "# Copyright 2014 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Setup script for Google API Python client.\n\nAlso installs included versions of third party libraries, if those libraries\nare not already installed.\n\"\"\"\nfrom __future__ import print_function\n\nimport sys\n\nif sys.version_info < (2, 6):\n  print('google-api-python-client requires python version >= 2.6.',\n        file=sys.stderr)\n  sys.exit(1)\nif (3, 1) <= sys.version_info < (3, 3):\n  print('google-api-python-client requires python3 version >= 3.3.',\n        file=sys.stderr)\n  sys.exit(1)\n\nfrom setuptools import setup\nimport pkg_resources\n\ndef _DetectBadness():\n  import os\n  if 'SKIP_GOOGLEAPICLIENT_COMPAT_CHECK' in os.environ:\n    return\n  o2c_pkg = None\n  try:\n    o2c_pkg = pkg_resources.get_distribution('oauth2client')\n  except pkg_resources.DistributionNotFound:\n    pass\n  oauth2client = None\n  try:\n    import oauth2client\n  except ImportError:\n    pass\n  if o2c_pkg is None and oauth2client is not None:\n    raise RuntimeError(\n        'Previous version of google-api-python-client detected; due to a '\n        'packaging issue, we cannot perform an in-place upgrade. Please remove '\n        'the old version and re-install this package.'\n    )\n\n_DetectBadness()\n\npackages = [\n    'apiclient',\n    'googleapiclient',\n]\n\ninstall_requires = [\n    'httplib2>=0.8',\n    'oauth2client>=1.4.6',\n    'six>=1.6.1',\n    'uritemplate>=0.6',\n]\n\nif sys.version_info < (2, 7):\n  install_requires.append('argparse')\n\nlong_desc = \"\"\"The Google API Client for Python is a client library for\naccessing the Plus, Moderator, and many other Google APIs.\"\"\"\n\nimport googleapiclient\nversion = googleapiclient.__version__\n\nsetup(\n    name=\"google-api-python-client\",\n    version=version,\n    description=\"Google API Client Library for Python\",\n    long_description=long_desc,\n    author=\"Google Inc.\",\n    url=\"http://github.com/google/google-api-python-client/\",\n    install_requires=install_requires,\n    packages=packages,\n    package_data={},\n    license=\"Apache 2.0\",\n    keywords=\"google api client\",\n    classifiers=[\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Development Status :: 5 - Production/Stable',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: OS Independent',\n        'Topic :: Internet :: WWW/HTTP',\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "# Copyright 2014 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Setup script for Google API Python client.\n\nAlso installs included versions of third party libraries, if those libraries\nare not already installed.\n\"\"\"\nfrom __future__ import print_function\n\nimport sys\n\nif sys.version_info < (2, 6):\n  print('google-api-python-client requires python version >= 2.6.',\n        file=sys.stderr)\n  sys.exit(1)\nif (3, 1) <= sys.version_info < (3, 3):\n  print('google-api-python-client requires python3 version >= 3.3.',\n        file=sys.stderr)\n  sys.exit(1)\n\nfrom setuptools import setup\nimport pkg_resources\n\ndef _DetectBadness():\n  import os\n  if 'SKIP_GOOGLEAPICLIENT_COMPAT_CHECK' in os.environ:\n    return\n  o2c_pkg = None\n  try:\n    o2c_pkg = pkg_resources.get_distribution('oauth2client')\n  except pkg_resources.DistributionNotFound:\n    pass\n  oauth2client = None\n  try:\n    import oauth2client\n  except ImportError:\n    pass\n  if o2c_pkg is None and oauth2client is not None:\n    raise RuntimeError(\n        'Previous version of google-api-python-client detected; due to a '\n        'packaging issue, we cannot perform an in-place upgrade. Please remove '\n        'the old version and re-install this package.'\n    )\n\n_DetectBadness()\n\npackages = [\n    'apiclient',\n    'googleapiclient',\n    'googleapiclient/discovery_cache',\n]\n\ninstall_requires = [\n    'httplib2>=0.8',\n    'oauth2client>=1.4.6',\n    'six>=1.6.1',\n    'uritemplate>=0.6',\n]\n\nif sys.version_info < (2, 7):\n  install_requires.append('argparse')\n\nlong_desc = \"\"\"The Google API Client for Python is a client library for\naccessing the Plus, Moderator, and many other Google APIs.\"\"\"\n\nimport googleapiclient\nversion = googleapiclient.__version__\n\nsetup(\n    name=\"google-api-python-client\",\n    version=version,\n    description=\"Google API Client Library for Python\",\n    long_description=long_desc,\n    author=\"Google Inc.\",\n    url=\"http://github.com/google/google-api-python-client/\",\n    install_requires=install_requires,\n    packages=packages,\n    package_data={},\n    license=\"Apache 2.0\",\n    keywords=\"google api client\",\n    classifiers=[\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Development Status :: 5 - Production/Stable',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: OS Independent',\n        'Topic :: Internet :: WWW/HTTP',\n    ],\n)\n", "path": "setup.py"}]}