Looks like it expects program (callable) to be pro...
# python
v
Looks like it expects program (callable) to be provided for local workspace but that should not be included with work_dir provided.
r
Hi! Is that your entire code sample?
That is pretty surprising since we have tests for these scenarios
v
The only other part of code is
Copy code
from pulumi import automation as auto
@red-match-15116 Thanks for looking.
Copy code
(sourcescrub) Julians-MacBook-Pro:bare julian$ ls
Pulumi.dev.yaml		Pulumi.staging.yaml	__main__.py
Pulumi.prod.yaml	Pulumi.yaml
These are the contents of the directory.
r
I think I see what the issue is. It’s a bug on our end.
v
Copy code
auto.select_stack("dev", work_dir=".")
oh cool. is there a version I can upgrade to?
or downgrade to?
if the pr is public can you send me the link? interested in what the issue was.
r
I think it’s because IPython is trying to print the LocalWorkspace object and it’s failing because its not correctly configured. I’m gonna fix it now but the point release might be in a couple of days.
Yeah one sec.
v
oh, will this work outside of ipython?
have not tried that.
r
Yes it should work outside of IPython.
v
oh cool.
r
The problem is basically that IPython is trying to run
print(stack)
and the printable version of
Stack
is broken when there isn’t a program.
v
right.
Copy code
program.__name__
program callable was not provided (or needed)
💯 1
Thanks for your help on this!
r
Yup exactly. I’m pushing up a fix now. Sorry about this!
v
conditional in a format string. Nice!
Thanks for sharing the PR.
Hmmm. Getting it with outside of ipython
r
I can only get this to throw if I run
print(stack)
Which it appears you are doing.
Copy code
"/Users/julian/git/sourcescrub/sourcescrub.azureinfrastructure/infra/lib/pulumi_helpers.py", line 49, in deploy_project
    print(stack)
v
ahh good point.
Thanks.
partypus 8bit 1
👍🏽 1
r
np!
v
Hey Komal! I really appreciated your help on my last issue. Question, is there a way to unit test my pulumi IOC without network connectivity. I guess this is an azure specific question (I will ask in channel). When I worked with AWS I used a library called boto to mock AWS's api. It was awesome because every cloud formation template generated was tested (all resources mock created). Would love to do this with pulumi and azure.
r
Hey! You can write mocks following the guide here: https://www.pulumi.com/docs/guides/testing/unit/
👍 1