title: Structuring setup.py and requirements.txt so that pip installs properly
body: <p>I'm trying to write a python package that can be installed from PyPI and am having trouble getting my head around how exactly to structure <code>setup.py</code> and <code>requirements.txt</code> properly.</p>
  
  <p>I know that they have different semantics and different purposes with <code>setup.py</code> defining whats needed, and <code>requirements.txt</code> given exact versions. I also know that you <a href="https://stackoverflow.com/questions/14399534/how-can-i-reference-requirements-txt-for-the-install-requires-kwarg-in-setuptool">shouldn't read <code>requirements.txt</code> into <code>setup.py</code></a>.</p>
  
  <p>So what I need to know is how to structure <code>setup.py</code> and <code>requirements.txt</code> so that when my package is installed from PyPI the reight requirements are installed.</p>
  
  <p>In my example, I need <code>django-haystack</code> (the latest version is <code>2.5.1</code>), but my code is only compatible with <code>django-haystack</code> version <code>2.5.0</code>, so my <code>setup.py</code> and <code>requirements.txt</code> are as shown below:</p>
  
  <p><code>setup.py</code>:</p>
  
  <pre><code>setup(
      name='my_package',
      install_requires = [
          'django-haystack',
      ],
  )
  </code></pre>
  
  <p><code>requirements.txt</code>:</p>
  
  <pre><code>django-haystack==2.5.0
  </code></pre>
  
  <p>How can I structure my setup code so that when this is installed, <code>django-haystack==2.5.0</code> is installed not the latest?</p>