Skip to content

Commit

Permalink
Merge pull request #102 from smkent/temp-cache-dir
Browse files Browse the repository at this point in the history
Use temp dir for Poetry cache directory in manage-cookie
  • Loading branch information
smkent authored Mar 5, 2024
2 parents 95be994 + 4f47bdc commit 9313b3e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cookie_python/manage/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ def tempdir(self) -> Path:
)
)

@cached_property
def cachedir(self) -> Path:
d = self.tempdir / "cache"
d.mkdir(exist_ok=True)
return d

@cached_property
def clone_path(self) -> Path:
subprocess.run(
Expand Down Expand Up @@ -99,6 +105,7 @@ def run(
kwargs["env"].setdefault(
"PYTHON_KEYRING_BACKEND", "keyring.backends.null.Keyring"
)
kwargs["env"].setdefault("POETRY_CACHE_DIR", self.cachedir)
return subprocess.run(*popenargs, check=check, **kwargs)

def shell(self) -> None:
Expand Down

0 comments on commit 9313b3e

Please sign in to comment.