general: deprecate my.core.dataset and simplify tox file

This commit is contained in:
Dima Gerasimov 2024-08-06 23:44:01 +01:00
parent 65dbdc44ef
commit 420e8b23f2
4 changed files with 16 additions and 34 deletions

View file

@ -0,0 +1,12 @@
from ..common import PathIsh
from ..sqlite import sqlite_connect_immutable
def connect_readonly(db: PathIsh):
import dataset # type: ignore
# see https://github.com/pudo/dataset/issues/136#issuecomment-128693122
# todo not sure if mode=ro has any benefit, but it doesn't work on read-only filesystems
# maybe it should autodetect readonly filesystems and apply this? not sure
creator = lambda: sqlite_connect_immutable(db)
return dataset.connect('sqlite:///', engine_kwargs={'creator': creator})