(just figured this channel exists) Added a Python ...
# python
a
(just figured this channel exists) Added a Python question 👇 , hopefully the audience is more targeted here: https://pulumi-community.slack.com/archives/C01PF3E1B8V/p1647451407628919
p
this is a core python concept, not a pulumi specific thing... have a read of
<https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.html#all-about-__init__py>
a
Yeah, I understand how init files work, it's just that if I leave them empty Pulumi is not importing the rest of the project, but looks like it's something I'm doing wrong. The answer here pointed to a potential solution. Thank you!
g
This is more about PYTHONPATH it's the same problem as in AWS Lambda. Where the PYTHONPATH starts from
__main__.py
In this case
__main__.py
can import from
python_package_in_path
Copy code
pulumi_project/
  __main__.py
  python_package_in_path/
     __init__.py
but in this case, you cannot because
__main__.py
cannot see the sibling directory.
Copy code
pulumi_project/
  __main__.py

python_package_not_in_path/
     __init__.py
So you need a way to get
python_package_not_in_path
in PYTHONPATH (aka
sys.path
)
a
Tx, I'll give this a try.