Adds make targets 'release' and 'prerelease' which build release
source packages, register them, etc.
diff --git a/.hgignore b/.hgignore
index 9d35255..3cf93e7 100644
--- a/.hgignore
+++ b/.hgignore
@@ -4,9 +4,15 @@
*.dat
.*.swp
*/.git/*
+*/.cache/*
.gitignore
samples/buzz/*.dat
samples/moderator/*.dat
htmlcov/*
.coverage
database.sqlite3
+build/*
+googlecode_upload.py
+google_api_python_client.egg-info/*
+dist/*
+MANIFEST
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..74ab314
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,8 @@
+recursive-include tests *.py *.json
+recursive-include apiclient *.json
+recursive-include docs *.html
+recursive-include samples *.py *.png *.html *.yaml *.json
+include runtests.py
+include setpath.sh
+include setup_utils.py
+
diff --git a/Makefile b/Makefile
index a0550a2..f31d2bb 100644
--- a/Makefile
+++ b/Makefile
@@ -8,3 +8,16 @@
docs:
cd docs; ./build.sh
python describe.py
+
+.PHONY: prerelease
+prerelease:
+ -rm dist/*
+ python setup.py clean
+ python setup.py sdist
+
+.PHONY: release
+release: prerelease
+ python setup.py sdist register upload
+ wget "http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py" -O googlecode_upload.py
+ python googlecode_upload.py --summary="Version $(shell python setup.py --version)" --project=google-api-python-client dist/*.tar.gz
+
diff --git a/apiclient/model.py b/apiclient/model.py
index 9781b35..825bf80 100644
--- a/apiclient/model.py
+++ b/apiclient/model.py
@@ -100,6 +100,7 @@
"""
query = self._build_query(query_params)
headers['accept'] = 'application/json'
+ headers['accept-encoding'] = 'gzip, deflate'
if 'user-agent' in headers:
headers['user-agent'] += ' '
else:
diff --git a/samples/oauth2/moderator/moderator.py b/samples/oauth2/moderator/moderator.py
index aac3de8..d547d70 100644
--- a/samples/oauth2/moderator/moderator.py
+++ b/samples/oauth2/moderator/moderator.py
@@ -31,12 +31,11 @@
client_id='433807057907.apps.googleusercontent.com',
client_secret='jigtZpMApkRxncxikFpR+SFg',
scope='https://www.googleapis.com/auth/moderator',
- user_agent='moderator-cmdline-sample/1.0',
- xoauth_displayname='Moderator Client Example App')
+ user_agent='moderator-cmdline-sample/1.0')
credentials = run(flow, storage)
- http = httplib2.Http()
+ http = httplib2.Http(cache=".cache")
http = credentials.authorize(http)
service = build("moderator", "v1", http=http)
diff --git a/setup.py b/setup.py
index dac0ce4..6e8fbb9 100644
--- a/setup.py
+++ b/setup.py
@@ -20,37 +20,43 @@
import setup_utils
-packages = ['apiclient', 'apiclient.ext', 'uritemplate']
+packages = [
+ 'apiclient',
+ 'oauth2client',
+ 'apiclient.ext',
+ 'apiclient.contrib',
+ 'apiclient.contrib.buzz',
+ 'apiclient.contrib.latitude',
+ 'apiclient.contrib.moderator',
+ 'uritemplate'
+]
+
+third_party_reqs = ['httplib2', 'oauth2']
# Don't clobber installed versions of third party libraries
# with what we include.
-packages.extend(setup_utils.get_missing_requirements())
-print 'Installing the following packages: '
-print str(packages)[1:-1]
+packages.extend(setup_utils.get_missing_requirements(third_party_reqs ))
try:
# Some people prefer setuptools, and may have that installed
from setuptools import setup
except ImportError:
from distutils.core import setup
- print 'Loaded distutils.core'
-else:
- print 'Loaded setuptools'
long_desc = """The Google API Client for Python is a client library for
accessing the Buzz, Moderator, and Latitude APIs."""
setup(name="google-api-python-client",
- version="0.1",
+ version="1.0alpha1",
description="Google API Client Library for Python",
long_description=long_desc,
author="Joe Gregorio",
author_email="jcgregorio@google.com",
url="http://code.google.com/p/google-api-python-client/",
packages=packages,
- package_data={'apiclient':['contrib/buzz/future.json',
- 'contrib/latitude/future.json',
- 'contrib/moderator/future.json']},
+ package_data={
+ 'apiclient': ['contrib/*/*.json']
+ },
license="Apache 2.0",
keywords="google api client",
classifiers=['Development Status :: 3 - Alpha',
@@ -59,4 +65,3 @@
'Operating System :: POSIX',
'Topic :: Internet :: WWW/HTTP'])
-print 'Setup complete!'
diff --git a/setup_utils.py b/setup_utils.py
index 05443b6..6ea7edc 100644
--- a/setup_utils.py
+++ b/setup_utils.py
@@ -18,7 +18,7 @@
__author__ = 'tom.h.miller@gmail.com (Tom Miller)'
-def get_missing_requirements():
+def get_missing_requirements(third_party_reqs ):
"""Return a list of missing third party packages."""
import sys
@@ -32,7 +32,6 @@
import os.path
sys.path.remove(os.path.abspath(os.path.curdir))
missing_pkgs = []
- third_party_reqs = ['oauth2', 'httplib2']
for pkg in third_party_reqs:
try:
__import__(pkg)
@@ -83,4 +82,4 @@
if pkg:
return pkg
else:
- raise ImportError('Cannot find json support')
+ raise ImportError('Cannot find json support')
diff --git a/sitecustomize.py b/sitecustomize.py
new file mode 100644
index 0000000..7483951
--- /dev/null
+++ b/sitecustomize.py
@@ -0,0 +1,12 @@
+# Set up the system so that this development
+# version of google-api-python-client is run, even if
+# an older version is installed on the system.
+#
+# To make this totally automatic add the following to
+# your ~/.bash_profile:
+#
+# export PYTHONPATH=/path/to/where/you/checked/out/apiclient
+import sys
+import os
+
+sys.path.insert(0, os.path.dirname(__file__))