Skip to content

Commit

Permalink
Remove the deprecated --(no-)use-wheel flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dstufft committed Mar 20, 2017
1 parent 0b1f521 commit 95b9541
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 84 deletions.
2 changes: 2 additions & 0 deletions news/2699.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed the deprecated --(no-)use-wheel flags to ``pip install`` and
``pip wheel``.
29 changes: 1 addition & 28 deletions pip/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from pip.index import (
FormatControl, fmt_ctl_handle_mutual_exclude, fmt_ctl_no_binary,
fmt_ctl_no_use_wheel)
)
from pip.models import PyPI
from pip.locations import USER_CACHE_DIR, src_prefix
from pip.utils.hashes import STRONG_HASHES
Expand All @@ -34,12 +34,6 @@ def make_option_group(group, parser):
return option_group


def resolve_wheel_no_use_binary(options):
if not options.use_wheel:
control = options.format_control
fmt_ctl_no_use_wheel(control)


def check_install_build_global(options, check_options=None):
"""Disable wheels if per-setup.py call options are set.
Expand Down Expand Up @@ -338,27 +332,6 @@ def editable():
'The default for global installs is "<current dir>/src".'
)

# XXX: deprecated, remove in 9.0
use_wheel = partial(
Option,
'--use-wheel',
dest='use_wheel',
action='store_true',
default=True,
help=SUPPRESS_HELP,
)

# XXX: deprecated, remove in 9.0
no_use_wheel = partial(
Option,
'--no-use-wheel',
dest='use_wheel',
action='store_false',
default=True,
help=('Do not Find and prefer wheel archives when searching indexes and '
'find-links locations. DEPRECATED in favour of --no-binary.'),
)


def _get_format_control(values, option):
"""Get a format_control object."""
Expand Down
3 changes: 0 additions & 3 deletions pip/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ def __init__(self, *args, **kw):
help="Do not compile py files to pyc",
)

cmd_opts.add_option(cmdoptions.use_wheel())
cmd_opts.add_option(cmdoptions.no_use_wheel())
cmd_opts.add_option(cmdoptions.no_binary())
cmd_opts.add_option(cmdoptions.only_binary())
cmd_opts.add_option(cmdoptions.no_clean())
Expand All @@ -170,7 +168,6 @@ def __init__(self, *args, **kw):
self.parser.insert_option_group(0, cmd_opts)

def run(self, options, args):
cmdoptions.resolve_wheel_no_use_binary(options)
cmdoptions.check_install_build_global(options)

if options.build_dir:
Expand Down
3 changes: 0 additions & 3 deletions pip/commands/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def __init__(self, *args, **kw):
help=("Build wheels into <dir>, where the default is the "
"current working directory."),
)
cmd_opts.add_option(cmdoptions.use_wheel())
cmd_opts.add_option(cmdoptions.no_use_wheel())
cmd_opts.add_option(cmdoptions.no_binary())
cmd_opts.add_option(cmdoptions.only_binary())
cmd_opts.add_option(
Expand Down Expand Up @@ -122,7 +120,6 @@ def check_required_packages(self):

def run(self, options, args):
self.check_required_packages()
cmdoptions.resolve_wheel_no_use_binary(options)
cmdoptions.check_install_build_global(options)

index_urls = [options.index_url] + options.extra_index_urls
Expand Down
8 changes: 0 additions & 8 deletions pip/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,14 +1084,6 @@ def fmt_ctl_no_binary(fmt_ctl):
':all:', fmt_ctl.no_binary, fmt_ctl.only_binary)


def fmt_ctl_no_use_wheel(fmt_ctl):
fmt_ctl_no_binary(fmt_ctl)
warnings.warn(
'--no-use-wheel is deprecated and will be removed in the future. '
' Please use --no-binary :all: instead.', RemovedInPip10Warning,
stacklevel=2)


Search = namedtuple('Search', 'supplied canonical formats')
"""Capture key aspects of a search.
Expand Down
5 changes: 0 additions & 5 deletions pip/req/req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
cmdoptions.index_url,
cmdoptions.find_links,
cmdoptions.extra_index_url,
cmdoptions.use_wheel,
cmdoptions.no_use_wheel,
cmdoptions.always_unzip,
cmdoptions.no_binary,
cmdoptions.only_binary,
Expand Down Expand Up @@ -193,9 +191,6 @@ def process_line(line, filename, line_number, finder=None, comes_from=None,
elif finder:
if opts.index_url:
finder.index_urls = [opts.index_url]
if opts.use_wheel is False:
finder.use_wheel = False
pip.index.fmt_ctl_no_use_wheel(finder.format_control)
if opts.no_index is True:
finder.index_urls = []
if opts.extra_index_urls:
Expand Down
18 changes: 0 additions & 18 deletions tests/functional/test_install_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,24 +222,6 @@ def test_wheel_user_with_prefix_in_pydistutils_cfg(script, data, virtualenv):
assert 'installed requiresupper' in result.stdout


def test_nowheel_user_with_prefix_in_pydistutils_cfg(script, data, virtualenv):
virtualenv.system_site_packages = True
homedir = script.environ["HOME"]
script.scratch_path.join("bin").mkdir()
with open(os.path.join(homedir, ".pydistutils.cfg"), "w") as cfg:
cfg.write(textwrap.dedent("""
[install]
prefix=%s""" % script.scratch_path))

result = script.pip('install', '--no-use-wheel', '--user', '--no-index',
'-f', data.find_links, 'requiresupper',
expect_stderr=True)
assert 'installed requiresupper' in result.stdout
assert ('DEPRECATION: --no-use-wheel is deprecated and will be removed '
'in the future. Please use --no-binary :all: instead.\n'
) in result.stderr


def test_install_option_in_requirements_file(script, data, virtualenv):
"""
Test --install-option in requirements file overrides same option in cli
Expand Down
9 changes: 0 additions & 9 deletions tests/unit/test_cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,13 @@ class SimpleCommand(Command):

def __init__(self):
super(SimpleCommand, self).__init__()
self.cmd_opts.add_option(cmdoptions.no_use_wheel())
self.cmd_opts.add_option(cmdoptions.no_binary())
self.cmd_opts.add_option(cmdoptions.only_binary())

def run(self, options, args):
cmdoptions.resolve_wheel_no_use_binary(options)
self.options = options


def test_no_use_wheel_sets_no_binary_all():
cmd = SimpleCommand()
cmd.main(['fake', '--no-use-wheel'])
expected = pip.index.FormatControl(set([':all:']), set([]))
assert cmd.options.format_control == expected


def test_no_binary_overrides():
cmd = SimpleCommand()
cmd.main(['fake', '--only-binary=:all:', '--no-binary=fred'])
Expand Down
10 changes: 0 additions & 10 deletions tests/unit/test_req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,6 @@ def test_set_finder_extra_index_urls(self, finder):
list(process_line("--extra-index-url=url", "file", 1, finder=finder))
assert finder.index_urls == ['url']

def test_set_finder_use_wheel(self, finder):
list(process_line("--use-wheel", "file", 1, finder=finder))
no_use_wheel_fmt = pip.index.FormatControl(set(), set())
assert finder.format_control == no_use_wheel_fmt

def test_set_finder_no_use_wheel(self, finder):
list(process_line("--no-use-wheel", "file", 1, finder=finder))
no_use_wheel_fmt = pip.index.FormatControl(set([':all:']), set())
assert finder.format_control == no_use_wheel_fmt

def test_set_finder_trusted_host(self, finder):
list(process_line("--trusted-host=url", "file", 1, finder=finder))
assert finder.secure_origins == [('*', 'url', '*')]
Expand Down

0 comments on commit 95b9541

Please sign in to comment.