Skip to content

Commit

Permalink
Store the state and database files in ~/.conda-store by default
Browse files Browse the repository at this point in the history
There is currently an issue where it is not able to access the database file
correctly, which I am still figuring out.
  • Loading branch information
asmeurer committed Aug 30, 2023
1 parent f62255c commit fbe6145
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions conda-store-server/conda_store_server/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
import datetime
from pathlib import Path, PosixPath
from typing import Any, Dict

from celery import Celery, group
Expand Down Expand Up @@ -88,7 +89,7 @@ class CondaStore(LoggingConfigurable):
)

store_directory = Unicode(
"conda-store-state",
str(Path.home() / ".conda-store" / "conda-store-state"),
help="directory for conda-store to build environments and store state",
config=True,
)
Expand Down Expand Up @@ -201,7 +202,7 @@ class CondaStore(LoggingConfigurable):
)

database_url = Unicode(
"sqlite:///conda-store.sqlite",
"sqlite:///" + str(PosixPath.home()) + "/.conda-store/conda-store.sqlite",
help="url for the database. e.g. 'sqlite:///conda-store.sqlite' tables will be automatically created if they do not exist",
config=True,
)
Expand Down
2 changes: 2 additions & 0 deletions conda-store-server/conda_store_server/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def initialize(self, *args, **kwargs):

self.conda_store = CondaStore(parent=self, log=self.log)

self.conda_store.ensure_directories()

if self.conda_store.upgrade_db:
dbutil.upgrade(self.conda_store.database_url)

Expand Down

0 comments on commit fbe6145

Please sign in to comment.