From 84070783f81d08f6ff0ea8a0742fed7d2f23eab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Thu, 2 Jan 2020 15:42:10 +0100 Subject: [PATCH] Deprecate git+git@ form of VCS url --- docs/html/reference/pip_install.rst | 1 - src/pip/_internal/req/req_install.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/html/reference/pip_install.rst b/docs/html/reference/pip_install.rst index 2b627cbee64..cb32e3baeb8 100644 --- a/docs/html/reference/pip_install.rst +++ b/docs/html/reference/pip_install.rst @@ -409,7 +409,6 @@ Here are the supported forms:: [-e] git+ssh://git.example.com/MyProject#egg=MyProject [-e] git+git://git.example.com/MyProject#egg=MyProject [-e] git+file:///home/user/projects/MyProject#egg=MyProject - -e git+git@git.example.com:MyProject#egg=MyProject Passing a branch name, a commit hash, a tag name or a git ref is possible like so:: diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index 80f40307290..6324b932256 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -30,6 +30,7 @@ from pip._internal.operations.install.wheel import install_wheel from pip._internal.pyproject import load_pyproject_toml, make_pyproject_path from pip._internal.req.req_uninstall import UninstallPathSet +from pip._internal.utils.deprecation import deprecated from pip._internal.utils.hashes import Hashes from pip._internal.utils.logging import indent_log from pip._internal.utils.marker_files import ( @@ -633,6 +634,18 @@ def update_editable(self, obtain=True): vc_type, url = self.link.url.split('+', 1) vcs_backend = vcs.get_backend(vc_type) if vcs_backend: + if not self.link.is_vcs: + reason = ( + "This form of VCS URL is being deprecated: {}." + ).format( + self.link.url + ) + replacement = None + if self.link.url.startswith("git+git@"): + replacement = ( + "git+git:// or git+ssh://" + ) + deprecated(reason, replacement, gone_in="21.0") hidden_url = hide_url(self.link.url) if obtain: vcs_backend.obtain(self.source_dir, url=hidden_url)