Will we soon get a better experience writing pulum...
# python
Will we soon get a better experience writing pulumi in python? At the moment I prefer nodejs over python because intellisense works much better and drilling into resources for examples actually works.
What are your top requests for Pulumi in Python?
Intellisense mainly, unless it only doesn't work on my machine?! In nodejs I can also ctrl+click a resource to see the implementation including examples. I don't have that in python.
what IDE are you using?
vs code on ubuntu
vs code does intellisense for me
the things I do get seem far away from what I get in nodejs though, especially `ctrl`+`click` on a resourcetype and going straight to an implementation example
i have no idea what intellisense for nodejs looks like
ctrl+click works for me, no idea why you would need that, but it works
it shows the source code for the function
like it normally does
in nodejs I can then go and check out the actual
and see example usage. I don't seem to get that in python. This has already been quite useful more than once.
@colossal-room-15708 I’m also primarily a TS user but just tried out pulumi python and I can navigate to the class implementation just like with TS. The only catch is that you have to navigate first to the import statement and then click in the import statement again to get to the implementation
have you created a local virtuelenv and set VS code to correctly use that virtualenv as interpreter?
you can do this via the
Python: Select Interpreter
action in vs code
@white-balloon-205 that code navigation aside. I noticed that most pulumi python resources have very incomplete type information compared to TS equivalent. I.e. the k8s Deployment resource in TS has full type information for the
and one gets really rich code completion whereas in the python equivalent there seems to be no type information (python 3.6+ type annotations) at all for the Spec.
The only catch is that you have to navigate first to the import statement and then click in the import statement again to get to the implementation
- thats not true, you dont have to click the import statement
@little-river-49422 really? In my example:
Copy code
from pulumi_kubernetes.apps.v1 import Deployment

deployment = Deployment()
when I click on
it navigates first to the import statement and then I have to click again to go to the implementation. How does that work on your side?
it takes me to the code, not the import statement
ah, i think for k8s it does that, not for azure
here's what i get when I click on the clusterrolebinding resource
but that code is part of pulumi module, not my code
I think it’s because you’re doing * imports
whereas my code imports individual pieces
like i said, its not my code. i'm not doing * imports
just tried. When I write this:
Copy code
from pulumi_kubernetes.apps.v1.Deployment import *

and click
it takes me directly to the implementation
how do you import then @little-river-49422 . Do you have an example?
👍 1
Looks like I completely skipped the virtualenv setup 😞 I'm now getting "better" intellisense, although vs code sorts everything alphabetically, where in nodejs vs code shows me properties for the resource first, then the generic stuff. Probably a vs code thing though.
alright, that said, here is something I observed comparing the two (nodejs v python)
nodejs referencing other resources' properties
python referencing other resources' properties (doesn't work?)
nodejs showing me what values I can specify for resource properties
python not showing me anything
I'm happy to be called an idiot here by the way and told that I'm doing it wrong (like the virtualenv above)
Oh, I can btw `ctrl`+`click` on
in python and then get here, but for example on
it says "supports the fields documented below", but then nothing is "documented below".
I eventually got here to a working example, but I needed to have another pulumi workspace open which had a JS stack in it where I rewrote JS to python, plus the terraform docs. Feels like I'm context switching a lot in order to get to my python stack
personally i dont trust all these tools and only use api reference