Skip to content

Commit

Permalink
allow save_py_cahces to select what it does
Browse files Browse the repository at this point in the history
  • Loading branch information
ajslater committed Jan 26, 2022
1 parent 3aa0d5a commit 2249bfc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
container_name: codex-save-cache
volumes:
- ./cache/packages:/app/cache/packages
command: ./python_cacher/save_py_caches.py prune
command: ./python_cacher/save_py_caches.py pip poetry prune
codex-frontend-lint:
<<: *codex-dist-builder
container_name: codex-frontent-lint
Expand Down Expand Up @@ -92,7 +92,7 @@ services:
container_name: codex-save-final-cache
volumes:
- ./cache/packages:/app/cache/packages
command: ./python_cacher/save_py_caches.py
command: ./python_cacher/save_py_caches.py pip
codex:
env_file:
- .env
Expand Down
3 changes: 3 additions & 0 deletions python_cacher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# python\_cacher

Some scripts for managing the circleci python package & wheels caches and linking wheels to them for use by `pip find-links`
10 changes: 6 additions & 4 deletions python_cacher/save_py_caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ def main(args):
arch = run(("uname", "-m"))[0]
arch_cache_path = CACHE_PATH / arch
arch_cache_path.mkdir(parents=True, exist_ok=True)
if "prune" in args:
prune_poetry_artifacts()
save_cache(POETRY_CACHE_PATH, arch_cache_path)
save_cache(PIP_CACHE_PATH, arch_cache_path)
if "poetry" in args:
if "prune" in args:
prune_poetry_artifacts()
save_cache(POETRY_CACHE_PATH, arch_cache_path)
if "pip" in args:
save_cache(PIP_CACHE_PATH, arch_cache_path)


if __name__ == "__main__":
Expand Down

0 comments on commit 2249bfc

Please sign in to comment.