Hi, I am trying to use <pulumi/actions> but it com...
# python
l
Hi, I am trying to use pulumi/actions but it complains about
ModuleNotFoundError: No module named 'pulumi'
I am trying to use pipenv and I see it should be supported. What is the proper way to set up pipenv? Any examples? Thanks!
g
Do you have pipenv set up with your project already? If I remember correctly, it's looking for a Pipfile.lock file in the repo. If that file is present, it auto-runs the action with pipenv
l
yes, I have. I can see in the logs:
Copy code
Successfully created virtual environment!
Installing dependencies from Pipfile.lock
I set up python:
Copy code
- name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9.9
          architecture: 'x64'
and pipenv, pulumi
Copy code
- name: Install Pulumi prereqs
        run: |
          pip install --upgrade pip
          pip install --upgrade pipenv
          pipenv install

      - name: Install pulumi
        uses: pulumi/setup-pulumi@v2
but for some reason I still get
Copy code
ModuleNotFoundError: No module named 'pulumi'
g
Ah, which version of the action are you working with? As of v3, you shouldn't need to install the Pulumi package, so it matters for finding examples. Can you drop your actions file thus far so I can help figure out what's up?
l
I am trying to use version 3.
Copy code
name: Pulumi Preview
on:
  pull_request:
    paths-ignore:
      - 'path1'
      - 'path2'
jobs:
  preview:
    runs-on: ubuntu-latest
    name: Pulumi preview
    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9.9
      - name: Install pipenv
        run: |
          pip install --upgrade pip
          pip install --upgrade pipenv
          pipenv install

      - uses: pulumi/actions@v3
        with:
          command: preview
          stack-name: mystack/dev
          work-dir: ./mydir
          comment-on-pr: true
Thanks!
g
Gotcha; give me a bit to try to replicate it as I'm not seeing anything majorly different from the examples and stuff I've done...
👍 1
l
Hi 🙂 Any updates?