If all the projects are in the same repo, you can have the virtualenv reference a parent directory (
../.venv
)
r
rhythmic-sunset-53997
01/06/2023, 10:56 AM
Thanks for the suggestion, but they are not - they are in individual repos that may or may not be cloned to the same parent directory - that’s up to each team member.
d
dry-keyboard-94795
01/06/2023, 11:07 AM
hmm.
I vaguely remember using the
PULUMI_PYTHON_CMD
envvar in the past to work around a venv issue, it should let you point to the python binary in the venv itself
dry-keyboard-94795
01/06/2023, 11:08 AM
symlinks may also work
r
rhythmic-sunset-53997
01/06/2023, 11:27 AM
Thanks, the
PULUMI_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):
Copy code
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
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.