rhythmic-sunset-53997
01/06/2023, 10:45 AMvirtualenv
option?
My aim is for the project config to be
• usable by anyone (so there cannot be an absolute path like /Users/myname/foo
), and
• the same virtualenv
to be used by multiple Pulumi projects (I do not want to install the full 1.5-GB venv for every single project)
The following would work, but sadly ~
does not get expanded to the home directory, so the virtualenv is created under /Users/myname/path/project/~/.pulumi/venv
runtime:
name: python
options:
virtualenv: ~/.pulumi/venv
Another option would be to define this via an environment variable, but I have not found any documentation on how that would be possible.dry-keyboard-94795
01/06/2023, 10:55 AM../.venv
)rhythmic-sunset-53997
01/06/2023, 10:56 AMdry-keyboard-94795
01/06/2023, 11:07 AMPULUMI_PYTHON_CMD
envvar in the past to work around a venv issue, it should let you point to the python binary in the venv itselfrhythmic-sunset-53997
01/06/2023, 11:27 AMPULUMI_PYTHON_CMD
option works, but is mutually exclusive with the use of virtualenv
. When both are defined, first venv is created and then the path in PULUMI_PYTHON_CMD
is appended to the virtualenv
path (even though it’s an absolute path):
error: failed to discover plugin requirements: calling `python -m pip list -v --format json`: fork/exec /Users/name/work/ci/infra/microk8s/venv/bin/Users/name/pulumi-venv/bin/python3.9: no such file or directory
so this is an option, but then one has to manage the virtualenv themselves without pulumi creating it for them if it does not yet exist.
Symlinks seem to work. A little of extra hassle, but that’s manageable, thanks