Skip to content

Commit 0b617d0

Browse files
committed
ci(google-auth): separate core vs extras lower-bound constraints
1 parent 98bfd62 commit 0b617d0

9 files changed

Lines changed: 62 additions & 36 deletions

packages/google-auth/noxfile.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,27 +159,37 @@ def mypy(session):
159159

160160

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

166166
min_py, max_py = UNIT_TEST_PYTHON_VERSIONS[0], UNIT_TEST_PYTHON_VERSIONS[-1]
167-
if not install_deprecated_extras and session.python not in (min_py, max_py):
167+
if not install_extras and session.python not in (min_py, max_py):
168168
# only run double tests on first and last supported versions
169169
session.skip(
170170
f"Extended tests only run on boundary Python versions ({min_py}, {max_py}) to reduce CI load."
171171
)
172172

173-
constraints_path = str(
173+
core_constraints = (
174174
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
175175
)
176-
extras_str = "testing"
177-
if install_deprecated_extras:
178-
# rsa and oauth2client were both archived and support dropped,
179-
# but we still test old code paths
176+
extras_constraints = (
177+
CURRENT_DIRECTORY / "testing" / f"constraints-extras-{session.python}.txt"
178+
)
179+
180+
install_args = ["-e"]
181+
if install_extras:
180182
session.install("oauth2client")
181-
extras_str += ",rsa"
182-
session.install("-e", f".[{extras_str}]", "-c", constraints_path)
183+
install_args.append(".[testing,enterprise_cert,rsa]")
184+
else:
185+
install_args.append(".[testing]")
186+
187+
if core_constraints.exists():
188+
install_args.extend(["-c", str(core_constraints)])
189+
if install_extras and extras_constraints.exists():
190+
install_args.extend(["-c", str(extras_constraints)])
191+
192+
session.install(*install_args)
183193
session.run(
184194
"pytest",
185195
f"--junitxml=unit_{session.python}_sponge_log.xml",

packages/google-auth/setup.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@
4343
"packaging >= 20.0",
4444
]
4545

46-
rsa_extra_require = [
47-
"rsa>=3.1.4,<5; python_version < '3.11'",
48-
"rsa>=4.0,<5; python_version >= '3.11'",
49-
]
46+
rsa_extra_require = ["rsa>=4.0.0,<5"]
5047

5148
grpc_extra_require = [
5249
"grpcio >= 1.59.0, < 2.0.0; python_version < '3.14'",
@@ -55,18 +52,23 @@
5552

5653
# Unit test requirements.
5754
testing_extra_require = [
55+
# gRPC extra
5856
*grpc_extra_require,
57+
# PyJWT extra
58+
*pyjwt_extra_require,
59+
# Reauth extra
60+
*reauth_extra_require,
61+
# urllib3 extra
62+
*urllib3_extra_require,
63+
# aiohttp extra
64+
*aiohttp_extra_require,
65+
# Test runners & mocks
5966
"flask",
6067
"freezegun",
61-
*pyjwt_extra_require,
6268
"pytest",
6369
"pytest-cov",
6470
"pytest-localserver",
65-
*reauth_extra_require,
6671
"responses",
67-
*urllib3_extra_require,
68-
# Async Dependencies
69-
*aiohttp_extra_require,
7072
"aioresponses",
7173
"pytest-asyncio",
7274
]
Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
# This constraints file is used to check that lower bounds
2-
# are correct in setup.py
3-
# List *all* library dependencies and extras in this file.
4-
# Pin the version to the lower bound.
5-
#
6-
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
7-
# Then this file should have foo==1.14.0
1+
# Lower-bound constraints for Python 3.10 core dependencies.
2+
# Used during CI unit tests to verify minimum supported core package versions.
83
pyasn1-modules==0.2.1
9-
setuptools==40.3.0
104
cryptography==38.0.3
11-
aiohttp==3.8.0
12-
requests==2.30.0
13-
pyjwt==2.0
14-
grpcio==1.59.0
15-
urllib3==1.26.15
16-
packaging==20.0
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
urllib3>2.0.0
1+
# Lower-bound constraints for Python 3.11 core dependencies.
2+
pyasn1-modules==0.2.1
3+
cryptography==38.0.3
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
urllib3>2.0.0
1+
# Lower-bound constraints for Python 3.12 core dependencies.
2+
pyasn1-modules==0.2.1
3+
cryptography==38.0.3
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Lower-bound constraints for Python 3.13 core dependencies.
2+
pyasn1-modules==0.2.1
3+
cryptography==38.0.3
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Lower-bound constraints for Python 3.14 core dependencies.
2-
# Used during CI unit tests to verify minimum supported package versions.
32
pyasn1-modules==0.2.1
43
cryptography==41.0.5
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Lower-bound constraints for Python 3.10 optional extras & test dependencies.
2+
aiohttp==3.8.0
3+
requests==2.30.0
4+
pyjwt==2.0
5+
grpcio==1.59.0
6+
urllib3==1.26.15
7+
packaging==20.0
8+
pyu2f==0.1.5
9+
rsa==4.0.0
10+
oauth2client==4.1.3
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Lower-bound constraints for Python 3.14 optional extras & test dependencies.
2+
aiohttp==3.9.0
3+
requests==2.30.0
4+
pyjwt==2.0
5+
grpcio==1.75.1
6+
urllib3==2.0.0
7+
packaging==20.0
8+
pyu2f==0.1.5
9+
rsa==4.0.0
10+
oauth2client==4.1.3

0 commit comments

Comments
 (0)