title: pip3 setup.py install_requires PEP 508 git URL for private repo
body: <p>I am trying to run:</p>
  
  <p><code>pip3 install -e .</code></p>
  
  <p>in my Python project where I have the following <code>setup.py</code>:</p>
  
  <pre><code>from setuptools import setup
  
  setup(
      name='mypackage',
      install_requires=[
          "anotherpackage@git+git@bitbucket.org:myorg/anotherpackage.git"
      ]
  )
  </code></pre>
  
  <p>but it fails with:</p>
  
  <pre><code>error in mypackage setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid URL given
  </code></pre>
  
  <p>I guess it is correct about the format of my URL as <a href="https://www.python.org/dev/peps/pep-0508/#id26" rel="noreferrer">PEP 508</a> doesn't allow specifying git user name for ssh clone URLs.</p>
  
  <p>What is the correct syntax for PEP 508 URLs with git+ssh protocol for <code>install_requires</code> dependency for private git repositories (in this case hosted on BitBucket)? What is the syntax for specifying a specific branch, tag or sha?</p>
  
  <h2>More context to avoid XY problem</h2>
  
  <p>I have an internal Python project that depends on multiple internally developed Python packages. I would like to avoid the necessity for hosting my own PIP repository in the organisation and thus I am trying to use git URLs directly. I need to use ssh protocol for git URLs as all the users have their ssh keys configured and it would be cumbersome to ask all the users to configure their app passwords in BitBuckets (I have 2FA required and the regular user password doesn't work).</p>
  
  <p>I have already tried to use:</p>
  
  <h3><code>dependency_links</code></h3>
  
  <pre><code>setup(
      name='mypackage',
      install_requires=[
          "anotherpackage==0.0.1"
      ],
      dependency_links=[
          "git+git@bitbucket.org:myorg/anotherpackage.git@0.0.1#egg=anotherpackage-0.0.1"
      ]
  )
  </code></pre>
  
  <p>But they are deprecated and they are ignored by <code>pip3 install -e .</code>. According to documentation I've found, PEP 508 URLs should be used instead.</p>
  
  <h3><code>requirements.txt</code> file with entries duplicated from <code>install_requires</code> entries</h3>
  
  <p>I have a <code>requirements.txt</code> file with:</p>
  
  <pre><code>-e git+git@bitbucket.org:myorg/anotherpackage.git@0.0.1#egg=anotherpackage
  </code></pre>
  
  <p>and I use <code>pip3 install -r requirements.txt</code> instead of <code>pip3 install -e .</code>. It works but is suboptimal as I have to keep both <code>setyp.py</code> and <code>requirements.txt</code> in sync.</p>
  
  <p>If there is any other recommended solution for my problem I would like to learn about it :)</p>