Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # |
| 3 | # Copyright 2013 Google Inc. All Rights Reserved. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | """Setup configuration.""" |
| 18 | |
| 19 | import platform |
| 20 | |
Tres Seaver | b07a5a1 | 2014-10-06 23:10:05 -0400 | [diff] [blame] | 21 | try: |
| 22 | import setuptools |
| 23 | except ImportError: |
| 24 | from ez_setup import use_setuptools |
| 25 | use_setuptools() |
| 26 | import setuptools |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 27 | |
| 28 | # Configure the required packages and scripts to install, depending on |
| 29 | # Python version and OS. |
| 30 | REQUIRED_PACKAGES = [ |
Craig Citro | 5674c27 | 2014-11-06 15:24:31 -0800 | [diff] [blame] | 31 | 'httplib2>=0.8', |
Evan Parker | 63e97c1 | 2017-11-16 10:53:47 -0800 | [diff] [blame] | 32 | 'fasteners>=0.14', |
| 33 | 'oauth2client>=1.4.12', |
Craig Citro | 7a2882b | 2015-08-12 08:39:07 -0700 | [diff] [blame] | 34 | 'six>=1.9.0', |
Tres Seaver | b07a5a1 | 2014-10-06 23:10:05 -0400 | [diff] [blame] | 35 | ] |
| 36 | |
Tres Seaver | d15f4c7 | 2014-10-08 12:28:58 -0400 | [diff] [blame] | 37 | CLI_PACKAGES = [ |
Craig Citro | 5674c27 | 2014-11-06 15:24:31 -0800 | [diff] [blame] | 38 | 'google-apputils>=0.4.0', |
Arthur D. Cherba | e59816f | 2016-09-30 08:27:33 -0400 | [diff] [blame] | 39 | 'python-gflags==3.0.6', # Starting version 3.0.7 py26 is not supported. |
Tres Seaver | d15f4c7 | 2014-10-08 12:28:58 -0400 | [diff] [blame] | 40 | ] |
| 41 | |
| 42 | TESTING_PACKAGES = [ |
Craig Citro | 5674c27 | 2014-11-06 15:24:31 -0800 | [diff] [blame] | 43 | 'google-apputils>=0.4.0', |
Tres Seaver | fe749c3 | 2014-11-18 15:42:59 -0500 | [diff] [blame] | 44 | 'unittest2>=0.5.1', |
Craig Citro | 5674c27 | 2014-11-06 15:24:31 -0800 | [diff] [blame] | 45 | 'mock>=1.0.1', |
Tres Seaver | d15f4c7 | 2014-10-08 12:28:58 -0400 | [diff] [blame] | 46 | ] |
| 47 | |
Craig Citro | 903c5d4 | 2013-10-23 11:01:29 -0700 | [diff] [blame] | 48 | CONSOLE_SCRIPTS = [ |
Arthur D. Cherba | a2117ba | 2015-09-10 13:28:11 -0400 | [diff] [blame] | 49 | 'gen_client = apitools.gen.gen_client:main', |
Craig Citro | 7bdd56e | 2015-06-02 17:17:36 -0700 | [diff] [blame] | 50 | ] |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 51 | |
| 52 | py_version = platform.python_version() |
| 53 | |
Craig Citro | 0cdd765 | 2014-04-08 10:01:45 -0700 | [diff] [blame] | 54 | if py_version < '2.7': |
Craig Citro | 916952a | 2014-11-12 16:59:57 -0800 | [diff] [blame] | 55 | REQUIRED_PACKAGES.append('argparse>=1.2.1') |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 56 | |
Kristen Tracey | ba6047a | 2018-03-08 14:16:07 -0500 | [diff] [blame] | 57 | _APITOOLS_VERSION = '0.5.22' |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 58 | |
Tres Seaver | 623d5d2 | 2014-11-20 11:23:03 -0500 | [diff] [blame] | 59 | with open('README.rst') as fileobj: |
| 60 | README = fileobj.read() |
| 61 | |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 62 | setuptools.setup( |
Tres Seaver | 08a927c | 2014-11-20 10:43:05 -0500 | [diff] [blame] | 63 | name='google-apitools', |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 64 | version=_APITOOLS_VERSION, |
| 65 | description='client libraries for humans', |
Tres Seaver | 623d5d2 | 2014-11-20 11:23:03 -0500 | [diff] [blame] | 66 | long_description=README, |
kevinli7 | 8d187a8 | 2017-12-21 13:48:23 -0500 | [diff] [blame] | 67 | url='http://github.com/google/apitools', |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 68 | author='Craig Citro', |
| 69 | author_email='craigcitro@google.com', |
| 70 | # Contained modules and scripts. |
| 71 | packages=setuptools.find_packages(), |
Craig Citro | b515171 | 2016-02-14 23:23:43 -0800 | [diff] [blame] | 72 | entry_points={'console_scripts': CONSOLE_SCRIPTS}, |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 73 | install_requires=REQUIRED_PACKAGES, |
Tres Seaver | 3f015e9 | 2014-10-08 14:49:06 -0400 | [diff] [blame] | 74 | tests_require=REQUIRED_PACKAGES + CLI_PACKAGES + TESTING_PACKAGES, |
Craig Citro | c5825cc | 2014-11-06 14:55:51 -0800 | [diff] [blame] | 75 | extras_require={ |
Tres Seaver | d15f4c7 | 2014-10-08 12:28:58 -0400 | [diff] [blame] | 76 | 'cli': CLI_PACKAGES, |
| 77 | 'testing': TESTING_PACKAGES, |
Tres Seaver | b07a5a1 | 2014-10-06 23:10:05 -0400 | [diff] [blame] | 78 | }, |
Craig Citro | 7bdd56e | 2015-06-02 17:17:36 -0700 | [diff] [blame] | 79 | # Add in any packaged data. |
| 80 | include_package_data=True, |
| 81 | package_data={ |
| 82 | 'apitools.data': ['*'], |
| 83 | }, |
Craig Citro | c12bd64 | 2013-10-21 01:10:35 -0700 | [diff] [blame] | 84 | # PyPI package information. |
| 85 | classifiers=[ |
| 86 | 'License :: OSI Approved :: Apache Software License', |
| 87 | 'Topic :: Software Development :: Libraries', |
| 88 | 'Topic :: Software Development :: Libraries :: Python Modules', |
| 89 | ], |
| 90 | license='Apache 2.0', |
| 91 | keywords='apitools', |
| 92 | ) |