title: How can I build an RPM for an earlier version of python?
body: <p>How can I build a python distribution RPM that is only dependent on an <em>earlier</em> version of python?  </p>
  
  <p><strong>Why?</strong>  I'm trying to build a distribution RPMs for RHEL6/CentOS 6, which only includes Python 2.6, but I am building usually on machines with Python 2.7. </p>
  
  <p>This is an open source project, and I have already ensured that it shouldn't be including any libraries/APIs that are not in 2.6. </p>
  
  <p>I am building the RPMs with: </p>
  
  <pre><code>python setup.py bdist_rpm
  </code></pre>
  
  <hr>
  
  <p><strong>setup.py file:</strong></p>
  
  <pre><code>from distutils.core import setup
  
  setup(name='pyresttest',
      version='0.1',
      description=Text',
      maintainer='Not listing here',
      maintainer_email='no,just no',
      url='project url here',
      keywords='rest web http testing',
      packages=['pyresttest'],
      license='Apache License, Version 2.0',
      requires=['yaml','pycurl']
  )
  </code></pre>
  
  <p>(Specifics removed for the url, maintainer, email and description). </p>
  
  <p>The RPM appears to be valid, but when I try to install on RHEL6, I get this error:
  python(abi) = 2.7 is needed by pyresttest-0.1-1.noarch</p>
  
  <p>There should be some way to get it to override the default python version to require, or supply a custom SPEC file, but after several hours of fiddling with it, I'm stuck. Ideas?</p>
  
  <hr>
  
  <p>EDIT: I suppose I should clarify why I'm doing a RPM for python code, instead of just using setuptools or pip: this will hopefully go to production at work, where all deployments are RPM-based and most VMs are still RHEL6.  Asking them to adopt another packaging tool is likely to be a non-starter, since our company is closely tied to the RPM format. </p>