Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate git+git@ form of VCS requirements #7543

Merged
merged 3 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/html/reference/pip_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]:MyProject#egg=MyProject

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

Expand Down
4 changes: 4 additions & 0 deletions news/7543.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Support for the ``git+git@`` form of VCS requirement is being deprecated and
will be removed in pip 21.0. Switch to ``git+https://`` or
``git+ssh://``. ``git+git://`` also works but its use is discouraged as it is
insecure.
15 changes: 15 additions & 0 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -633,6 +634,20 @@ 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 requirement is being deprecated: {}."
).format(
self.link.url
)
replacement = None
if self.link.url.startswith("git+git@"):
replacement = (
"git+https://[email protected]/..., "
"git+ssh://[email protected]/..., "
"or the insecure git+git://[email protected]/..."
)
chrahunt marked this conversation as resolved.
Show resolved Hide resolved
deprecated(reason, replacement, gone_in="21.0", issue=7554)
hidden_url = hide_url(self.link.url)
if obtain:
vcs_backend.obtain(self.source_dir, url=hidden_url)
Expand Down