Skip to content

Commit

Permalink
fix: add classifer for Python 3.8 (#63)
Browse files Browse the repository at this point in the history
* fix: add classifer for Python 3.8

* fix: update black version
  • Loading branch information
crwilcox authored Feb 14, 2020
1 parent 23df542 commit 1b9b6bc
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
12 changes: 6 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import nox


BLACK_VERSION = "black==19.3b0"
BLACK_VERSION = "black==19.10b0"
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

if os.path.exists("samples"):
BLACK_PATHS.append("samples")


@nox.session(python="3.7")
@nox.session(python="3.8")
def lint(session):
"""Run linters.
Expand All @@ -56,7 +56,7 @@ def blacken(session):
session.run("black", *BLACK_PATHS)


@nox.session(python="3.7")
@nox.session(python="3.8")
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""
session.install("docutils", "pygments")
Expand Down Expand Up @@ -89,7 +89,7 @@ def unit(session):
default(session)


@nox.session(python=["2.7", "3.7"])
@nox.session(python=["2.7", "3.8"])
def system(session):
"""Run the system test suite."""
system_test_path = os.path.join("tests", "system.py")
Expand Down Expand Up @@ -124,7 +124,7 @@ def system(session):
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)


@nox.session(python="3.7")
@nox.session(python="3.8")
def cover(session):
"""Run the final coverage report.
Expand All @@ -137,7 +137,7 @@ def cover(session):
session.run("coverage", "erase")


@nox.session(python="3.7")
@nox.session(python="3.8")
def docs(session):
"""Build the docs for this library."""

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Operating System :: OS Independent",
"Topic :: Internet",
],
Expand Down
4 changes: 2 additions & 2 deletions tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ class TestAnonymousClient(unittest.TestCase):
def test_access_to_public_bucket(self):
anonymous = storage.Client.create_anonymous_client()
bucket = anonymous.bucket(self.PUBLIC_BUCKET)
blob, = retry_429_503(bucket.list_blobs)(max_results=1)
(blob,) = retry_429_503(bucket.list_blobs)(max_results=1)
with tempfile.TemporaryFile() as stream:
retry_429_503(blob.download_to_file)(stream)

Expand Down Expand Up @@ -1582,7 +1582,7 @@ def test_blob_w_explicit_kms_key_name(self):
# We don't know the current version of the key.
self.assertTrue(blob.kms_key_name.startswith(kms_key_name))

listed, = list(self.bucket.list_blobs())
(listed,) = list(self.bucket.list_blobs())
self.assertTrue(listed.kms_key_name.startswith(kms_key_name))

def test_bucket_w_default_kms_key_name(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -2451,7 +2451,7 @@ def test_rewrite_w_generations(self):
self.assertEqual(rewritten, 33)
self.assertEqual(size, 42)

kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(
kw["path"],
Expand Down
32 changes: 16 additions & 16 deletions tests/unit/test_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def test_get_blob_miss(self):
bucket = self._make_one(name=NAME)
result = bucket.get_blob(NONESUCH, client=client, timeout=42)
self.assertIsNone(result)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, NONESUCH))
self.assertEqual(kw["timeout"], 42)
Expand All @@ -663,7 +663,7 @@ def test_get_blob_hit_w_user_project(self):
blob = bucket.get_blob(BLOB_NAME, client=client)
self.assertIs(blob.bucket, bucket)
self.assertEqual(blob.name, BLOB_NAME)
kw, = connection._requested
(kw,) = connection._requested
expected_qp = {"userProject": USER_PROJECT, "projection": "noAcl"}
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
Expand All @@ -681,7 +681,7 @@ def test_get_blob_hit_w_generation(self):
self.assertIs(blob.bucket, bucket)
self.assertEqual(blob.name, BLOB_NAME)
self.assertEqual(blob.generation, GENERATION)
kw, = connection._requested
(kw,) = connection._requested
expected_qp = {"generation": GENERATION, "projection": "noAcl"}
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
Expand All @@ -704,7 +704,7 @@ def test_get_blob_hit_with_kwargs(self):
)
self.assertIs(blob.bucket, bucket)
self.assertEqual(blob.name, BLOB_NAME)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
self.assertEqual(kw["headers"], _get_encryption_headers(KEY))
Expand All @@ -720,7 +720,7 @@ def test_list_blobs_defaults(self):
iterator = bucket.list_blobs()
blobs = list(iterator)
self.assertEqual(blobs, [])
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o" % NAME)
self.assertEqual(kw["query_params"], {"projection": "noAcl"})
Expand Down Expand Up @@ -762,7 +762,7 @@ def test_list_blobs_w_all_arguments_and_user_project(self):
)
blobs = list(iterator)
self.assertEqual(blobs, [])
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o" % NAME)
self.assertEqual(kw["query_params"], EXPECTED)
Expand Down Expand Up @@ -935,7 +935,7 @@ def test_delete_blob_miss(self):
client = _Client(connection)
bucket = self._make_one(client=client, name=NAME)
self.assertRaises(NotFound, bucket.delete_blob, NONESUCH)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "DELETE")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, NONESUCH))
self.assertEqual(kw["query_params"], {})
Expand All @@ -950,7 +950,7 @@ def test_delete_blob_hit_with_user_project(self):
bucket = self._make_one(client=client, name=NAME, user_project=USER_PROJECT)
result = bucket.delete_blob(BLOB_NAME, timeout=42)
self.assertIsNone(result)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "DELETE")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
self.assertEqual(kw["query_params"], {"userProject": USER_PROJECT})
Expand All @@ -965,7 +965,7 @@ def test_delete_blob_hit_with_generation(self):
bucket = self._make_one(client=client, name=NAME)
result = bucket.delete_blob(BLOB_NAME, generation=GENERATION)
self.assertIsNone(result)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "DELETE")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
self.assertEqual(kw["query_params"], {"generation": GENERATION})
Expand Down Expand Up @@ -1056,7 +1056,7 @@ def test_copy_blobs_wo_name(self):
self.assertIs(new_blob.bucket, dest)
self.assertEqual(new_blob.name, BLOB_NAME)

kw, = connection._requested
(kw,) = connection._requested
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
SOURCE, BLOB_NAME, DEST, BLOB_NAME
)
Expand All @@ -1082,7 +1082,7 @@ def test_copy_blobs_source_generation(self):
self.assertIs(new_blob.bucket, dest)
self.assertEqual(new_blob.name, BLOB_NAME)

kw, = connection._requested
(kw,) = connection._requested
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
SOURCE, BLOB_NAME, DEST, BLOB_NAME
)
Expand Down Expand Up @@ -1149,7 +1149,7 @@ def test_copy_blobs_w_name_and_user_project(self):
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
SOURCE, BLOB_NAME, DEST, NEW_NAME
)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], COPY_PATH)
self.assertEqual(kw["query_params"], {"userProject": USER_PROJECT})
Expand All @@ -1175,7 +1175,7 @@ def test_rename_blob(self):
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
BUCKET_NAME, BLOB_NAME, BUCKET_NAME, NEW_BLOB_NAME
)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], COPY_PATH)
self.assertEqual(kw["query_params"], {})
Expand All @@ -1200,7 +1200,7 @@ def test_rename_blob_to_itself(self):
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
BUCKET_NAME, BLOB_NAME, BUCKET_NAME, BLOB_NAME
)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], COPY_PATH)
self.assertEqual(kw["query_params"], {})
Expand Down Expand Up @@ -2676,7 +2676,7 @@ def test_lock_retention_policy_ok(self):

bucket.lock_retention_policy(timeout=42)

kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], "/b/{}/lockRetentionPolicy".format(name))
self.assertEqual(kw["query_params"], {"ifMetagenerationMatch": 1234})
Expand Down Expand Up @@ -2707,7 +2707,7 @@ def test_lock_retention_policy_w_user_project(self):

bucket.lock_retention_policy()

kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], "/b/{}/lockRetentionPolicy".format(name))
self.assertEqual(
Expand Down

0 comments on commit 1b9b6bc

Please sign in to comment.