Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): require six>=1.4.0 #194

Merged
merged 12 commits into from
Jun 18, 2021
21 changes: 18 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@

from __future__ import absolute_import
import os
import pathlib
import shutil

import nox

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

SYSTEM_TEST_ENV_VARS = ("GOOGLE_APPLICATION_CREDENTIALS",)
BLACK_VERSION = "black==20.8b1"
GOOGLE_AUTH = "google-auth >= 1.22.0, < 2.0dev"
Expand All @@ -32,9 +35,13 @@
def unit(session):
"""Run the unit test suite."""

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

# Install all test dependencies, then install this package in-place.
session.install("mock", "pytest", "pytest-cov", "pytest-asyncio<=0.14.0", GOOGLE_AUTH)
session.install("-e", ".[requests,aiohttp]")
session.install("-e", ".[requests,aiohttp]", "-c", constraints_path)

# Run py.test against the unit tests.
# NOTE: We don't require 100% line coverage for unit test runs since
Expand All @@ -60,9 +67,13 @@ def unit(session):
def unit_2(session):
"""Run the unit test suite."""

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

# Install all test dependencies, then install this package in-place.
session.install("mock", "pytest", "pytest-cov")
session.install("-e", ".[requests]")
session.install("-e", ".[requests]", "-c", constraints_path)

# Run py.test against the unit tests.
# NOTE: We don't require 100% line coverage for unit test runs since
Expand Down Expand Up @@ -210,6 +221,10 @@ def blacken(session):
def system(session):
"""Run the system test suite."""

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

# Environment check: environment variables are set.
missing = []
for env_var in SYSTEM_TEST_ENV_VARS:
Expand All @@ -225,7 +240,7 @@ def system(session):
# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install("mock", "pytest", GOOGLE_AUTH, "google-cloud-testutils")
session.install("-e", ".[requests,aiohttp]")
session.install("-e", ".[requests,aiohttp]", "-c", constraints_path)

# Run py.test against the async system tests.
if session.python.startswith("3"):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


REQUIREMENTS = [
'six',
'six>=1.4.0',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From experimentation this was the lowest version that resulted in passing unit tests.

1.3.0 results in the following error:

_________________________________________ ERROR collecting tests_async/unit/requests/test_upload.py __________________________________________
Traceback (most recent call last):
  File "/usr/local/google/home/busunkim/github/google-resumable-media-python/tests_async/unit/requests/test_upload.py", line 23, in <module>
    import google._async_resumable_media.requests.upload as upload_mod
  File "/usr/local/google/home/busunkim/github/google-resumable-media-python/google/_async_resumable_media/requests/__init__.py", line 661, in <module>
    from google._async_resumable_media.requests.download import ChunkedDownload
  File "/usr/local/google/home/busunkim/github/google-resumable-media-python/google/_async_resumable_media/requests/download.py", line 21, in <module>
    from google._async_resumable_media.requests import _request_helpers
  File "/usr/local/google/home/busunkim/github/google-resumable-media-python/google/_async_resumable_media/requests/_request_helpers.py", line 26, in <module>
    import google.auth.transport._aiohttp_requests as aiohttp_requests
  File "/usr/local/google/home/busunkim/github/google-resumable-media-python/.nox/unit-3-6/lib/python3.6/site-packages/google/auth/__init__.py", line 19, in <module>
    from google.auth._default import default, load_credentials_from_file
  File "/usr/local/google/home/busunkim/github/google-resumable-media-python/.nox/unit-3-6/lib/python3.6/site-packages/google/auth/_default.py", line 30, in <module>
    import google.auth.transport._http_client
  File "/usr/local/google/home/busunkim/github/google-resumable-media-python/.nox/unit-3-6/lib/python3.6/site-packages/google/auth/transport/__init__.py", line 41, in <module>
    @six.add_metaclass(abc.ABCMeta)
AttributeError: module 'six' has no attribute 'add_metaclass'

add_metaclass was added in 1.4.0 https://github.com/benjaminp/six/blob/42636b15dd1a5b85de56eac98e47954d4c776576/CHANGES#L248-L249

'google-crc32c >= 1.0, < 2.0dev; python_version>="3.5"',
'crcmod >= 1.7; python_version=="2.7"',

Expand Down
Empty file added testing/constraints-2.7.txt
Empty file.
Empty file added testing/constraints-3.10.txt
Empty file.
Empty file added testing/constraints-3.11.txt
Empty file.
12 changes: 12 additions & 0 deletions testing/constraints-3.6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List *all* library dependencies and extras in this file.
# Pin the version to the lower bound.
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
six==1.4.0
crcmod==1.7
google-crc32c==1.0
aiohttp==3.6.2
requests==2.18.0
Empty file added testing/constraints-3.7.txt
Empty file.
Empty file added testing/constraints-3.8.txt
Empty file.
Empty file added testing/constraints-3.9.txt
Empty file.