Skip to content

Commit eeeecbe

Browse files
authored
Merge pull request #7543 from sbidoul/deprecate-gitgitarobase-sbi
Deprecate git+git@ form of VCS requirements
2 parents 9c64c82 + 9cbe7f9 commit eeeecbe

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

docs/html/reference/pip_install.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ Here are the supported forms::
409409
[-e] git+ssh://git.example.com/MyProject#egg=MyProject
410410
[-e] git+git://git.example.com/MyProject#egg=MyProject
411411
[-e] git+file:///home/user/projects/MyProject#egg=MyProject
412-
-e [email protected]:MyProject#egg=MyProject
413412

414413
Passing a branch name, a commit hash, a tag name or a git ref is possible like so::
415414

news/7543.removal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Support for the ``git+git@`` form of VCS requirement is being deprecated and
2+
will be removed in pip 21.0. Switch to ``git+https://`` or
3+
``git+ssh://``. ``git+git://`` also works but its use is discouraged as it is
4+
insecure.

src/pip/_internal/req/req_install.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from pip._internal.operations.install.wheel import install_wheel
3131
from pip._internal.pyproject import load_pyproject_toml, make_pyproject_path
3232
from pip._internal.req.req_uninstall import UninstallPathSet
33+
from pip._internal.utils.deprecation import deprecated
3334
from pip._internal.utils.hashes import Hashes
3435
from pip._internal.utils.logging import indent_log
3536
from pip._internal.utils.marker_files import (
@@ -633,6 +634,20 @@ def update_editable(self, obtain=True):
633634
vc_type, url = self.link.url.split('+', 1)
634635
vcs_backend = vcs.get_backend(vc_type)
635636
if vcs_backend:
637+
if not self.link.is_vcs:
638+
reason = (
639+
"This form of VCS requirement is being deprecated: {}."
640+
).format(
641+
self.link.url
642+
)
643+
replacement = None
644+
if self.link.url.startswith("git+git@"):
645+
replacement = (
646+
"git+https://[email protected]/..., "
647+
"git+ssh://[email protected]/..., "
648+
"or the insecure git+git://[email protected]/..."
649+
)
650+
deprecated(reason, replacement, gone_in="21.0", issue=7554)
636651
hidden_url = hide_url(self.link.url)
637652
if obtain:
638653
vcs_backend.obtain(self.source_dir, url=hidden_url)

0 commit comments

Comments
 (0)