Repository: googleapis/python-spanner-django

Issue:
tox.ini/linter: bring back flake8 and isort
Previously I had flake8 and isort as per https://github.com/orijtech/spanner-orm/commit/5fdd85b94af3c6ccd749da53579709516facd549#diff-0449f4417d83d66e98c6af36788de8a9 but I removed it as the nits were too distracting
and prevented making progress on the groundwork. Now that we've got a base it is time to bring them back and also fix the flake8 and isort nits.

/cc @timgraham 


Discussion:

Resolving patch:
diff --git a/spanner/dbapi/__init__.py b/spanner/dbapi/__init__.py
--- a/spanner/dbapi/__init__.py
+++ b/spanner/dbapi/__init__.py
@@ -15,14 +15,19 @@
 from google.cloud import spanner_v1 as spanner
 
 from .connection import Connection
-
 # These need to be included in the top-level package for PEP-0249 DB API v2.
-from .exceptions import (  # noqa
-    Error, IntegrityError, OperationalError, ProgrammingError, Warning, InterfaceError,
-    DatabaseError, DataError, InternalError, NotSupportedError
+from .exceptions import (
+    DatabaseError, DataError, Error, IntegrityError, InterfaceError,
+    InternalError, NotSupportedError, OperationalError, ProgrammingError,
+    Warning,
+)
+from .parse_utils import (
+    extract_connection_params, parse_spanner_url, validate_instance_config,
+)
+from .types import (
+    BINARY, DATETIME, NUMBER, ROWID, STRING, Date, DateFromTicks, Time,
+    TimeFromTicks, Timestamp, TimestampFromTicks,
 )
-
-from .parse_utils import parse_spanner_url, validate_instance_config
 from .version import USER_AGENT
 
 # Globals that MUST be defined ###
@@ -110,3 +115,13 @@ def connect(spanner_url, credentials_uri=None):
         _ = lro
 
     return Connection(db)
+
+
+__all__ = [
+    'DatabaseError', 'DataError', 'Error', 'IntegrityError', 'InterfaceError',
+    'InternalError', 'NotSupportedError', 'OperationalError', 'ProgrammingError',
+    'Warning', 'USER_AGENT', 'apilevel', 'connect', 'paramstyle', 'threadsafety',
+    'extract_connection_params', 'parse_spanner_url',
+    'Date', 'DateFromTicks', 'Time', 'TimeFromTicks', 'Timestamp', 'TimestampFromTicks',
+    'BINARY', 'STRING', 'NUMBER', 'DATETIME', 'ROWID',
+]


Test patch:
diff --git a/tests/spanner/dbapi/test_parse_utils.py b/tests/spanner/dbapi/test_parse_utils.py
--- a/tests/spanner/dbapi/test_parse_utils.py
+++ b/tests/spanner/dbapi/test_parse_utils.py
@@ -24,7 +24,7 @@ def test_no_args(self):
             url = None
             got = parse_spanner_url(url)
             self.assertEqual(got, None)
-        self.assertEqual(*exc.exception.args, 'expecting a non-blank spanner_url')
+        self.assertEqual(exc.exception.args, ('expecting a non-blank spanner_url',))
 
     def test_no_host(self):
         # No host present in the URL.
@@ -32,7 +32,7 @@ def test_no_host(self):
             url = '://spanner.googleapis.com/projects/test-project-012345/instances/test-instance/databases/dev-db'
             got = parse_spanner_url(url)
             self.assertEqual(got, None)
-        self.assertEqual(*exc.exception.args, 'expecting cloudspanner as the scheme')
+        self.assertEqual(exc.exception.args, ('expecting cloudspanner as the scheme',))
 
     def test_invalid_scheme(self):
         # Doesn't contain "cloudspanner" as the scheme.
@@ -40,7 +40,7 @@ def test_invalid_scheme(self):
             url = 'foo://spanner.googleapis.com/projects/test-project-012345/instances/test-instance/databases/dev-db'
             got = parse_spanner_url(url)
             self.assertEqual(got, None)
-        self.assertEqual(*exc.exception.args, 'invalid scheme foo, expected cloudspanner')
+        self.assertEqual(exc.exception.args, ('invalid scheme foo, expected cloudspanner',))
 
     def test_with_host(self):
         url = (