title: How do I build a py2 wheel package, when setup.py runs with a Python version 3 interpreter?
body: <p>I have a package that is supposed to be Python <strong>version 2 only</strong> but needs to be build running a version 3 interpreter.</p>
  
  <p>The <code>setup.py</code> of this package looks something like hits:</p>
  
  <pre><code>from setuptools import setup
  
  setup(
      python_requires="&lt;3.0, &gt;=2.7.5",
      classifiers=[
          'Programming Language :: Python :: 2',
          'Intended Audience :: Developers',
      ],
      # ... more keyword arguments ... 
   )
  </code></pre>
  
  <p>If I call <code>python2 setup.py build bdist_wheel</code>, I get:</p>
  
  <pre><code>$ ls dist
  mypackage-0.3.dev14-py2-none-any.whl
  </code></pre>
  
  <p>If I run it with a version 3 interpreter, i.e. <code>python3 setup.py build bdist_wheel</code>, I get:</p>
  
  <pre><code>$ ls dist
  mypackage-0.3.dev14-py3-none-any.whl
  </code></pre>
  
  <p>I would have expected that regardless of the interpreter version, I will get a py2 package, because I specified it with <code>python_requires</code> (and in the tags). My package build server only has a Python 3 interpreter. </p>
  
  <p>How can I build a wheel that targets Python 2 when running setuptools with a Python 3 interpreter? Is that at all possible? Does the <code>-py3-</code>/<code>-py2</code> in the filename mean something different than I think it does?</p>