blob: 538c1e0b08edb2d0c2af6f8b54cf3d0a963d5c3b [file] [log] [blame]
Tom Miller7c95d812010-10-11 11:50:52 -07001# Copyright (C) 2010 Google Inc.
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.
Joe Gregorio48d361f2010-08-18 13:19:21 -040014
Tom Miller7c95d812010-10-11 11:50:52 -070015"""Setup script for Google API Python client.
16
17Also installs included versions of third party libraries, if those libraries
18are not already installed.
19"""
Tom Miller7c95d812010-10-11 11:50:52 -070020import setup_utils
21
Joe Gregorio5cdaa512011-03-28 16:41:55 -040022has_setuptools = False
23try:
24 from setuptools import setup
25 has_setuptools = True
26except ImportError:
27 from distutils.core import setup
Joe Gregorio01b92702011-03-23 21:44:42 -040028
Joe Gregorio6429bf62011-03-01 22:53:21 -080029packages = [
30 'apiclient',
31 'oauth2client',
32 'apiclient.ext',
33 'apiclient.contrib',
34 'apiclient.contrib.buzz',
35 'apiclient.contrib.latitude',
36 'apiclient.contrib.moderator',
Joe Gregorio4258d6b2011-03-18 10:20:16 -040037 'uritemplate',
Joe Gregorio6429bf62011-03-01 22:53:21 -080038]
Joe Gregorio5cdaa512011-03-28 16:41:55 -040039
40install_requires = []
Joe Gregorio01b92702011-03-23 21:44:42 -040041py_modules = []
Joe Gregorio6429bf62011-03-01 22:53:21 -080042
Tom Miller7c95d812010-10-11 11:50:52 -070043
Joe Gregorio5cdaa512011-03-28 16:41:55 -040044# (module to test for, install_requires to add if missing, packages to add if missing, py_modules to add if missing)
45REQUIREMENTS = [
46 ('httplib2', 'httplib2', 'httplib2', None),
47 ('oauth2', 'oauth2', 'oauth2', None),
48 ('gflags', 'python-gflags', None, ['gflags', 'gflags_validators']),
49 (['json', 'simplejson', 'django.utils'], 'simplejson', 'simplejson', None)
50]
Tom Miller7c95d812010-10-11 11:50:52 -070051
Joe Gregorio5cdaa512011-03-28 16:41:55 -040052for import_name, requires, package, modules in REQUIREMENTS:
53 if setup_utils.is_missing(import_name):
54 if has_setuptools:
55 install_requires.append(requires)
56 else:
57 if package is not None:
58 packages.append(package)
59 else:
60 py_modules.extend(modules)
61
Tom Miller7c95d812010-10-11 11:50:52 -070062
Joe Gregorio3ad5e9a2010-12-09 15:01:04 -050063long_desc = """The Google API Client for Python is a client library for
Tom Miller7c95d812010-10-11 11:50:52 -070064accessing the Buzz, Moderator, and Latitude APIs."""
65
Joe Gregorio48d361f2010-08-18 13:19:21 -040066setup(name="google-api-python-client",
Joe Gregorio5cdaa512011-03-28 16:41:55 -040067 version="1.0alpha10",
Joe Gregorio48d361f2010-08-18 13:19:21 -040068 description="Google API Client Library for Python",
Tom Miller7c95d812010-10-11 11:50:52 -070069 long_description=long_desc,
Joe Gregorio48d361f2010-08-18 13:19:21 -040070 author="Joe Gregorio",
71 author_email="jcgregorio@google.com",
72 url="http://code.google.com/p/google-api-python-client/",
Joe Gregorio5cdaa512011-03-28 16:41:55 -040073 install_requires=install_requires,
Tom Miller7c95d812010-10-11 11:50:52 -070074 packages=packages,
Joe Gregorio01b92702011-03-23 21:44:42 -040075 py_modules=py_modules,
Joe Gregorio6429bf62011-03-01 22:53:21 -080076 package_data={
77 'apiclient': ['contrib/*/*.json']
78 },
Tom Miller7c95d812010-10-11 11:50:52 -070079 license="Apache 2.0",
80 keywords="google api client",
81 classifiers=['Development Status :: 3 - Alpha',
82 'Intended Audience :: Developers',
83 'License :: OSI Approved :: Apache Software License',
84 'Operating System :: POSIX',
85 'Topic :: Internet :: WWW/HTTP'])