Skip to content

Commit

Permalink
fix: enforce constraints during unit tests (#760)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tseaver committed May 25, 2021
1 parent a923442 commit 1a6496a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
19 changes: 14 additions & 5 deletions noxfile.py
Expand Up @@ -12,10 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import shutil
import os
import pathlib
import shutil

import nox

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

TEST_DEPENDENCIES = [
"flask",
"freezegun",
Expand Down Expand Up @@ -84,15 +88,20 @@ def blacken(session):

@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
def unit(session):
session.install(*TEST_DEPENDENCIES)
session.install(*(ASYNC_DEPENDENCIES))
session.install(".")
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
add_constraints = ["-c", constraints_path]
session.install(*(TEST_DEPENDENCIES + add_constraints))
session.install(*(ASYNC_DEPENDENCIES + add_constraints))
session.install(".", *add_constraints)
session.run(
"pytest",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=google.auth",
"--cov=google.oauth2",
"--cov=tests",
"--cov-report=term-missing",
"tests",
"tests_async",
)
Expand Down Expand Up @@ -123,7 +132,7 @@ def cover(session):
"--cov=google.oauth2",
"--cov=tests",
"--cov=tests_async",
"--cov-report=",
"--cov-report=term-missing",
"tests",
"tests_async",
)
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -33,8 +33,7 @@
extras = {
"aiohttp": [
"aiohttp >= 3.6.2, < 4.0.0dev; python_version>='3.6'",
"requests >= 2.18.0, < 3.0.0dev",
"urllib3 >= 1.0.0, <2.0.0dev",
"requests >= 2.20.0, < 3.0.0dev",
],
"pyopenssl": "pyopenssl>=20.0.0",
"reauth": "pyu2f>=0.1.5",
Expand Down
4 changes: 1 addition & 3 deletions testing/constraints-3.6.txt
Expand Up @@ -9,8 +9,6 @@ cachetools==2.0.0
pyasn1-modules==0.2.1
setuptools==40.3.0
six==1.9.0
rsa==4.6
rsa==3.1.4
aiohttp==3.6.2
requests==2.18.0
urllib3==1.0.0
requests==2.20.0

0 comments on commit 1a6496a

Please sign in to comment.