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

adamant-france-50503

08/17/2021, 10:16 PM
does anyone know how to properly setup IntelliSense/autocomplete/code hint for pulumi python on VS Code? the built in Python Intellisense isn't giving me any code suggestion specific on pulumi or pulumi_aws
g

great-sunset-355

08/18/2021, 8:43 AM
This is known issue (it somewhere in pulumi github) Afaik VSCode worked "okay-ish" You just need to select the correct interpreter. If you have setup new pulumi project it also created a VENV so you need to point VSCode to that
g

gorgeous-minister-41131

08/19/2021, 8:50 PM
Also, it's worth checking into and using Pipenv if you haven't already. It's how we manage all our dependencies for the Pulumi Python implementation.
Copy code
[[source]]
name = "pypi"
url = "<https://pypi.org/simple>"
verify_ssl = true

[dev-packages]
black = ">=20.8b0"
debugpy = "*"
flake8 = "*"
pyls-black = "*"
python-language-server = "*"
rope = "*"

[packages]
pulumi = "<4.0.0,>=3.3.0"
pulumi-kubernetes = "<4.0.0,>=3.2.0"
pulumi-vault = "<5.0.0,>=4.0.1"
pulumi-aws = "<5.0.0,>=4.5.1"
pulumi-fastly = "<4.0.0,>=3.1.0"
pulumi-random = "<5.0.0,>=4.1.1"
pulumi-<ORG>-lib = { path = "./pulumi-<ORG>-lib", editable = true }
jinja2 = "*"
boto3 = "*"

[requires]
python_version = "3.8" # Aligns with the version in the official Docker image we base off of.

[pipenv]
allow_prereleases = true
VScode seems to detect pipenv's presence and subsequently you can pick an interpreter (the one for the pipenv/venv) for the project.
Then again, I'm using Pylance, so YMMV
4 Views