https://pulumi.com logo
#python
Title
# python
m

many-yak-61188

07/06/2021, 3:32 PM
hello all 👋 complete noob here. Running into an issue utilizing
pulumi
in a github
workflow
where all dependencies are managed via
poetry
. I'm think I do not understand the combination of
poetry
in github
workflows
which is causing the error in pulumi and not directly an issue with pulumi itself. Describing the issue in the thread with more details
I've set up a github workflow for pull requests, the intent of the workflow is to run
pulumi preview
. The workflow file is here : https://gist.github.com/maddalab/5eefdad3bd51005b8fe678e219c1b6e7
the project uses
poetry
the pyproject.toml file is
Copy code
[tool.poetry]
name = "accrue-infrastructure"
version = "0.1.0"
description = ""
authors = ["Bhaskar Maddala <maddalab@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.8"
pulumi-aws = "^4.10.0"
pulumi = "^3.6.0"

[tool.poetry.dev-dependencies]
pytest = "^5.2"
pre-commit = "^2.13.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
locally I'm able to run
pulumi preview --stack dev
or alternatively if environment is not activated
poetry run pulumi preview --stack dev
on github workflows I get a
module not found error
which is entirely on the python path setup
the logs from installing poetry - where i disabled virtual env show
Copy code
Run snok/install-poetry@v1.1.6
  with:
    virtualenvs-create: false
    version: 1.1.6
    virtualenvs-in-project: false
    virtualenvs-path: {cache-dir}/virtualenvs
  env:
    PULUMI_CONFIG_PASSPHRASE: ***
    pythonLocation: /opt/hostedtoolcache/Python/3.8.10/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.10/x64/lib
    AWS_DEFAULT_REGION: us-east-1
    AWS_REGION: us-east-1
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
i'm assuming the
false
indicate that dependencies are installed in global python environment
the error I get is
Copy code
File "/opt/hostedtoolcache/pulumi/3.6.0/x64/pulumi-language-python-exec", line 14, in <module>
          import pulumi
QQ: Does
pulumi/actions
and
snok/install-poetry@v1.1.6
respect the python version specified in
actions/setup-python@v2
it's likely i'm the issue here 🙂
ok confirmed via local that the error is strictly when the virtualenv is not activated
6 Views