Cleaning up 2.7 compatibility and more work on installer.
diff --git a/MANIFEST.in b/MANIFEST.in
index 633da69..bdb683d 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,10 +1,12 @@
 recursive-include tests *.py *.json
+recursive-include functional_tests *.py *.json
 recursive-include httplib2 *.py *.json
 recursive-include uritemplate *.py *.json
 recursive-include apiclient *.json *.py
 recursive-include docs *.html
 recursive-include samples *.py *.png *.html *.yaml *.json
 include runtests.py
+include runsamples.py
 include setpath.sh
 include setup_utils.py
 include gflags.py
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index df01aa0..6ba0208 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -48,7 +48,8 @@
 DEFAULT_METHOD_DOC = 'A description of how to use this function'
 
 # Query parameters that work, but don't appear in discovery
-STACK_QUERY_PARAMETERS = ['trace', 'fields', 'pp', 'prettyPrint', 'userIp', 'strict']
+STACK_QUERY_PARAMETERS = ['trace', 'fields', 'pp', 'prettyPrint', 'userIp',
+  'strict']
 
 
 def key2param(key):
diff --git a/apiclient/http.py b/apiclient/http.py
index 138ce48..8c81ad4 100644
--- a/apiclient/http.py
+++ b/apiclient/http.py
@@ -299,9 +299,9 @@
     if headers is None:
       headers = {}
     if method == 'PATCH':
-      if 'authorization' in headers and 'oauth_token' in headers['authorization']:
+      if 'oauth_token' in headers.get('authorization', ''):
         logging.warning(
-            'OAuth 1.0 request made with Credentials applied after tunnel_patch.')
+            'OAuth 1.0 request made with Credentials after tunnel_patch.')
       headers['x-http-method-override'] = "PATCH"
       method = 'POST'
     resp, content = request_orig(uri, method, body, headers,
diff --git a/oauth2client/client.py b/oauth2client/client.py
index 1a3937b..c18a0ce 100644
--- a/oauth2client/client.py
+++ b/oauth2client/client.py
@@ -87,7 +87,7 @@
     """Retrieve credential.
 
     Returns:
-      apiclient.oauth.Credentials
+      oauth2client.client.Credentials
     """
     _abstract()
 
diff --git a/oauth2client/tools.py b/oauth2client/tools.py
index 05e8b05..f2add0b 100644
--- a/oauth2client/tools.py
+++ b/oauth2client/tools.py
@@ -30,7 +30,7 @@
 import sys
 
 from optparse import OptionParser
-from apiclient.oauth import RequestError
+from client import FlowExchangeError
 
 try:
     from urlparse import parse_qsl
@@ -140,7 +140,7 @@
 
   try:
     credentials = flow.step2_exchange(code)
-  except RequestError:
+  except FlowExchangeError:
     sys.exit('The authentication has failed.')
 
   storage.put(credentials)
diff --git a/samples/django_sample/buzz/views.py b/samples/django_sample/buzz/views.py
index c942aaf..d89af6d 100644
--- a/samples/django_sample/buzz/views.py
+++ b/samples/django_sample/buzz/views.py
@@ -24,8 +24,8 @@
   credential = storage.get()
   if credential is None or credential.invalid == True:
     flow = OAuth2WebServerFlow(
-        client_id='837647042410.apps.googleusercontent.com',
-        client_secret='+SWwMCL9d8gWtzPRa1lXw5R8',
+        client_id='887851474342.apps.googleusercontent.com',
+        client_secret='6V9MHBUQqOQtxI7uXPIEnV8e',
         scope='https://www.googleapis.com/auth/buzz',
         user_agent='buzz-django-sample/1.0',
         )
diff --git a/samples/django_sample/settings.py b/samples/django_sample/settings.py
index 565d2e5..d0d7c7e 100644
--- a/samples/django_sample/settings.py
+++ b/samples/django_sample/settings.py
@@ -62,6 +62,7 @@
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
 )
 
 ROOT_URLCONF = 'django_sample.urls'
diff --git a/samples/django_sample/templates/buzz/login.html b/samples/django_sample/templates/buzz/login.html
index 567bf68..28a64f1 100644
--- a/samples/django_sample/templates/buzz/login.html
+++ b/samples/django_sample/templates/buzz/login.html
@@ -4,7 +4,7 @@
 <p>Your username and password didn't match. Please try again.</p>
 {% endif %}
 
-<form method="post" action="{% url django.contrib.auth.views.login %}">
+<form method="post" action="{% url django.contrib.auth.views.login %}">{% csrf_token %}
 <table>
 <tr>
     <td>{{ form.username.label_tag }}</td>
diff --git a/setup.py b/setup.py
index ba7e619..4d3ddb2 100644
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@
 ]
 py_modules = []
 
-third_party_packages = ['httplib2']
+third_party_packages = ['httplib2', 'oauth2']
 third_party_modules = ['gflags', 'gflags_validators']
 
 # Don't clobber installed versions of third party libraries
@@ -52,7 +52,7 @@
 accessing the Buzz, Moderator, and Latitude APIs."""
 
 setup(name="google-api-python-client",
-      version="1.0alpha5",
+      version="1.0alpha6",
       description="Google API Client Library for Python",
       long_description=long_desc,
       author="Joe Gregorio",
@@ -64,7 +64,6 @@
         'apiclient': ['contrib/*/*.json']
         },
       license="Apache 2.0",
-      install_requires = ['python-gflags', 'oauth2'],
       keywords="google api client",
       classifiers=['Development Status :: 3 - Alpha',
                    'Intended Audience :: Developers',