title: pulling a git repo at a particular commit in python setup.py file
body: <p>I have a Python project where I am using the <code>maskrcnn_benchmark</code> project from facebook research.</p>
  
  <p>In my continuous integration script, I create a virtual environment where I install this project with thee following steps:</p>
  
  <pre><code> - git clone https://github.com/facebookresearch/maskrcnn-benchmark.git
  - cd maskrcnn-benchmark
  - git reset --hard 5ec0b91cc85163ac3b58265b3f9b39bb327d0ba6
  - python setup.py build develop
  </code></pre>
  
  <p>This works fine and installs everything in the virtual environment as it needs to be.</p>
  
  <p>Now I have a <code>setup.py</code> for my project for packaging and deploying my app. How can I do the same in this <code>setup.py</code> file i.e. pull and build this repository from the particular commit hash?</p>
  
  <p>Thanks to the answer below and the comments, I have the setup.py as follows now:</p>
  
  <pre><code>install_requires=[
          '5ec0b91cc85163ac3b58265b3f9b39bb327d0ba6-0.1',
          'ninja',
          'yacs',
          'matplotlib',
          'cython==0.28.5',
          'pymongo==3.7.1',
          'scipy==1.1.0',
          'torch==1.0.0',
          'torchvision==0.2.1',
          'opencv_python==3.4.2.17',
          'numpy==1.15.1',
          'gputil==1.3.0',
          'scikit_learn==0.19.2',
          'scikit_image==0.14.0',
          'sk_video==1.1.10'
    ],
  
  dependency_links=[
          'http://github.com/facebookresearch/maskrcnn-benchmark/tarball/master#egg=5ec0b91cc85163ac3b58265b3f9b39bb327d0ba6-0.1'
    ],
  </code></pre>
  
  <p>No matter where I put the <code>'5ec0b91cc85163ac3b58265b3f9b39bb327d0ba6-0.1'</code>, the <code>maskrcnn-benchmark</code> project gets compiled first. How can I do it that the dependency and this package is installed last?</p>