Skip to content

Commit

Permalink
fix: lint_setup_py was failing in Kokoro is now fixed (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
vi3k6i5 authored Apr 7, 2021
1 parent c996400 commit d125148
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 77 deletions.
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ Contributing

Contributions to this library are always welcome and highly encouraged.

See `CONTRIBUTING <CONTRIBUTING.md>`_ for more information on how to get
started.
See [CONTRIBUTING][contributing] for more information on how to get started.

Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms. See the `Code
Expand Down
63 changes: 0 additions & 63 deletions code-of-conduct.md

This file was deleted.

1 change: 1 addition & 0 deletions django_spanner/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

class IfNull(Func):
"""Represent SQL `IFNULL` function."""

function = "IFNULL"
arity = 2

Expand Down
1 change: 1 addition & 0 deletions django_spanner/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

class DatabaseIntrospection(BaseDatabaseIntrospection):
"""A Spanner-specific version of Django introspection utilities."""

data_types_reverse = {
TypeCode.BOOL: "BooleanField",
TypeCode.BYTES: "BinaryField",
Expand Down
5 changes: 4 additions & 1 deletion django_spanner/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

class DatabaseOperations(BaseDatabaseOperations):
"""A Spanner-specific version of Django database operations."""

cast_data_types = {"CharField": "STRING", "TextField": "STRING"}
cast_char_field_without_max_length = "STRING"
compiler_module = "django_spanner.compiler"
Expand Down Expand Up @@ -108,7 +109,9 @@ def bulk_insert_sql(self, fields, placeholder_rows):
values_sql = ", ".join("(%s)" % sql for sql in placeholder_rows_sql)
return "VALUES " + values_sql

def sql_flush(self, style, tables, reset_sequences=False, allow_cascade=False):
def sql_flush(
self, style, tables, reset_sequences=False, allow_cascade=False
):
"""
Override the base class method. Returns a list of SQL statements
required to remove all data from the given database tables (without
Expand Down
1 change: 1 addition & 0 deletions django_spanner/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
The database abstraction layer that turns things like “create a model” or
“delete a field” into SQL.
"""

sql_create_table = (
"CREATE TABLE %(table)s (%(definition)s) PRIMARY KEY(%(primary_key)s)"
)
Expand Down
3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@
# directories to ignore when looking for source files.
exclude_patterns = [
"_build",
"samples/AUTHORING_GUIDE.md",
"samples/CONTRIBUTING.md",
"samples/snippets/README.rst",
]

# The reST default role (used for this markup: `text`) to use for all
Expand Down
20 changes: 12 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@
BLACK_VERSION = "black==19.10b0"
BLACK_PATHS = [
"docs",
"django_spanner",
"tests",
"noxfile.py",
"setup.py",
]

DEFAULT_PYTHON_VERSION = "3.8"
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8"]

@nox.session(python="3.8")

@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session):
"""Run linters.
Expand All @@ -35,7 +40,7 @@ def lint(session):
session.run("flake8", "django_spanner", "tests")


@nox.session(python="3.8")
@nox.session(python="3.6")
def blacken(session):
"""Run black.
Expand All @@ -49,7 +54,7 @@ def blacken(session):
session.run("black", *BLACK_PATHS)


@nox.session(python="3.8")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""
session.install("docutils", "pygments")
Expand All @@ -70,23 +75,22 @@ def default(session):
"py.test",
"--quiet",
"--cov=django_spanner",
"--cov=google.cloud",
"--cov=tests.unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=60",
"--cov-fail-under=20",
os.path.join("tests", "unit"),
*session.posargs
)


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

session.install("-e", ".")
session.install("sphinx<3.0.0", "alabaster", "recommonmark")
session.install("-e", ".[tracing]")
session.install("sphinx", "alabaster", "recommonmark")

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

0 comments on commit d125148

Please sign in to comment.