Skip to content
Draft
Show file tree
Hide file tree
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
16 changes: 7 additions & 9 deletions packages/google-auth/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ def mypy(session):


@nox.session(python=ALL_PYTHON)
@nox.parametrize(["install_deprecated_extras"], (True, False))
def unit(session, install_deprecated_extras):
@nox.parametrize(["install_extras"], (True, False))
def unit(session, install_extras):
# Install all test dependencies, then install this package in-place.

if session.python in ("3.7",):
session.skip("Python 3.7 is no longer supported")
min_py, max_py = UNIT_TEST_PYTHON_VERSIONS[0], UNIT_TEST_PYTHON_VERSIONS[-1]
if not install_deprecated_extras and session.python not in (min_py, max_py):
if not install_extras and session.python not in (min_py, max_py):
# only run double tests on first and last supported versions
session.skip(
f"Extended tests only run on boundary Python versions ({min_py}, {max_py}) to reduce CI load."
Expand All @@ -131,12 +131,10 @@ def unit(session, install_deprecated_extras):
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
extras_str = "testing"
if install_deprecated_extras:
# rsa and oauth2client were both archived and support dropped,
# but we still test old code paths
session.install("oauth2client")
extras_str += ",rsa"
if install_extras:
extras_str = "testing"
else:
extras_str = "testing_minimal"
session.install("-e", f".[{extras_str}]", "-c", constraints_path)
session.run(
"pytest",
Expand Down
31 changes: 19 additions & 12 deletions packages/google-auth/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
"cryptography >= 38.0.3",
]

requests_base_require = ["requests >= 2.20.0, < 3.0.0"]

DEPENDENCIES = (
"pyasn1-modules>=0.2.1",
cryptography_base_require,
requests_base_require,
)

requests_extra_require = ["requests >= 2.20.0, < 3.0.0"]

aiohttp_extra_require = ["aiohttp >= 3.6.2, < 4.0.0", *requests_extra_require]
aiohttp_extra_require = ["aiohttp >= 3.6.2, < 4.0.0"]

pyjwt_extra_require = ["pyjwt>=2.0"]

Expand All @@ -46,32 +48,36 @@
rsa_extra_require = ["rsa>=3.1.4,<5"]

# Unit test requirements.
testing_extra_require = [
testing_minimal_require = [
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1735): Remove `grpcio` from testing requirements once an extra is added for `grpcio` dependency.
"grpcio",
"flask",
"freezegun",
*pyjwt_extra_require,
"pytest",
"pytest-cov",
"pytest-localserver",
"responses",
"pytest-asyncio",
]

testing_extra_require = [
*testing_minimal_require,
*pyjwt_extra_require,
*pyopenssl_extra_require,
*reauth_extra_require,
"responses",
*urllib3_extra_require,
# Async Dependencies
*aiohttp_extra_require,
"aioresponses",
"pytest-asyncio",
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1665): Remove the pinned version of pyopenssl
# once `TestDecryptPrivateKey::test_success` is updated to remove the deprecated `OpenSSL.crypto.sign` and
# `OpenSSL.crypto.verify` methods. See: https://www.pyopenssl.org/en/latest/changelog.html#id3.
"pyopenssl < 24.3.0",
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1722): `test_aiohttp_requests` depend on
# aiohttp < 3.10.0 which is a bug. Investigate and remove the pinned aiohttp version.
"aiohttp < 3.10.0",
*pyopenssl_extra_require,
"aioresponses",
"oauth2client",
*rsa_extra_require,
]
Comment on lines +63 to 78
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The definition of testing_extra_require contains syntax errors, including missing commas and a duplicated dependency (*pyopenssl_extra_require). These issues will cause a SyntaxError when setup.py is parsed, breaking package installation.

testing_extra_require = [
    *testing_minimal_require,
    *pyjwt_extra_require,
    *pyopenssl_extra_require,
    *reauth_extra_require,
    *urllib3_extra_require,
    # Async Dependencies
    *aiohttp_extra_require,
    # TODO(https://github.com/googleapis/google-auth-library-python/issues/1722): `test_aiohttp_requests` depend on
    # aiohttp < 3.10.0 which is a bug. Investigate and remove the pinned aiohttp version.
    "aiohttp < 3.10.0",
    "aioresponses",
    "oauth2client",
    *rsa_extra_require,
]



extras = {
# Note: cryptography was made into a required dependency. Extra is kept for backwards compatibility
"cryptography": cryptography_base_require,
Expand All @@ -80,8 +86,9 @@
"pyopenssl": pyopenssl_extra_require,
"pyjwt": pyjwt_extra_require,
"reauth": reauth_extra_require,
"requests": requests_extra_require,
"requests": requests_base_require,
"testing": testing_extra_require,
"testing_minimal": testing_minimal_require,
"urllib3": urllib3_extra_require,
"rsa": rsa_extra_require,
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1735): Add an extra for `grpcio` dependency.
Expand Down
Loading