Skip to content

Commit d70edbb

Browse files
authored
fix: enforce constraints during unit tests (#760)
Drop explicit pin / constraint on 'urllib3': specific 'requests' versions have very narrow pins, and ours is only likely to create conflicts. Bump the 'requests' lower bound to '2.20.0', the lowest version for which our tests pass once constraints are being checked. Closes #759
1 parent c1e0555 commit d70edbb

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

packages/google-auth/noxfile.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import shutil
1615
import os
16+
import pathlib
17+
import shutil
18+
1719
import nox
1820

21+
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
22+
1923
TEST_DEPENDENCIES = [
2024
"flask",
2125
"freezegun",
@@ -84,15 +88,20 @@ def blacken(session):
8488

8589
@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
8690
def unit(session):
87-
session.install(*TEST_DEPENDENCIES)
88-
session.install(*(ASYNC_DEPENDENCIES))
89-
session.install(".")
91+
constraints_path = str(
92+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
93+
)
94+
add_constraints = ["-c", constraints_path]
95+
session.install(*(TEST_DEPENDENCIES + add_constraints))
96+
session.install(*(ASYNC_DEPENDENCIES + add_constraints))
97+
session.install(".", *add_constraints)
9098
session.run(
9199
"pytest",
92100
f"--junitxml=unit_{session.python}_sponge_log.xml",
93101
"--cov=google.auth",
94102
"--cov=google.oauth2",
95103
"--cov=tests",
104+
"--cov-report=term-missing",
96105
"tests",
97106
"tests_async",
98107
)
@@ -123,7 +132,7 @@ def cover(session):
123132
"--cov=google.oauth2",
124133
"--cov=tests",
125134
"--cov=tests_async",
126-
"--cov-report=",
135+
"--cov-report=term-missing",
127136
"tests",
128137
"tests_async",
129138
)

packages/google-auth/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
extras = {
3434
"aiohttp": [
3535
"aiohttp >= 3.6.2, < 4.0.0dev; python_version>='3.6'",
36-
"requests >= 2.18.0, < 3.0.0dev",
37-
"urllib3 >= 1.0.0, <2.0.0dev",
36+
"requests >= 2.20.0, < 3.0.0dev",
3837
],
3938
"pyopenssl": "pyopenssl>=20.0.0",
4039
"reauth": "pyu2f>=0.1.5",

packages/google-auth/testing/constraints-3.6.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ cachetools==2.0.0
99
pyasn1-modules==0.2.1
1010
setuptools==40.3.0
1111
six==1.9.0
12-
rsa==4.6
1312
rsa==3.1.4
1413
aiohttp==3.6.2
15-
requests==2.18.0
16-
urllib3==1.0.0
14+
requests==2.20.0

0 commit comments

Comments
 (0)