8000 fix: lint_setup_py was failing in Kokoro is now fixed (#607) · googleapis/python-spanner-django@d125148 · GitHub
[go: up one dir, main page]

Skip to content

Commit d125148

Browse files
authored
fix: lint_setup_py was failing in Kokoro is now fixed (#607)
1 parent c996400 commit d125148

File tree

8 files changed

+20
-77
lines changed

8 files changed

+20
-77
lines changed

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ Contributing
134134

135135
Contributions to this library are always welcome and highly encouraged.
136136

137-
See `CONTRIBUTING <CONTRIBUTING.md>`_ for more information on how to get
138-
started.
137+
See [CONTRIBUTING][contributing] for more information on how to get started.
139138

140139
Please note that this project is released with a Contributor Code of Conduct.
141140
By participating in this project you agree to abide by its terms. See the `Code

code-of-conduct.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

django_spanner/functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
class IfNull(Func):
3030
"""Represent SQL `IFNULL` function."""
31+
3132
function = "IFNULL"
3233
arity = 2
3334

django_spanner/introspection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
class DatabaseIntrospection(BaseDatabaseIntrospection):
1717
"""A Spanner-specific version of Django introspection utilities."""
18+
1819
data_types_reverse = {
1920
TypeCode.BOOL: "BooleanField",
2021
TypeCode.BYTES: "BinaryField",

django_spanner/operations.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
class DatabaseOperations(BaseDatabaseOperations):
2727
"""A Spanner-specific version of Django database operations."""
28+
2829
cast_data_types = {"CharField": "STRING", "TextField": "STRING"}
2930
cast_char_field_without_max_length = "STRING"
3031
compiler_module = "django_spanner.compiler"
@@ -108,7 +109,9 @@ def bulk_insert_sql(self, fields, placeholder_rows):
108109
values_sql = ", ".join("(%s)" % sql for sql in placeholder_rows_sql)
109110
return "VALUES " + values_sql
110111

111-
def sql_flush(self, style, tables, reset_sequences=False, allow_cascade=False):
112+
def sql_flush(
113+
self, style, tables, reset_sequences=False, allow_cascade=False
114+
):
112115
"""
113116
Override the base class method. Returns a list of SQL statements
114117
required to remove all data from the given database tables (without

django_spanner/schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
1313
The database abstraction layer that turns things like “create a model” or
1414
“delete a field” into SQL.
1515
"""
16+
1617
sql_create_table = (
1718
"CREATE TABLE %(table)s (%(definition)s) PRIMARY KEY(%(primary_key)s)"
1819
)

docs/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@
100100
# directories to ignore when looking for source files.
101101
exclude_patterns = [
102102
"_build",
103-
"samples/AUTHORING_GUIDE.md",
104-
"samples/CONTRIBUTING.md",
105-
"samples/snippets/README.rst",
106103
]
107104

108105
# The reST default role (used for this markup: `text`) to use for all

noxfile.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717
BLACK_VERSION = "black==19.10b0"
1818
BLACK_PATHS = [
1919
"docs",
20+
"django_spanner",
2021
"tests",
2122
"noxfile.py",
2223
"setup.py",
2324
]
2425

26+
DEFAULT_PYTHON_VERSION = "3.8"
27+
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
28+
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8"]
2529

26-
@nox.session(python="3.8")
30+
31+
@nox.session(python=DEFAULT_PYTHON_VERSION)
2732
def lint(session):
2833
"""Run linters.
2934
@@ -35,7 +40,7 @@ def lint(session):
3540
session.run("flake8", "django_spanner", "tests")
3641

3742

38-
@nox.session(python="3.8")
43+
@nox.session(python="3.6")
3944
def blacken(session):
4045
"""Run black.
4146
@@ -49,7 +54,7 @@ def blacken(session):
4954
session.run("black", *BLACK_PATHS)
5055

5156

52-
@nox.session(python="3.8")
57+
@nox.session(python=DEFAULT_PYTHON_VERSION)
5358
def lint_setup_py(session):
5459
"""Verify that setup.py is valid (including RST check)."""
5560
session.install("docutils", "pygments")
@@ -70,23 +75,22 @@ def default(session):
7075
"py.test",
7176
"--quiet",
7277
"--cov=django_spanner",
73-
"--cov=google.cloud",
7478
"--cov=tests.unit",
7579
"--cov-append",
7680
"--cov-config=.coveragerc",
7781
"--cov-report=",
78-
"--cov-fail-under=60",
82+
"--cov-fail-under=20",
7983
os.path.join("tests", "unit"),
8084
*session.posargs
8185
)
8286

8387

84-
@nox.session(python="3.8")
88+
@nox.session(python=DEFAULT_PYTHON_VERSION)
8589
def docs(session):
8690
"""Build the docs for this library."""
8791

88-
session.install("-e", ".")
89-
session.install("sphinx<3.0.0", "alabaster", "recommonmark")
92+
session.install("-e", ".[tracing]")
93+
session.install("sphinx", "alabaster", "recommonmark")
9094

9195
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
9296
session.run(

0 commit comments

Comments
 (0)
0