Skip to content

Commit

Permalink
ci: BI-0 add cleaning unused envs in task dev:init (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovsds authored Oct 29, 2024
1 parent c96a482 commit db9dea5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metapkg/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions tools/taskfiles/taskfile_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ tasks:
init:
desc: Initialize project
cmds:
- echo "Ensuring python virtual environment is created"
- echo "Cleaning unused envs in {{.VENV_PATH}}"
- for env in "$UNUSED_ENVS"; do
echo "Removing $env";
poetry env remove $env --directory={{.PYPROJECT_TOML_PATH}};
done;
- echo "Initializing python virtual environment in {{.VENV_PATH}}"
- poetry install --directory={{.PYPROJECT_TOML_PATH}} --sync --no-root
requires:
vars:
- PYPROJECT_TOML_PATH
vars:
UNUSED_ENVS:
sh: poetry env list --no-ansi --directory={{.PYPROJECT_TOML_PATH}}
| sed 's/ (Activated)//g'
| grep -v \".venv\"

poetry-lock:
poetry_lock:
desc: Lock dependencies in metapkg
cmds:
- poetry lock --no-update --directory={{.PYPROJECT_TOML_PATH}}
Expand Down

0 comments on commit db9dea5

Please sign in to comment.