<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python extension 2.0 - include own sub-modules in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Python-extension-2-0-include-own-sub-modules/m-p/281890#M37128</link>
    <description>&lt;P&gt;Answering to my own dumbness:&lt;BR /&gt;Of course you need to include a __init__.py (can be empty) in every sub directory as well so that the setuptools used when building the extension will include those directories!&lt;/P&gt;</description>
    <pubDate>Sat, 19 Jul 2025 18:31:32 GMT</pubDate>
    <dc:creator>r_weber</dc:creator>
    <dc:date>2025-07-19T18:31:32Z</dc:date>
    <item>
      <title>Python extension 2.0 - include own sub-modules</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Python-extension-2-0-include-own-sub-modules/m-p/281846#M37125</link>
      <description>&lt;P&gt;Hello extension devs,&lt;/P&gt;&lt;P&gt;I have a strange behavior when building a python 2.0 extension. I structure my code/modules like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;extension
  extension.yaml
  actiavtionSchema.json
my_extension
- mymodule1
    - submodule
        sub.py
- mymodule2
    module.py
  __main__.py
setup.py&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the extension locally with the simulator everything works great. But when I build the extension only some/not all module subdirectories are included in the build and such I'm getting missing module errors.&lt;BR /&gt;Including the module directories in setup.py doesn't make sense as they would be treated as PyPi packeages, shouldn't the build include those without anything else?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2025 11:08:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Python-extension-2-0-include-own-sub-modules/m-p/281846#M37125</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2025-07-18T11:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python extension 2.0 - include own sub-modules</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Python-extension-2-0-include-own-sub-modules/m-p/281890#M37128</link>
      <description>&lt;P&gt;Answering to my own dumbness:&lt;BR /&gt;Of course you need to include a __init__.py (can be empty) in every sub directory as well so that the setuptools used when building the extension will include those directories!&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jul 2025 18:31:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Python-extension-2-0-include-own-sub-modules/m-p/281890#M37128</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2025-07-19T18:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python extension 2.0 - include own sub-modules</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Python-extension-2-0-include-own-sub-modules/m-p/281914#M37137</link>
      <description>&lt;P&gt;Also if you want to include non *.py files in your extension, you might want to add this in the setup.py code:&lt;BR /&gt;e.g. to also package some json template files with the extension:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;setup(
    ...
    extras_require={"dev": ["dt-extensions-sdk[cli]"]},
    package_data={
        "my_ext_module_name": ["templates/*.json"],
    },
)&lt;/LI-CODE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Jul 2025 07:54:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Python-extension-2-0-include-own-sub-modules/m-p/281914#M37137</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2025-07-21T07:54:25Z</dc:date>
    </item>
  </channel>
</rss>

