Open punkdata opened 5 years ago
So I tried a straight dep install using:
- run:
name: Install dependecies
command: sudo pip install --upgrade pip==18.0 && pip install --user pulumi pulumi-gcp
This actually works but obviously doesn't use the pipenv cmd. I just want to confirm that the issue was isolated to pipenv.
So the behavior you are seeing is generally by design. In order to pick up the packages managed by pipenv
, any commands need to be in a processed launched by pipenv
. Though we can repurpose this issue to track supporting this scenario.
If we were to update the pulumi/{update, preview}
orbs to have a "command prefix" or something. If we had an escape hatch where you could specify some aribrary text before the pulumi update
command, that should allow you to run the pulumi update
command within pipenv
. Not the best design, but possibly useful for some other scenarios too.
For posterity, here are some other approaches:
Install packages system wide by just using sudo pip install
. (Like you mentioned above.) Obviously this defeats the purpose of using pipenv
.
Create a pipenv
CircleCI orb that will allow nesting of other orbs, and have that take care of the "execute within pipenv
environment". That would be pretty slick, but might not actually be possible based on the way Orbs get executed and how that interacts with pipenv
.
This also impacts usage of the orb with poetry
as dependencies there are installed in a virtualenv as well.
My workaround is something like this (assuming you are using the python orb to install poetry deps):
- python/install-packages:
pkg-manager: poetry
- run:
name: "Add poetry venv to environment"
command: |
echo "export PATH=$(poetry env info --path)/bin:$PATH" >> "$BASH_ENV"
echo "export VIRTUAL_ENV=$(poetry env info --path)" >> "$BASH_ENV"
# pulumi commands here
This is the error produced in the
deploy_to_gcp:
job of my config when calling thepulumi/update:
orb functionI'm using pipenv and it looks like the pulumi/update function is kicking off outside of the pipenv environment which caused the installed deps to be hidden from the pulumi/update orb call. I'm unable to get the pulumi/update call to complete successfully when using pipenv to install deps.
Here is the config that I'm currently using. Some Jobs are comment out to save time.