This message was deleted.
# python
s
This message was deleted.
r
not familiar with the automation API, but going with the error message it almost looks like as it says, it cannot infer a constructor for the "ProjectBackend". One way to test this out would be at the REPL. Assuming you have an
import pulumi.automation as auto
(looks like it?):
Copy code
>>> import pulumi_automation as auto
>>> auto.ProjectBackend # does this give you an error?
If that gives you an error, then we have something to work with. Otherwise, i'd also keep exploring around what's going on with the backend argument
side note: how are you navigating the python documentation? I see https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.automation.create_or_select_stack ... but I'm not finding much info on how to construct the
opts: LocalWorkspaceOptions
argument
p
I haven't had much luck finding stuff in the Pulumi Python docs. Instead I usually rely on the type hints in my editor, and browsing the source code (right click > go to definition).
I'm able to run
auto.ProjectBackend()
without error, with and without providing the
url
argument. It only becomes a problem when running
stack.up
or
stack.preview
r
p
Yup
r
gotcha. That's a good approach. Thanks! if
auto.ProjectBackend
does not give you an error, I'm afraid I'm at my wits' end... If you can provide a small complete program so others can reproduce it, I think that would help others look at it for you
p
I worked around the error by using the
PULUMI_BACKEND_URL
environment variable documented here: https://www.pulumi.com/docs/cli/environment-variables/ Ideally using
auto.ProjectBackend
would work, but the env var is good enough for my purposes.
👌 1