title: How can I use setuptools to generate a console_scripts entry point which calls `python -m mypackage`?
body: <p>I am trying to be a good Pythonista and following <a href="https://www.python.org/dev/peps/pep-0338/" rel="noreferrer">PEP 338</a> for my package I plan on deploying. </p>
  
  <p>I am also trying to generate my executable scripts upon <code>python setuptools install</code> using setuptools <code>entry_points{'console_scripts': ... }</code> options. </p>
  
  <p>How can I use entry_points to generate a binary that calls <code>python -m mypackage</code> (and passes *args, **kwargs) ?</p>
  
  <p>Here are a few attempts I have made with no success:</p>
  
  <pre><code>setuptools(
  ...
  </code></pre>
  
  <p>(1)</p>
  
  <pre><code>entry_points=
         {'console_scripts': ['mypkg=mypkg.__main__'],},
  </code></pre>
  
  <p>(2)</p>
  
  <pre><code>entry_points=
         {'console_scripts': ['mypkg=mypkg.main'],},
  </code></pre>
  
  <p>(3)</p>
  
  <pre><code>entry_points=
         {'console_scripts': ['mypkg=python -m mypkg'],},
  </code></pre>
  
  <p>Primary resources I have been using:</p>
  
  <ul>
  <li><a href="http://pythonhosted.org/setuptools/setuptools.html#automatic-script-creation" rel="noreferrer">http://pythonhosted.org/setuptools/setuptools.html#automatic-script-creation</a></li>
  <li><a href="https://www.python.org/dev/peps/pep-0338/" rel="noreferrer">https://www.python.org/dev/peps/pep-0338/</a></li>
  <li><a href="http://www.scotttorborg.com/python-packaging/command-line-scripts.html" rel="noreferrer">http://www.scotttorborg.com/python-packaging/command-line-scripts.html</a></li>
  <li><a href="http://blog.habnab.it/blog/2013/07/21/python-packages-and-you/" rel="noreferrer">http://blog.habnab.it/blog/2013/07/21/python-packages-and-you/</a></li>
  </ul>