Skip to content

Commit 607d886

Browse files
committed
Various release related minor updates
1 parent ac694bf commit 607d886

6 files changed

Lines changed: 16 additions & 13 deletions

File tree

apsw/shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,7 @@ def command_load(self, cmd):
22102210
except Exception:
22112211
if len(cmd) == 1:
22122212
if cmd[0] == "--list":
2213-
extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text())
2213+
extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text(encoding="utf8"))
22142214
for name, extra in sorted(extras.items()):
22152215
if extra["type"] == "extension" and apsw.sqlite_extra.has(name):
22162216
self.write_value(name, fmt = str)

apsw/sqlite_extra.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def path(name:str):
4646
_exts = ("", ".so", ".dll", ".exe", ".dylib")
4747

4848
def _get_entry(name: str):
49-
extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text())
49+
extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text(encoding="utf8"))
5050
if name not in extras:
5151
raise LookupError(f"{name=} is not a known extra")
5252
bin_dir = importlib.resources.files(apsw).joinpath("sqlite_extra_binaries")
@@ -83,7 +83,7 @@ def usage():
8383
usage()
8484

8585
case "--list":
86-
extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text())
86+
extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text(encoding="utf8"))
8787
for name in extras:
8888
try:
8989
extra, path = _get_entry(name)

apsw/tests/async_meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_meta(
3535
) -> Literal["sync" | "async" | "dual" | "value"]:
3636
assert kind in {"function", "attribute"}
3737

38-
data = json.loads(importlib.resources.files("apsw.tests").joinpath("async_meta.json").read_text())
38+
data = json.loads(importlib.resources.files("apsw.tests").joinpath("async_meta.json").read_text(encoding="utf8"))
3939

4040
assert klass in data, f"{klass} not found"
4141

apsw/tests/extratest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class Extra(unittest.TestCase):
2121
def setUp(self):
22-
self.extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text())
22+
self.extras = json.loads(importlib.resources.files(apsw).joinpath("sqlite_extra.json").read_text(encoding="utf8"))
2323
self.verbose: bool = self._outcome.result.showAll
2424

2525
def testLoadExtension(self):
@@ -32,7 +32,8 @@ def testLoadExtension(self):
3232
print(f" >> Extension {name}")
3333
fn_before = set(row[0] for row in db.execute("select name from pragma_function_list"))
3434
vfs_before = set(apsw.vfs_names())
35-
mod_before = set(row[0] for row in db.execute("SELECT name FROM pragma_module_list"))
35+
# some builds have sqlite_stmt builtin so we won't detect it
36+
mod_before = set(row[0] for row in db.execute("SELECT name FROM pragma_module_list WHERE name NOT IN ('sqlite_stmt')"))
3637
col_before = set(row[0] for row in db.execute("SELECT name FROM pragma_collation_list"))
3738
apsw.sqlite_extra.load(db, name)
3839
fn_after = set(db.execute("select name from pragma_function_list").get)

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,17 @@ class run_tests(Command):
157157
# and forces verbose to 0)
158158
user_options = [
159159
("show-tests", "v", "Show each test being run"),
160+
("fail-fast", "f", "Stop on first test failure"),
160161
("locals", None, "Show local variables in test failure"),
161162
]
162163

163164
# see if you can find boolean_options documented anywhere
164-
boolean_options = ["show-tests", "locals"]
165+
boolean_options = ["show-tests", "fail-fast", "locals"]
165166

166167
def initialize_options(self):
167168
self.show_tests = 0
168169
self.locals = False
170+
self.fail_fast = False
169171

170172
def finalize_options(self):
171173
pass
@@ -178,7 +180,7 @@ def run(self):
178180
suite = unittest.TestLoader().loadTestsFromModule(apsw.tests.__main__)
179181
# verbosity of zero doesn't print anything, one prints a dot
180182
# per test and two prints each test name
181-
result = unittest.TextTestRunner(verbosity=self.show_tests + 1, tb_locals=self.locals).run(suite)
183+
result = unittest.TextTestRunner(verbosity=self.show_tests + 1, failfast=self.fail_fast, tb_locals=self.locals).run(suite)
182184
if not result.wasSuccessful():
183185
sys.exit(1)
184186

tools/megatest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ def dotest(pyver, logdir, pybin, pylib, workdir, sqlitever, debug, config, gil):
6464
venv/bin/python3 {pyflags} setup.py fetch --version={sqlitever} --all
6565
venv/bin/python3 tools/vend.py compile -v
6666
venv/bin/python3 {pyflags} setup.py build_test_extension build_ext --inplace --force \
67-
{extdebug} {build_ext_flags} test -v --locals;"""
67+
{extdebug} {build_ext_flags} test -vf --locals"""
6868
+ (
6969
"""
7070
cp tools/setup-pypi.cfg setup.apsw ;
7171
venv/bin/python3 -m pip wheel -v . ;
7272
venv/bin/python3 -m pip install --no-index --force-reinstall --find-links=. apsw ;
73-
venv/bin/python3 -m apsw.tests --locals"""
73+
venv/bin/python3 -m apsw.tests -vf --locals"""
7474
if not debug
7575
else ""
7676
)
@@ -240,9 +240,9 @@ def cmp(a, b):
240240
"3.15.0a6",
241241
"3.14.3",
242242
"3.13.12",
243-
"3.12.12",
244-
"3.11.14",
245-
"3.10.19",
243+
"3.12.13",
244+
"3.11.15",
245+
"3.10.20",
246246
"system",
247247
)
248248

0 commit comments

Comments
 (0)