| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -134,8 +134,7 @@ Contributing | |||
| 134 | 134 | ||
| 135 | 135 | Contributions to this library are always welcome and highly encouraged. | |
| 136 | 136 | ||
| 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. | ||
| 139 | 138 | ||
| 140 | 139 | Please note that this project is released with a Contributor Code of Conduct. | |
| 141 | 140 | By participating in this project you agree to abide by its terms. See the `Code | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | 29 | class IfNull(Func): | |
| 30 | 30 | """Represent SQL `IFNULL` function.""" | |
| 31 | + | ||
| 31 | 32 | function = "IFNULL" | |
| 32 | 33 | arity = 2 | |
| 33 | 34 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | class DatabaseIntrospection(BaseDatabaseIntrospection): | |
| 17 | 17 | """A Spanner-specific version of Django introspection utilities.""" | |
| 18 | + | ||
| 18 | 19 | data_types_reverse = { | |
| 19 | 20 | TypeCode.BOOL: "BooleanField", | |
| 20 | 21 | TypeCode.BYTES: "BinaryField", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | class DatabaseOperations(BaseDatabaseOperations): | |
| 27 | 27 | """A Spanner-specific version of Django database operations.""" | |
| 28 | + | ||
| 28 | 29 | cast_data_types = {"CharField": "STRING", "TextField": "STRING"} | |
| 29 | 30 | cast_char_field_without_max_length = "STRING" | |
| 30 | 31 | compiler_module = "django_spanner.compiler" | |
@@ -108,7 +109,9 @@ def bulk_insert_sql(self, fields, placeholder_rows): | |||
| 108 | 109 | values_sql = ", ".join("(%s)" % sql for sql in placeholder_rows_sql) | |
| 109 | 110 | return "VALUES " + values_sql | |
| 110 | 111 | ||
| 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 | + ): | ||
| 112 | 115 | """ | |
| 113 | 116 | Override the base class method. Returns a list of SQL statements | |
| 114 | 117 | required to remove all data from the given database tables (without | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): | |||
| 13 | 13 | The database abstraction layer that turns things like “create a model” or | |
| 14 | 14 | “delete a field” into SQL. | |
| 15 | 15 | """ | |
| 16 | + | ||
| 16 | 17 | sql_create_table = ( | |
| 17 | 18 | "CREATE TABLE %(table)s (%(definition)s) PRIMARY KEY(%(primary_key)s)" | |
| 18 | 19 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,9 +100,6 @@ | |||
| 100 | 100 | # directories to ignore when looking for source files. | |
| 101 | 101 | exclude_patterns = [ | |
| 102 | 102 | "_build", | |
| 103 | - "samples/AUTHORING_GUIDE.md", | ||
| 104 | - "samples/CONTRIBUTING.md", | ||
| 105 | - "samples/snippets/README.rst", | ||
| 106 | 103 | ] | |
| 107 | 104 | ||
| 108 | 105 | # The reST default role (used for this markup: `text`) to use for all | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,13 +17,18 @@ | |||
| 17 | 17 | BLACK_VERSION = "black==19.10b0" | |
| 18 | 18 | BLACK_PATHS = [ | |
| 19 | 19 | "docs", | |
| 20 | + "django_spanner", | ||
| 20 | 21 | "tests", | |
| 21 | 22 | "noxfile.py", | |
| 22 | 23 | "setup.py", | |
| 23 | 24 | ] | |
| 24 | 25 | ||
| 26 | + DEFAULT_PYTHON_VERSION = "3.8" | ||
| 27 | + SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] | ||
| 28 | + UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8"] | ||
| 25 | 29 | ||
| 26 | - @nox.session(python="3.8") | ||
| 30 | + | ||
| 31 | + @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| 27 | 32 | def lint(session): | |
| 28 | 33 | """Run linters. | |
| 29 | 34 | ||
@@ -35,7 +40,7 @@ def lint(session): | |||
| 35 | 40 | session.run("flake8", "django_spanner", "tests") | |
| 36 | 41 | ||
| 37 | 42 | ||
| 38 | - @nox.session(python="3.8") | ||
| 43 | + @nox.session(python="3.6") | ||
| 39 | 44 | def blacken(session): | |
| 40 | 45 | """Run black. | |
| 41 | 46 | ||
@@ -49,7 +54,7 @@ def blacken(session): | |||
| 49 | 54 | session.run("black", *BLACK_PATHS) | |
| 50 | 55 | ||
| 51 | 56 | ||
| 52 | - @nox.session(python="3.8") | ||
| 57 | + @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| 53 | 58 | def lint_setup_py(session): | |
| 54 | 59 | """Verify that setup.py is valid (including RST check).""" | |
| 55 | 60 | session.install("docutils", "pygments") | |
@@ -70,23 +75,22 @@ def default(session): | |||
| 70 | 75 | "py.test", | |
| 71 | 76 | "--quiet", | |
| 72 | 77 | "--cov=django_spanner", | |
| 73 | - "--cov=google.cloud", | ||
| 74 | 78 | "--cov=tests.unit", | |
| 75 | 79 | "--cov-append", | |
| 76 | 80 | "--cov-config=.coveragerc", | |
| 77 | 81 | "--cov-report=", | |
| 78 | - "--cov-fail-under=60", | ||
| 82 | + "--cov-fail-under=20", | ||
| 79 | 83 | os.path.join("tests", "unit"), | |
| 80 | 84 | *session.posargs | |
| 81 | 85 | ) | |
| 82 | 86 | ||
| 83 | 87 | ||
| 84 | - @nox.session(python="3.8") | ||
| 88 | + @nox.session(python=DEFAULT_PYTHON_VERSION) | ||
| 85 | 89 | def docs(session): | |
| 86 | 90 | """Build the docs for this library.""" | |
| 87 | 91 | ||
| 88 | - session.install("-e", ".") | ||
| 89 | - session.install("sphinx<3.0.0", "alabaster", "recommonmark") | ||
| 92 | + session.install("-e", ".[tracing]") | ||
| 93 | + session.install("sphinx", "alabaster", "recommonmark") | ||
| 90 | 94 | ||
| 91 | 95 | shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) | |
| 92 | 96 | session.run( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments