title: What is the expected directory structure for submodule stubs to be understood by mypy?
body: <p>I have a package backed by an <code>.so</code> file for which I have generated stubs using <code>stubgen</code>, I renamed the original <code>__init__.pyi</code> to <code>impl.pyi</code> and added a <code>py.typed</code> and <code>__init__.pyi</code>.</p>
  <p>the resulting structure looks like</p>
  <pre><code>site-packages/
  ├── __init__.pyi
  ├── impl.pyi
  ├── impl.so
  ├── sub_impl
  │   ├── __init__.pyi
  │   └── something.pyi
  └── py.typed
  </code></pre>
  <p>here</p>
  <p><code>impl.so</code> is a module with a <code>sub_impl</code> &quot;submodule&quot; with entries created via pybind11's <code>def_submodule</code></p>
  <p>in another directory I have a <code>test_import.py</code> and a <code>mypy.ini</code> with the absolute path</p>
  <pre><code>[mypy]
  mypy_path=/something/site-packages/
  [head]
  </code></pre>
  <p>As expected</p>
  <pre><code>import impl as foo
  print(foo)
  </code></pre>
  <p>gives</p>
  <pre><code>Success: no issues found in 1 source file
  </code></pre>
  <p>also</p>
  <pre><code>from impl import SomeObject
  print(SomeObject)
  </code></pre>
  <p>gives</p>
  <pre><code>Success: no issues found in 1 source file
  </code></pre>
  <p>but</p>
  <pre><code>import impl.sub_impl as foo
  print(foo)
  </code></pre>
  <p>gives</p>
  <pre><code>test_import.py:1: error: Cannot find implementation or library stub for module named &quot;impl.sub_impl&quot;
  test_import.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
  Found 1 error in 1 file (checked 1 source file)
  </code></pre>
  <p>all 3 cases run fine under the python interpreter.</p>
  <p>Whats wrong with the directory structure and what does <code>mypy</code> need to detect the submodule?</p>