OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 Google Inc. All Rights Reserved. |
| 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. |
| 14 |
| 15 """Setup script for Google API Python client. |
| 16 |
| 17 Also installs included versions of third party libraries, if those libraries |
| 18 are not already installed. |
| 19 """ |
| 20 from __future__ import print_function |
| 21 |
| 22 import sys |
| 23 |
| 24 if sys.version_info < (2, 6): |
| 25 print('google-api-python-client requires python version >= 2.6.', |
| 26 file=sys.stderr) |
| 27 sys.exit(1) |
| 28 |
| 29 from setuptools import setup |
| 30 import pkg_resources |
| 31 |
| 32 def _DetectBadness(): |
| 33 import os |
| 34 if 'SKIP_GOOGLEAPICLIENT_COMPAT_CHECK' in os.environ: |
| 35 return |
| 36 o2c_pkg = None |
| 37 try: |
| 38 o2c_pkg = pkg_resources.get_distribution('oauth2client') |
| 39 except pkg_resources.DistributionNotFound: |
| 40 pass |
| 41 oauth2client = None |
| 42 try: |
| 43 import oauth2client |
| 44 except ImportError: |
| 45 pass |
| 46 if o2c_pkg is None and oauth2client is not None: |
| 47 raise RuntimeError( |
| 48 'Previous version of google-api-python-client detected; due to a ' |
| 49 'packaging issue, we cannot perform an in-place upgrade. Please remove ' |
| 50 'the old version and re-install this package.' |
| 51 ) |
| 52 |
| 53 _DetectBadness() |
| 54 |
| 55 packages = [ |
| 56 'apiclient', |
| 57 'googleapiclient', |
| 58 ] |
| 59 |
| 60 install_requires = [ |
| 61 'httplib2>=0.8', |
| 62 'oauth2client>=1.3', |
| 63 'uritemplate>=0.6', |
| 64 ] |
| 65 |
| 66 if sys.version_info < (2, 7): |
| 67 install_requires.append('argparse') |
| 68 |
| 69 long_desc = """The Google API Client for Python is a client library for |
| 70 accessing the Plus, Moderator, and many other Google APIs.""" |
| 71 |
| 72 import googleapiclient |
| 73 version = googleapiclient.__version__ |
| 74 |
| 75 setup( |
| 76 name="google-api-python-client", |
| 77 version=version, |
| 78 description="Google API Client Library for Python", |
| 79 long_description=long_desc, |
| 80 author="Google Inc.", |
| 81 url="http://github.com/google/google-api-python-client/", |
| 82 install_requires=install_requires, |
| 83 packages=packages, |
| 84 package_data={}, |
| 85 license="Apache 2.0", |
| 86 keywords="google api client", |
| 87 classifiers=[ |
| 88 'Development Status :: 5 - Production/Stable', |
| 89 'Intended Audience :: Developers', |
| 90 'License :: OSI Approved :: Apache Software License', |
| 91 'Operating System :: POSIX', |
| 92 'Topic :: Internet :: WWW/HTTP', |
| 93 ], |
| 94 ) |
OLD | NEW |