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

gifted-angle-51057

08/28/2023, 6:55 PM
Hello! I'm trying to learn about how Pulumi interacts with package tooling in Python. It seems like you can set up your own virtual environment with whatever dependencies you like, but the main script always lives in a file called
__main__.py
that lives in the current directory. I try to keep the main package dir tidy with no Python files in it to avoid ambiguous imports, so I'd like to put it into a module like
myapp.deployment.pulumi_main
or similar. I have a few separate questions about this: • How does Pulumi figure out exactly where to read the code from? ◦ Is it hard-coded? ◦ Is changing it possible? • Are there best practices for larger projects around how to organize code? For example, should I be putting my Pulumi code into a different Git repo from my application?
d

dry-keyboard-94795

08/28/2023, 7:33 PM
You can use the
main
setting in Pulumi.yaml to specify a directory, but it'll always load with
__main__.py
in that directory
g

gifted-angle-51057

08/30/2023, 6:49 PM
@dry-keyboard-94795 thanks for the hint! I feel like I'm going to feel very silly when this is answered, but where is the documentation for that configuration key?
g

gifted-angle-51057

08/30/2023, 6:59 PM
Thanks, as expected I feel silly 🙂 . my eyes glazed right over that.
d

dry-keyboard-94795

08/30/2023, 7:00 PM
Tbh, I also struggle to find that page, what with Pulumi Yaml being a thing
2 Views