This repository was archived by the owner on Mar 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathnoxfile.py
More file actions
105 lines (74 loc) · 2.14 KB
/
noxfile.py
File metadata and controls
105 lines (74 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright 2024 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from os import listdir
from os.path import isfile, join
import nox
@nox.session()
def hello_world(session):
_sample(session)
@nox.session()
def auto_generated_primary_key(session):
_sample(session)
@nox.session()
def bit_reversed_sequence(session):
_sample(session)
@nox.session()
def date_and_timestamp(session):
_sample(session)
@nox.session()
def default_column_value(session):
_sample(session)
@nox.session()
def generated_column(session):
_sample(session)
@nox.session()
def insert_data(session):
_sample(session)
@nox.session()
def interleaved_table(session):
_sample(session)
@nox.session()
def transaction(session):
_sample(session)
@nox.session()
def isolation_level(session):
_sample(session)
@nox.session()
def stale_read(session):
_sample(session)
@nox.session()
def read_only_transaction(session):
_sample(session)
@nox.session()
def database_role(session):
_sample(session)
@nox.session()
def _all_samples(session):
_sample(session)
def _sample(session):
session.install("testcontainers")
session.install("sqlalchemy")
session.install("setuptools")
session.install(
"git+https://github.com/googleapis/python-spanner.git#egg=google-cloud-spanner"
)
session.install("../.")
if session.name == "_all_samples":
files = [
f for f in listdir(".") if isfile(join(".", f)) and f.endswith("_sample.py")
]
for file in files:
session.run("python", file)
else:
session.run("python", session.name + "_sample.py")