blob: 95df365765c621739e40371f4803250647c3c765 [file] [log] [blame]
Craig Citro751b7fb2014-09-23 11:20:38 -07001# Copyright 2014 Google Inc. All Rights Reserved.
Tom Miller7c95d812010-10-11 11:50:52 -07002#
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"""
Craig Citroa540cf72014-08-18 22:50:58 -070020from __future__ import print_function
21
22import sys
23
Craig Citro06823722014-10-15 11:48:30 -070024if sys.version_info < (2, 6):
Craig Citro28467c82014-10-09 00:15:00 -070025 print('google-api-python-client requires python version >= 2.6.',
26 file=sys.stderr)
Craig Citroa540cf72014-08-18 22:50:58 -070027 sys.exit(1)
Pat Feratee52ea212015-03-10 12:59:13 -070028if (3, 1) <= sys.version_info < (3, 3):
29 print('google-api-python-client requires python3 version >= 3.3.',
30 file=sys.stderr)
31 sys.exit(1)
Craig Citroa540cf72014-08-18 22:50:58 -070032
Joe Gregorio336b9782011-09-15 14:35:54 -040033from setuptools import setup
Craig Citrof6b454c2014-10-15 22:54:52 -070034import pkg_resources
35
36def _DetectBadness():
37 import os
38 if 'SKIP_GOOGLEAPICLIENT_COMPAT_CHECK' in os.environ:
39 return
40 o2c_pkg = None
41 try:
42 o2c_pkg = pkg_resources.get_distribution('oauth2client')
43 except pkg_resources.DistributionNotFound:
44 pass
45 oauth2client = None
46 try:
47 import oauth2client
48 except ImportError:
49 pass
50 if o2c_pkg is None and oauth2client is not None:
51 raise RuntimeError(
52 'Previous version of google-api-python-client detected; due to a '
53 'packaging issue, we cannot perform an in-place upgrade. Please remove '
54 'the old version and re-install this package.'
55 )
56
57_DetectBadness()
Joe Gregorio01b92702011-03-23 21:44:42 -040058
Joe Gregorio6429bf62011-03-01 22:53:21 -080059packages = [
Craig Citro7547de62014-10-13 09:21:08 -070060 'apiclient',
John Asmuth864311d2014-04-24 15:46:08 -040061 'googleapiclient',
John Asmuth864311d2014-04-24 15:46:08 -040062]
Joe Gregorio5cdaa512011-03-28 16:41:55 -040063
Joe Gregoriod667c9d2011-10-17 13:25:24 -040064install_requires = [
Joe Gregorio3cc9a452013-03-07 10:08:39 -050065 'httplib2>=0.8',
Pat Feratee52ea212015-03-10 12:59:13 -070066 'oauth2client>=1.4.6',
INADA Naoki93ff27b2015-03-04 03:47:14 +090067 'six>=1.6.1',
Craig Citro951b75f2014-08-18 23:14:20 -070068 'uritemplate>=0.6',
John Asmuth864311d2014-04-24 15:46:08 -040069]
Joe Gregorio6429bf62011-03-01 22:53:21 -080070
Craig Citro06823722014-10-15 11:48:30 -070071if sys.version_info < (2, 7):
72 install_requires.append('argparse')
73
Joe Gregorio3ad5e9a2010-12-09 15:01:04 -050074long_desc = """The Google API Client for Python is a client library for
Joe Gregorioc4fc0952011-11-09 12:21:11 -050075accessing the Plus, Moderator, and many other Google APIs."""
Tom Miller7c95d812010-10-11 11:50:52 -070076
John Asmuth864311d2014-04-24 15:46:08 -040077import googleapiclient
78version = googleapiclient.__version__
Joe Gregorio696583c2012-03-21 15:20:51 -040079
John Asmuth864311d2014-04-24 15:46:08 -040080setup(
81 name="google-api-python-client",
82 version=version,
83 description="Google API Client Library for Python",
84 long_description=long_desc,
Craig Citro9b906772014-10-09 00:21:10 -070085 author="Google Inc.",
John Asmuth864311d2014-04-24 15:46:08 -040086 url="http://github.com/google/google-api-python-client/",
87 install_requires=install_requires,
88 packages=packages,
89 package_data={},
90 license="Apache 2.0",
91 keywords="google api client",
92 classifiers=[
Pat Feratee52ea212015-03-10 12:59:13 -070093 'Programming Language :: Python :: 2',
94 'Programming Language :: Python :: 2.6',
95 'Programming Language :: Python :: 2.7',
96 'Programming Language :: Python :: 3',
97 'Programming Language :: Python :: 3.3',
98 'Programming Language :: Python :: 3.4',
John Asmuth864311d2014-04-24 15:46:08 -040099 'Development Status :: 5 - Production/Stable',
100 'Intended Audience :: Developers',
101 'License :: OSI Approved :: Apache Software License',
Pat Feratee52ea212015-03-10 12:59:13 -0700102 'Operating System :: OS Independent',
John Asmuth864311d2014-04-24 15:46:08 -0400103 'Topic :: Internet :: WWW/HTTP',
104 ],
John Asmuth864311d2014-04-24 15:46:08 -0400105)