Skip to content

Commit

Permalink
fix: stores on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Feb 7, 2024
1 parent c28d68f commit 7aaad4f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/kiara/registries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ def archive_id(self) -> uuid.UUID:
result = self.archive_metadata["archive_id"]
except KeyError:
raise Exception("Archive does not have an id metadata value set.")

return uuid.UUID(result)

@property
Expand Down Expand Up @@ -394,6 +393,9 @@ def create_new_store_config(

import sqlite3

print("xxx")
print(archive_path)

if not os.path.exists(archive_path):
Path(archive_path).parent.mkdir(exist_ok=True, parents=True)

Expand Down
4 changes: 2 additions & 2 deletions src/kiara/registries/aliases/sqlite_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def sqlite_path(self):
return self._db_path

db_path = Path(self.config.sqlite_db_path).resolve()
self._db_path = fix_windows_longpath(db_path)
# self._db_path = fix_windows_longpath(db_path)
self._db_path = db_path

if self._db_path.exists():
return self._db_path
Expand Down Expand Up @@ -106,7 +107,6 @@ def sqlite_engine(self) -> "Engine":
value_id TEXT NOT NULL
);
"""

with self._cached_engine.begin() as connection:
for statement in create_table_sql.split(";"):
if statement.strip():
Expand Down
4 changes: 2 additions & 2 deletions src/kiara/registries/data/data_store/sqlite_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def sqlite_path(self):
return self._db_path

db_path = Path(self.config.sqlite_db_path).resolve()
self._db_path = fix_windows_longpath(db_path)
# self._db_path = fix_windows_longpath(db_path)
self._db_path = db_path

if self._db_path.exists():
return self._db_path
Expand Down Expand Up @@ -161,7 +162,6 @@ def sqlite_engine(self) -> "Engine":

# def _pragma_on_connect(dbapi_con, con_record):
# dbapi_con.execute("PRAGMA query_only = ON")

self._cached_engine = create_engine(self.db_url, future=True)
create_table_sql = """
CREATE TABLE IF NOT EXISTS values_metadata (
Expand Down
3 changes: 2 additions & 1 deletion src/kiara/registries/jobs/job_store/sqlite_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def sqlite_path(self):
return self._db_path

db_path = Path(self.config.sqlite_db_path).resolve()
self._db_path = fix_windows_longpath(db_path)
# self._db_path = fix_windows_longpath(db_path)
self._db_path = db_path

if self._db_path.exists():
return self._db_path
Expand Down

0 comments on commit 7aaad4f

Please sign in to comment.