Adds make targets 'release' and 'prerelease' which build release
source packages, register them, etc.
This commit is contained in:
@@ -4,9 +4,15 @@ syntax: glob
|
|||||||
*.dat
|
*.dat
|
||||||
.*.swp
|
.*.swp
|
||||||
*/.git/*
|
*/.git/*
|
||||||
|
*/.cache/*
|
||||||
.gitignore
|
.gitignore
|
||||||
samples/buzz/*.dat
|
samples/buzz/*.dat
|
||||||
samples/moderator/*.dat
|
samples/moderator/*.dat
|
||||||
htmlcov/*
|
htmlcov/*
|
||||||
.coverage
|
.coverage
|
||||||
database.sqlite3
|
database.sqlite3
|
||||||
|
build/*
|
||||||
|
googlecode_upload.py
|
||||||
|
google_api_python_client.egg-info/*
|
||||||
|
dist/*
|
||||||
|
MANIFEST
|
||||||
|
8
MANIFEST.in
Normal file
8
MANIFEST.in
Normal 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
|
||||||
|
|
13
Makefile
13
Makefile
@@ -8,3 +8,16 @@ test:
|
|||||||
docs:
|
docs:
|
||||||
cd docs; ./build.sh
|
cd docs; ./build.sh
|
||||||
python describe.py
|
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
|
||||||
|
|
||||||
|
@@ -100,6 +100,7 @@ class JsonModel(Model):
|
|||||||
"""
|
"""
|
||||||
query = self._build_query(query_params)
|
query = self._build_query(query_params)
|
||||||
headers['accept'] = 'application/json'
|
headers['accept'] = 'application/json'
|
||||||
|
headers['accept-encoding'] = 'gzip, deflate'
|
||||||
if 'user-agent' in headers:
|
if 'user-agent' in headers:
|
||||||
headers['user-agent'] += ' '
|
headers['user-agent'] += ' '
|
||||||
else:
|
else:
|
||||||
|
@@ -31,12 +31,11 @@ def main():
|
|||||||
client_id='433807057907.apps.googleusercontent.com',
|
client_id='433807057907.apps.googleusercontent.com',
|
||||||
client_secret='jigtZpMApkRxncxikFpR+SFg',
|
client_secret='jigtZpMApkRxncxikFpR+SFg',
|
||||||
scope='https://www.googleapis.com/auth/moderator',
|
scope='https://www.googleapis.com/auth/moderator',
|
||||||
user_agent='moderator-cmdline-sample/1.0',
|
user_agent='moderator-cmdline-sample/1.0')
|
||||||
xoauth_displayname='Moderator Client Example App')
|
|
||||||
|
|
||||||
credentials = run(flow, storage)
|
credentials = run(flow, storage)
|
||||||
|
|
||||||
http = httplib2.Http()
|
http = httplib2.Http(cache=".cache")
|
||||||
http = credentials.authorize(http)
|
http = credentials.authorize(http)
|
||||||
|
|
||||||
service = build("moderator", "v1", http=http)
|
service = build("moderator", "v1", http=http)
|
||||||
|
29
setup.py
29
setup.py
@@ -20,37 +20,43 @@ are not already installed.
|
|||||||
|
|
||||||
import setup_utils
|
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
|
# Don't clobber installed versions of third party libraries
|
||||||
# with what we include.
|
# with what we include.
|
||||||
packages.extend(setup_utils.get_missing_requirements())
|
packages.extend(setup_utils.get_missing_requirements(third_party_reqs ))
|
||||||
print 'Installing the following packages: '
|
|
||||||
print str(packages)[1:-1]
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Some people prefer setuptools, and may have that installed
|
# Some people prefer setuptools, and may have that installed
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils.core import setup
|
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
|
long_desc = """The Google API Client for Python is a client library for
|
||||||
accessing the Buzz, Moderator, and Latitude APIs."""
|
accessing the Buzz, Moderator, and Latitude APIs."""
|
||||||
|
|
||||||
setup(name="google-api-python-client",
|
setup(name="google-api-python-client",
|
||||||
version="0.1",
|
version="1.0alpha1",
|
||||||
description="Google API Client Library for Python",
|
description="Google API Client Library for Python",
|
||||||
long_description=long_desc,
|
long_description=long_desc,
|
||||||
author="Joe Gregorio",
|
author="Joe Gregorio",
|
||||||
author_email="jcgregorio@google.com",
|
author_email="jcgregorio@google.com",
|
||||||
url="http://code.google.com/p/google-api-python-client/",
|
url="http://code.google.com/p/google-api-python-client/",
|
||||||
packages=packages,
|
packages=packages,
|
||||||
package_data={'apiclient':['contrib/buzz/future.json',
|
package_data={
|
||||||
'contrib/latitude/future.json',
|
'apiclient': ['contrib/*/*.json']
|
||||||
'contrib/moderator/future.json']},
|
},
|
||||||
license="Apache 2.0",
|
license="Apache 2.0",
|
||||||
keywords="google api client",
|
keywords="google api client",
|
||||||
classifiers=['Development Status :: 3 - Alpha',
|
classifiers=['Development Status :: 3 - Alpha',
|
||||||
@@ -59,4 +65,3 @@ setup(name="google-api-python-client",
|
|||||||
'Operating System :: POSIX',
|
'Operating System :: POSIX',
|
||||||
'Topic :: Internet :: WWW/HTTP'])
|
'Topic :: Internet :: WWW/HTTP'])
|
||||||
|
|
||||||
print 'Setup complete!'
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
__author__ = 'tom.h.miller@gmail.com (Tom Miller)'
|
__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."""
|
"""Return a list of missing third party packages."""
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -32,7 +32,6 @@ def get_missing_requirements():
|
|||||||
import os.path
|
import os.path
|
||||||
sys.path.remove(os.path.abspath(os.path.curdir))
|
sys.path.remove(os.path.abspath(os.path.curdir))
|
||||||
missing_pkgs = []
|
missing_pkgs = []
|
||||||
third_party_reqs = ['oauth2', 'httplib2']
|
|
||||||
for pkg in third_party_reqs:
|
for pkg in third_party_reqs:
|
||||||
try:
|
try:
|
||||||
__import__(pkg)
|
__import__(pkg)
|
||||||
@@ -83,4 +82,4 @@ def import_json(import_path=None):
|
|||||||
if pkg:
|
if pkg:
|
||||||
return pkg
|
return pkg
|
||||||
else:
|
else:
|
||||||
raise ImportError('Cannot find json support')
|
raise ImportError('Cannot find json support')
|
||||||
|
12
sitecustomize.py
Normal file
12
sitecustomize.py
Normal 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__))
|
Reference in New Issue
Block a user