Skip to content

Commit d7fef3f

Browse files
committed
ci(google-auth): separate core vs extras lower-bound constraints
1 parent b2ec761 commit d7fef3f

7 files changed

Lines changed: 59 additions & 17 deletions

File tree

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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,23 @@
5656

5757
# Unit test requirements.
5858
testing_extra_require = [
59+
# gRPC extra
5960
*grpc_extra_require,
61+
# PyJWT extra
62+
*pyjwt_extra_require,
63+
# Reauth extra
64+
*reauth_extra_require,
65+
# urllib3 extra
66+
*urllib3_extra_require,
67+
# aiohttp extra
68+
*aiohttp_extra_require,
69+
# Test runners & mocks
6070
"flask",
6171
"freezegun",
62-
*pyjwt_extra_require,
6372
"pytest",
6473
"pytest-cov",
6574
"pytest-localserver",
66-
*reauth_extra_require,
6775
"responses",
68-
*urllib3_extra_require,
69-
# Async Dependencies
70-
*aiohttp_extra_require,
7176
"aioresponses",
7277
"pytest-asyncio",
7378
]
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: 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)