Skip to content

Commit

Permalink
fix: Explicitly install devbox python requirements in init-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesperklund committed Jul 4, 2024
1 parent a715548 commit 5c5dd06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion devbox-plugins/base-config/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@
// 'activate' works for bash and zsh
"if [ -f requirements.txt ];then . $VENV_DIR/bin/activate;fi",

// Install tools, that devbox needs.
"pip install -r {{ .Virtenv }}/devbox-requirements.txt",

// .venv seems to always be present when installing python, so ignore it even if venv is not activated
// try to make adding to .gitignore idempotent
// crudini tool tries to read from default section, as if was an ini file, and find the line starting with ".venv" and returns true if found
"if crudini --get .gitignore \"\" \".venv\";then true; else echo -e '\n\n# Python virtual environment for tooling and Ansible\n.venv' >> .gitignore; fi",

// install repository requirements, which might point to other requirements files
"if [ -f requirements.txt ];then pip install -r requirements.txt -r {{ .Virtenv }}/devbox-requirements.txt;fi",
"if [ -f requirements.txt ];then pip install -r requirements.txt;fi",

"if [ -f .pre-commit-config.yaml ];then pre-commit install;fi"
],
Expand Down

0 comments on commit 5c5dd06

Please sign in to comment.