Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,24 @@
import io
import os

from setuptools import find_packages
from setuptools import setup
import setuptools

# Disable version normalization performed by setuptools.setup()
# Adding this in even though it works for Python3.x, but does not
# work for Python 2.7
try:
# Try the approach of using sic(), added in setuptools 46.1.0
from setuptools import sic
except ImportError:
# Try the approach of replacing packaging.version.Version
sic = lambda v: v
try:
# setuptools >=39.0.0 uses packaging from setuptools.extern
from setuptools.extern import packaging
except ImportError:
# setuptools <39.0.0 uses packaging from pkg_resources.extern
from pkg_resources.extern import packaging
packaging.version.Version = packaging.version.LegacyVersion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the workaround, let's bump the setuptools version since it's a dependency.
https://github.com/googleapis/google-auth-library-python/blob/master/setup.py#L29

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried doing that, it works for Python3 but does not work for Python2 :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah it must be from setuptools removing support for Python 2. This LGTM.


DEPENDENCIES = (
"cachetools>=2.0.0,<5.0",
Expand Down Expand Up @@ -46,15 +61,15 @@
exec(fp.read(), version)
version = version["__version__"]

setup(
setuptools.setup(
name="google-auth",
version=version,
version=sic(version),
author="Google Cloud Platform",
author_email="googleapis-packages@google.com",
description="Google Authentication Library",
long_description=long_description,
url="https://github.com/googleapis/google-auth-library-python",
packages=find_packages(exclude=("tests*", "system_tests*")),
packages=setuptools.find_packages(exclude=("tests*", "system_tests*")),
namespace_packages=("google",),
install_requires=DEPENDENCIES,
extras_require=extras,
Expand Down