title: Is there a best practice to make a package PEP-561 compliant?
body: <p>I'm writing a Python project which is published as a package to a pypi-like repository (using <code>setuptools</code> and <code>twine</code>). I use type hints in my code.</p>
  <p>The issue is, when importing the package from a different project and running <code>mypy</code>, I get the following error:
  <code>error: Skipping analyzing 'XXX': found module but no type hints or library stubs</code></p>
  <p>As I understand, I got this error because my package was not compliant with <a href="https://www.python.org/dev/peps/pep-0561/" rel="noreferrer">https://www.python.org/dev/peps/pep-0561/</a> .</p>
  <p>After some searching online, I didn't find a way that was not manual to add the required files to the package.</p>
  <p>I resorted to writing my own code to:</p>
  <ol>
  <li>Run <code>stubgen</code> to create stub files.</li>
  <li>Create <code>py.typed</code> files in every directory.</li>
  <li>Collect all the created files in a <code>dict</code> in <code>package_data</code> field in the <code>setup.py</code> file.</li>
  </ol>
  <p>This code solved the issue and <code>mypy</code> runs without errors. But this feels very wrong to me. Is there a standard tool for making a package PEP-561 compliant? Am I missing something else?</p>