blob: 0c2c5bb39bfb2f9cd61202bc712ea55f585c28c0 [file] [log] [blame]
Jon Wayne Parrott377f2932016-10-04 10:20:36 -07001# Copyright 2014 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.
14
Jon Wayne Parrott01906602017-03-22 10:10:32 -070015import io
Bu Sun Kima2cbc322021-03-16 14:56:02 -060016import os
Jon Wayne Parrott01906602017-03-22 10:10:32 -070017
Dan Lee36e6f0f2021-04-16 19:21:57 -040018import setuptools
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070019
Dan Lee36e6f0f2021-04-16 19:21:57 -040020# Disable version normalization performed by setuptools.setup()
21# Adding this in even though it works for Python3.x, but does not
22# work for Python 2.7
23try:
24 # Try the approach of using sic(), added in setuptools 46.1.0
25 from setuptools import sic
26except ImportError:
27 # Try the approach of replacing packaging.version.Version
28 sic = lambda v: v
29 try:
30 # setuptools >=39.0.0 uses packaging from setuptools.extern
31 from setuptools.extern import packaging
32 except ImportError:
33 # setuptools <39.0.0 uses packaging from pkg_resources.extern
34 from pkg_resources.extern import packaging
35 packaging.version.Version = packaging.version.LegacyVersion
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070036
37DEPENDENCIES = (
Renovate Bot091ed162019-12-17 01:43:01 +020038 "cachetools>=2.0.0,<5.0",
Bu Sun Kim9eec0912019-10-21 17:04:21 -070039 "pyasn1-modules>=0.2.1",
WhiteSource Renovate6dd25972020-07-21 23:42:03 +020040 # rsa==4.5 is the last version to support 2.7
41 # https://github.com/sybrenstuvel/python-rsa/issues/152#issuecomment-643470233
Tres Seaver6de753d2020-12-11 13:20:39 -050042 'rsa<4.6; python_version < "3.6"',
43 'rsa>=3.1.4,<5; python_version >= "3.6"',
Bu Sun Kim9eec0912019-10-21 17:04:21 -070044 "setuptools>=40.3.0",
45 "six>=1.9.0",
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070046)
47
arithmetic1728aeab5d02021-02-12 11:57:12 -080048extras = {
49 "aiohttp": "aiohttp >= 3.6.2, < 4.0.0dev; python_version>='3.6'",
50 "pyopenssl": "pyopenssl>=20.0.0",
arithmetic172882293fe2021-04-14 11:22:13 -070051 "reauth": "pyu2f>=0.1.5",
arithmetic1728aeab5d02021-02-12 11:57:12 -080052}
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070053
Bu Sun Kim9eec0912019-10-21 17:04:21 -070054with io.open("README.rst", "r") as fh:
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070055 long_description = fh.read()
56
Bu Sun Kima2cbc322021-03-16 14:56:02 -060057package_root = os.path.abspath(os.path.dirname(__file__))
58
59version = {}
60with open(os.path.join(package_root, "google/auth/version.py")) as fp:
61 exec(fp.read(), version)
62version = version["__version__"]
Bu Sun Kimd3406b32019-11-04 15:40:13 -080063
Dan Lee36e6f0f2021-04-16 19:21:57 -040064setuptools.setup(
Bu Sun Kim9eec0912019-10-21 17:04:21 -070065 name="google-auth",
Dan Lee36e6f0f2021-04-16 19:21:57 -040066 version=sic(version),
Bu Sun Kim9eec0912019-10-21 17:04:21 -070067 author="Google Cloud Platform",
Bu Sun Kime61a8732019-11-11 11:26:00 -080068 author_email="googleapis-packages@google.com",
Bu Sun Kim9eec0912019-10-21 17:04:21 -070069 description="Google Authentication Library",
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070070 long_description=long_description,
Tim Swast011fabb2019-12-17 16:45:54 -080071 url="https://github.com/googleapis/google-auth-library-python",
Dan Lee36e6f0f2021-04-16 19:21:57 -040072 packages=setuptools.find_packages(exclude=("tests*", "system_tests*")),
Bu Sun Kim9eec0912019-10-21 17:04:21 -070073 namespace_packages=("google",),
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070074 install_requires=DEPENDENCIES,
Christopher Wilcoxa9240112020-10-05 10:08:02 -070075 extras_require=extras,
Tres Seaver6de753d2020-12-11 13:20:39 -050076 python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*",
Bu Sun Kim9eec0912019-10-21 17:04:21 -070077 license="Apache 2.0",
78 keywords="google auth oauth client",
Thilo Maurer4997be12018-08-01 23:33:08 +020079 classifiers=[
Bu Sun Kim9eec0912019-10-21 17:04:21 -070080 "Programming Language :: Python :: 2",
81 "Programming Language :: Python :: 2.7",
82 "Programming Language :: Python :: 3",
Bu Sun Kim9eec0912019-10-21 17:04:21 -070083 "Programming Language :: Python :: 3.6",
84 "Programming Language :: Python :: 3.7",
Tres Seaver1aad54a2020-07-22 20:17:28 -040085 "Programming Language :: Python :: 3.8",
Tres Seaver6de753d2020-12-11 13:20:39 -050086 "Programming Language :: Python :: 3.9",
Bu Sun Kim9eec0912019-10-21 17:04:21 -070087 "Development Status :: 5 - Production/Stable",
88 "Intended Audience :: Developers",
89 "License :: OSI Approved :: Apache Software License",
90 "Operating System :: POSIX",
91 "Operating System :: Microsoft :: Windows",
92 "Operating System :: MacOS :: MacOS X",
93 "Operating System :: OS Independent",
94 "Topic :: Internet :: WWW/HTTP",
Thilo Maurer4997be12018-08-01 23:33:08 +020095 ],
Jon Wayne Parrott377f2932016-10-04 10:20:36 -070096)