mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Default to allowing unsafe urls and allow disabling them via option
This commit is contained in:
parent
cc46cdc8b3
commit
2731f06474
|
@ -85,8 +85,15 @@ allow_unsafe = make_option(
|
|||
action="append",
|
||||
default=[],
|
||||
metavar="PACKAGE",
|
||||
help="Allow the installation of unsafe and unverifiable files for a "
|
||||
"package",
|
||||
help="Allow the installation of unsafe and unverifiable files",
|
||||
)
|
||||
|
||||
no_allow_unsafe = make_option(
|
||||
"--no-allow-unsafe",
|
||||
dest="allow_all_unsafe",
|
||||
action="store_false",
|
||||
default=True,
|
||||
help="Disallow the installation of unsafe and unverifiable files"
|
||||
)
|
||||
|
||||
requirements = make_option(
|
||||
|
@ -168,5 +175,6 @@ index_group = {
|
|||
allow_external,
|
||||
no_allow_external,
|
||||
allow_unsafe,
|
||||
no_allow_unsafe,
|
||||
]
|
||||
}
|
||||
|
|
|
@ -165,6 +165,7 @@ class InstallCommand(Command):
|
|||
use_wheel=options.use_wheel,
|
||||
allow_external=options.allow_external,
|
||||
allow_unsafe=options.allow_unsafe,
|
||||
allow_all_unsafe=options.allow_all_unsafe,
|
||||
)
|
||||
|
||||
def run(self, options, args):
|
||||
|
|
|
@ -48,7 +48,8 @@ class PackageFinder(object):
|
|||
|
||||
def __init__(self, find_links, index_urls,
|
||||
use_mirrors=False, mirrors=None, main_mirror_url=None,
|
||||
use_wheel=False, allow_external=False, allow_unsafe=[]):
|
||||
use_wheel=False, allow_external=False, allow_unsafe=[],
|
||||
allow_all_unsafe=False):
|
||||
self.find_links = find_links
|
||||
self.index_urls = index_urls
|
||||
self.dependency_links = []
|
||||
|
@ -69,7 +70,7 @@ class PackageFinder(object):
|
|||
self.allow_unsafe = set(normalize_name(n) for n in allow_unsafe)
|
||||
|
||||
# Do we allow unsafe and unverifiable files?
|
||||
self.allow_all_unsafe = False
|
||||
self.allow_all_unsafe = allow_all_unsafe
|
||||
|
||||
# Stores if we ignored any external links so that we can instruct
|
||||
# end users how to install them if no distributions are available
|
||||
|
|
Loading…
Reference in a new issue