diff --git a/src/nancy/__init__.py b/src/nancy/__init__.py index ae6edc8..05526ff 100644 --- a/src/nancy/__init__.py +++ b/src/nancy/__init__.py @@ -1,26 +1,9 @@ import sqlite3 -from . import db +from . import store from .version import __version__ -# Calling code will build up a large DAG then at the very last step, call -# nancy.save_data(). Only at that point will we determine where to save the -# data by asking the user for an output dir. However, we need a database -# initialized in order to build up the DAG in the first place, so here we -# initialize an in-memory database to use until we have an output directory. -_conn = db.init(":memory:") - - -def persist_db(dbpath): - global _conn - - dst_conn = sqlite3.connect(dbpath) - _conn.backup(dst_conn) - _conn.close() - _conn = dst_conn - - def save_data( destination_mapping, desc=f"Provenance-tracking with nancy v{__version__}", diff --git a/src/nancy/db.py b/src/nancy/db.py index 589e4a6..3524527 100644 --- a/src/nancy/db.py +++ b/src/nancy/db.py @@ -3,7 +3,9 @@ import os import sqlite3 -schema_version = 2 +# This matches the recorded user_version in any nancy.db initialized in this +# process. +schema_version = 0 def init(path): diff --git a/src/nancy/version.py b/src/nancy/version.py index 0a2dcf8..6546a8d 100644 --- a/src/nancy/version.py +++ b/src/nancy/version.py @@ -1 +1,4 @@ -__version__ = "0.0.1pre" +from .db import schema_version + +__version__ = "0.1.0" +