Adds make targets 'release' and 'prerelease' which build release

source packages, register them, etc.
This commit is contained in:
Joe Gregorio
2011-03-01 22:53:21 -08:00
parent 1ae3e74c08
commit 6429bf6681
8 changed files with 61 additions and 18 deletions

View File

@@ -4,9 +4,15 @@ syntax: glob
*.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

8
MANIFEST.in Normal file
View File

@@ -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

View File

@@ -8,3 +8,16 @@ test:
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

View File

@@ -100,6 +100,7 @@ class JsonModel(Model):
"""
query = self._build_query(query_params)
headers['accept'] = 'application/json'
headers['accept-encoding'] = 'gzip, deflate'
if 'user-agent' in headers:
headers['user-agent'] += ' '
else:

View File

@@ -31,12 +31,11 @@ def main():
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)

View File

@@ -20,37 +20,43 @@ are not already installed.
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 @@ setup(name="google-api-python-client",
'Operating System :: POSIX',
'Topic :: Internet :: WWW/HTTP'])
print 'Setup complete!'

View File

@@ -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 @@ def get_missing_requirements():
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)

12
sitecustomize.py Normal file
View File

@@ -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__))