This message was deleted.
# python
s
This message was deleted.
1
q
The action runs the command
pulumi up --yes --skip-preview --parallel 2147483647 --exec-agent pulumi/actions@v3 --color auto --exec-kind auto.local --stack nocap/dev --non-interactive
(for example), and that fails due to not running in the env with the deps. When running pytest later, I just run
poetry run pytest
to make sure it's using the corrent env. I could also run
poetry shell
first to have future command run in that env. I assume this is also a problem for Pipenv.
And even with
pip
if you install in a virtualenv. The example uses
pip
to install to the system, which is fine for a disposable runner... Maybe I can just turn it off, like with
pipenv install --system
.
k
+ 1! AFAIK it’s only possible to specify which environment pulumi runs in in the Pulumi.yaml file which is project wide and static. It would be really handy to be able to specify which environment the stack runs in at runtime. I’ve tried overriding the runtime.options.virtualenv property for the stack since we can do that via the CLI during runtime but that didn’t get picked up.
1
1
❤️ 1
l
I have this configured:
poetry config virtualenvs.in-project true
which creates the virtual environment folder within the project setup. With that in place, you can use Poetry to manage dependencies, then run Pulumi with the
venv
folder configured in
Pulumi.yaml
.
q
Ah, that makes sense @limited-rainbow-51650. thanks! That got me working. I changed my Pulumi.yaml file to include:
Copy code
runtime:
  name: python
  options:
    virtualenv: venv
And ran
poetry config virtualenvs.in-project true --local
(just setting it for this project) and made sure
poetry.toml
was added to source control.
👍🏼 1