title: Including Git submodules on pythonpath when using virtualenv
body: <p>I'm using Git for version control on a Django project. </p>
  
  <p>As much as possible, all the source-code that is not part of the project per se, but that the project depends on, is brought in as Git submodules. These live on a <code>lib</code> directory and have to be included on python path. The directory/files layout looks like:</p>
  
  <pre><code>.git
  docs
  lib
  my_project
      apps
      static
      templates
      __init__.py
      urls.py
      manage.py
      settings.py
      .gitmodules
  README
  </code></pre>
  
  <p>What, would you say, is the best practice for including the libs on python path? </p>
  
  <p>I am using virtualenv, so I could easily sym-link the libraries to the virtualenv's site-packages directory. However, this will tie the virtualenv to this specific project. my understanding is that the virtualenv should not depend on my files. instead, my files should depend on the virtualenv. </p>
  
  <p>I was thinking of using the same virtualenv for different local copies of this project, but if I do things this way I will lose that capability. Any better idea how to approach this?</p>
  
  <hr>
  
  <p><strong>Update:</strong> </p>
  
  <p>The best solution turned out being to let pip manage all the dependencies. </p>
  
  <p>However, this means not being able to use git submodules, as pip <a href="https://github.com/pypa/pip/issues/328" rel="nofollow">can't yet handle relative paths properly</a>. So, external dependencies will have to live on the virtualenv (typically: my_env/src/a_python_module). </p>
  
  <p>I'd still prefer to use submodules, to have some of the dependencies living on my project tree. This makes more sense to me as I've already needed to fork those repos to change some bits of them, and will likely have to change them some more in the future.</p>