Skip to content

Commit 0df3738

Browse files
vshulczoz123
authored andcommitted
refactor: use VCS_SCHEMES constant in unpack_url
1 parent 30930e0 commit 0df3738

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

pipenv/utils/requirementslib.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
SCHEME_LIST = ("http://", "https://", "ftp://", "ftps://", "file://")
3434

3535

36-
VCS_SCHEMES = [
36+
VCS_SCHEMES = {
3737
"git",
3838
"git+http",
3939
"git+https",
@@ -57,7 +57,7 @@
5757
"bzr+sftp",
5858
"bzr+ftp",
5959
"bzr+lp",
60-
]
60+
}
6161

6262

6363
def strip_ssh_from_git_uri(uri):
@@ -550,8 +550,7 @@ def remap(
550550
except TypeError:
551551
# TODO: handle False?
552552
raise TypeError(
553-
"enter should return a tuple of (new_parent,"
554-
f" items_iterator), not: {res!r}"
553+
f"enter should return a tuple of (new_parent, items_iterator), not: {res!r}"
555554
)
556555
if new_items is not False:
557556
# traverse unless False is explicitly passed
@@ -655,24 +654,7 @@ def unpack_url(
655654
would ordinarily raise HashUnsupported) are allowed.
656655
"""
657656
# non-editable vcs urls
658-
if link.scheme in {
659-
"git+http",
660-
"git+https",
661-
"git+ssh",
662-
"git+git",
663-
"hg+http",
664-
"hg+https",
665-
"hg+ssh",
666-
"svn+http",
667-
"svn+https",
668-
"svn+svn",
669-
"bzr+http",
670-
"bzr+https",
671-
"bzr+ssh",
672-
"bzr+sftp",
673-
"bzr+ftp",
674-
"bzr+lp",
675-
}:
657+
if link.scheme in VCS_SCHEMES:
676658
unpack_vcs_link(link, location, verbosity=verbosity)
677659
return File(location, content_type=None)
678660

0 commit comments

Comments
 (0)