blob: c0ab0b842899c7f28cba37f34f493a1720a99020 [file] [log] [blame]
Craig Citroc12bd642013-10-21 01:10:35 -07001#!/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
19import platform
20
Tres Seaverb07a5a12014-10-06 23:10:05 -040021try:
22 import setuptools
23except ImportError:
24 from ez_setup import use_setuptools
25 use_setuptools()
26 import setuptools
Craig Citroc12bd642013-10-21 01:10:35 -070027
28# Configure the required packages and scripts to install, depending on
29# Python version and OS.
30REQUIRED_PACKAGES = [
Craig Citro5674c272014-11-06 15:24:31 -080031 'httplib2>=0.8',
Evan Parker63e97c12017-11-16 10:53:47 -080032 'fasteners>=0.14',
33 'oauth2client>=1.4.12',
Craig Citro7a2882b2015-08-12 08:39:07 -070034 'six>=1.9.0',
Tres Seaverb07a5a12014-10-06 23:10:05 -040035 ]
36
Tres Seaverd15f4c72014-10-08 12:28:58 -040037CLI_PACKAGES = [
Craig Citro5674c272014-11-06 15:24:31 -080038 'google-apputils>=0.4.0',
Arthur D. Cherbae59816f2016-09-30 08:27:33 -040039 'python-gflags==3.0.6', # Starting version 3.0.7 py26 is not supported.
Tres Seaverd15f4c72014-10-08 12:28:58 -040040]
41
42TESTING_PACKAGES = [
Craig Citro5674c272014-11-06 15:24:31 -080043 'google-apputils>=0.4.0',
Tres Seaverfe749c32014-11-18 15:42:59 -050044 'unittest2>=0.5.1',
Craig Citro5674c272014-11-06 15:24:31 -080045 'mock>=1.0.1',
Tres Seaverd15f4c72014-10-08 12:28:58 -040046]
47
Craig Citro903c5d42013-10-23 11:01:29 -070048CONSOLE_SCRIPTS = [
Arthur D. Cherbaa2117ba2015-09-10 13:28:11 -040049 'gen_client = apitools.gen.gen_client:main',
Craig Citro7bdd56e2015-06-02 17:17:36 -070050]
Craig Citroc12bd642013-10-21 01:10:35 -070051
52py_version = platform.python_version()
53
Craig Citro0cdd7652014-04-08 10:01:45 -070054if py_version < '2.7':
Craig Citro916952a2014-11-12 16:59:57 -080055 REQUIRED_PACKAGES.append('argparse>=1.2.1')
Craig Citroc12bd642013-10-21 01:10:35 -070056
Kristen Traceyba6047a2018-03-08 14:16:07 -050057_APITOOLS_VERSION = '0.5.22'
Craig Citroc12bd642013-10-21 01:10:35 -070058
Tres Seaver623d5d22014-11-20 11:23:03 -050059with open('README.rst') as fileobj:
60 README = fileobj.read()
61
Craig Citroc12bd642013-10-21 01:10:35 -070062setuptools.setup(
Tres Seaver08a927c2014-11-20 10:43:05 -050063 name='google-apitools',
Craig Citroc12bd642013-10-21 01:10:35 -070064 version=_APITOOLS_VERSION,
65 description='client libraries for humans',
Tres Seaver623d5d22014-11-20 11:23:03 -050066 long_description=README,
kevinli78d187a82017-12-21 13:48:23 -050067 url='http://github.com/google/apitools',
Craig Citroc12bd642013-10-21 01:10:35 -070068 author='Craig Citro',
69 author_email='craigcitro@google.com',
70 # Contained modules and scripts.
71 packages=setuptools.find_packages(),
Craig Citrob5151712016-02-14 23:23:43 -080072 entry_points={'console_scripts': CONSOLE_SCRIPTS},
Craig Citroc12bd642013-10-21 01:10:35 -070073 install_requires=REQUIRED_PACKAGES,
Tres Seaver3f015e92014-10-08 14:49:06 -040074 tests_require=REQUIRED_PACKAGES + CLI_PACKAGES + TESTING_PACKAGES,
Craig Citroc5825cc2014-11-06 14:55:51 -080075 extras_require={
Tres Seaverd15f4c72014-10-08 12:28:58 -040076 'cli': CLI_PACKAGES,
77 'testing': TESTING_PACKAGES,
Tres Seaverb07a5a12014-10-06 23:10:05 -040078 },
Craig Citro7bdd56e2015-06-02 17:17:36 -070079 # Add in any packaged data.
80 include_package_data=True,
81 package_data={
82 'apitools.data': ['*'],
83 },
Craig Citroc12bd642013-10-21 01:10:35 -070084 # 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 )