Skip to content

Add the Deprecation class for pip 9.0 and remove things deprecated in 7.0 #2641

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

Merged
merged 3 commits into from
Apr 7, 2015
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
16 changes: 16 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
**7.0.0 (unreleased)**

* **BACKWARD INCOMPATIBLE** Removed the deprecated ``--mirror``,
``--use-mirrors``, and ``-M`` options.

* **BACKWARD INCOMPATIBLE** Removed the deprecated ``zip`` and ``unzip``
commands.

* **BACKWARD INCOMPATIBLE** Removed the deprecated ``--no-install`` and
``--no-download`` options.

* **BACKWARD INCOMPATIBLE** No longer implicitly support an insecure origin
origin, and instead require insecure origins be explicitly trusted with the
``--trusted-host`` option.

* **BACKWARD INCOMPATIBLE** Removed the deprecated link scraping that attempted
to parse HTML comments for a specially formatted comment.


**6.1.0 (2015-04-07)**

Expand Down
19 changes: 0 additions & 19 deletions pip/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,23 +213,6 @@ def make(self):
"If a local path or file:// url that's a directory, then look for "
"archives in the directory listing.")

# TODO: Remove after 6.0
use_mirrors = OptionMaker(
'-M', '--use-mirrors',
dest='use_mirrors',
action='store_true',
default=False,
help=SUPPRESS_HELP)

# TODO: Remove after 6.0
mirrors = OptionMaker(
'--mirrors',
dest='mirrors',
metavar='URL',
action='append',
default=[],
help=SUPPRESS_HELP)

allow_external = OptionMaker(
"--allow-external",
dest="allow_external",
Expand Down Expand Up @@ -446,8 +429,6 @@ def make(self):
extra_index_url,
no_index,
find_links,
use_mirrors,
mirrors,
allow_external,
allow_all_external,
no_allow_external,
Expand Down
6 changes: 0 additions & 6 deletions pip/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from pip.commands.show import ShowCommand
from pip.commands.install import InstallCommand
from pip.commands.uninstall import UninstallCommand
from pip.commands.unzip import UnzipCommand
from pip.commands.zip import ZipCommand
from pip.commands.wheel import WheelCommand


Expand All @@ -24,8 +22,6 @@
ShowCommand.name: ShowCommand,
InstallCommand.name: InstallCommand,
UninstallCommand.name: UninstallCommand,
UnzipCommand.name: UnzipCommand,
ZipCommand.name: ZipCommand,
ListCommand.name: ListCommand,
WheelCommand.name: WheelCommand,
}
Expand All @@ -39,8 +35,6 @@
ShowCommand,
SearchCommand,
WheelCommand,
ZipCommand,
UnzipCommand,
HelpCommand,
]

Expand Down
67 changes: 5 additions & 62 deletions pip/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import warnings

from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.locations import build_prefix, virtualenv_no_global, distutils_scheme
from pip.locations import virtualenv_no_global, distutils_scheme
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.exceptions import (
InstallationError, CommandError, PreviousBuildDirError,
)
from pip import cmdoptions
from pip.utils.build import BuildDirectory
from pip.utils.deprecation import RemovedInPip7Warning, RemovedInPip8Warning
from pip.utils.deprecation import RemovedInPip8Warning


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -101,22 +101,6 @@ def __init__(self, *args, **kw):

cmd_opts.add_option(cmdoptions.no_deps.make())

cmd_opts.add_option(
'--no-install',
dest='no_install',
action='store_true',
help="DEPRECATED. Download and unpack all packages, but don't "
"actually install them."
)

cmd_opts.add_option(
'--no-download',
dest='no_download',
action="store_true",
help="DEPRECATED. Don't download any packages, just install the "
"ones already downloaded (completes an install run with "
"--no-install).")

cmd_opts.add_option(cmdoptions.install_options.make())
cmd_opts.add_option(cmdoptions.global_options.make())

Expand Down Expand Up @@ -202,24 +186,7 @@ def _build_package_finder(self, options, index_urls, session):

def run(self, options, args):

if (
options.no_install or
options.no_download
):
warnings.warn(
"--no-install and --no-download are deprecated. "
"See https://github.com/pypa/pip/issues/906.",
RemovedInPip7Warning,
)

# If we have --no-install or --no-download and no --build we use the
# legacy static build dir
if (options.build_dir is None and
(options.no_install or options.no_download)):
options.build_dir = build_prefix

if options.download_dir:
options.no_install = True
options.ignore_installed = True

if options.build_dir:
Expand Down Expand Up @@ -254,23 +221,6 @@ def run(self, options, args):
logger.info('Ignoring indexes: %s', ','.join(index_urls))
index_urls = []

if options.use_mirrors:
warnings.warn(
"--use-mirrors has been deprecated and will be removed in the "
"future. Explicit uses of --index-url and/or --extra-index-url"
" is suggested.",
RemovedInPip7Warning,
)

if options.mirrors:
warnings.warn(
"--mirrors has been deprecated and will be removed in the "
"future. Explicit uses of --index-url and/or --extra-index-url"
" is suggested.",
RemovedInPip7Warning,
)
index_urls += options.mirrors

if options.download_cache:
warnings.warn(
"--download-cache has been deprecated and will be removed in "
Expand Down Expand Up @@ -338,14 +288,9 @@ def run(self, options, args):
return

try:
if not options.no_download:
requirement_set.prepare_files(finder)
else:
# This is the only call site of locate_files. Nuke with
# fire.
requirement_set.locate_files()
requirement_set.prepare_files(finder)

if not options.no_install:
if not options.download_dir:
requirement_set.install(
install_options,
global_options,
Expand Down Expand Up @@ -381,9 +326,7 @@ def run(self, options, args):
raise
finally:
# Clean up
if ((not options.no_clean) and
((not options.no_install) or
options.download_dir)):
if not options.no_clean:
requirement_set.cleanup_files()

if options.target_dir:
Expand Down
19 changes: 0 additions & 19 deletions pip/commands/list.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from __future__ import absolute_import

import logging
import warnings

from pip.basecommand import Command
from pip.exceptions import DistributionNotFound
from pip.index import PackageFinder
from pip.req import InstallRequirement
from pip.utils import get_installed_distributions, dist_is_editable
from pip.utils.deprecation import RemovedInPip7Warning
from pip.cmdoptions import make_option_group, index_group


Expand Down Expand Up @@ -113,23 +111,6 @@ def find_packages_latest_versions(self, options):
logger.info('Ignoring indexes: %s', ','.join(index_urls))
index_urls = []

if options.use_mirrors:
warnings.warn(
"--use-mirrors has been deprecated and will be removed in the "
"future. Explicit uses of --index-url and/or --extra-index-url"
" is suggested.",
RemovedInPip7Warning,
)

if options.mirrors:
warnings.warn(
"--mirrors has been deprecated and will be removed in the "
"future. Explicit uses of --index-url and/or --extra-index-url"
" is suggested.",
RemovedInPip7Warning,
)
index_urls += options.mirrors

dependency_links = []
for dist in get_installed_distributions(local_only=options.local,
user_only=options.user):
Expand Down
9 changes: 0 additions & 9 deletions pip/commands/unzip.py

This file was deleted.

19 changes: 1 addition & 18 deletions pip/commands/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.utils import import_or_raise, normalize_path
from pip.utils.build import BuildDirectory
from pip.utils.deprecation import RemovedInPip7Warning, RemovedInPip8Warning
from pip.utils.deprecation import RemovedInPip8Warning
from pip.wheel import WheelBuilder
from pip import cmdoptions

Expand Down Expand Up @@ -128,23 +128,6 @@ def run(self, options, args):
logger.info('Ignoring indexes: %s', ','.join(index_urls))
index_urls = []

if options.use_mirrors:
warnings.warn(
"--use-mirrors has been deprecated and will be removed in the "
"future. Explicit uses of --index-url and/or --extra-index-url"
" is suggested.",
RemovedInPip7Warning,
)

if options.mirrors:
warnings.warn(
"--mirrors has been deprecated and will be removed in the "
"future. Explicit uses of --index-url and/or --extra-index-url"
" is suggested.",
RemovedInPip7Warning,
)
index_urls += options.mirrors

if options.download_cache:
warnings.warn(
"--download-cache has been deprecated and will be removed in "
Expand Down
Loading