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

Remove deprecated --find-links option from pip freeze #10158

Merged
merged 1 commit into from
Jul 13, 2021
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: 1 addition & 0 deletions news/9069.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove deprecated ``--find-links`` option in ``pip freeze``
18 changes: 0 additions & 18 deletions src/pip/_internal/commands/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.operations.freeze import freeze
from pip._internal.utils.compat import stdlib_pkgs
from pip._internal.utils.deprecation import deprecated

DEV_PKGS = {'pip', 'setuptools', 'distribute', 'wheel'}

Expand All @@ -34,14 +33,6 @@ def add_options(self):
help="Use the order in the given requirements file and its "
"comments when generating output. This option can be "
"used multiple times.")
self.cmd_opts.add_option(
'-f', '--find-links',
dest='find_links',
action='append',
default=[],
metavar='URL',
help='URL for finding packages, which will be added to the '
'output.')
self.cmd_opts.add_option(
'-l', '--local',
dest='local',
Expand Down Expand Up @@ -82,17 +73,8 @@ def run(self, options, args):

cmdoptions.check_list_path_option(options)

if options.find_links:
deprecated(
"--find-links option in pip freeze is deprecated.",
replacement=None,
gone_in="21.2",
issue=9069,
)

for line in freeze(
requirement=options.requirements,
find_links=options.find_links,
local_only=options.local,
user_only=options.user,
paths=options.path,
Expand Down
5 changes: 0 additions & 5 deletions src/pip/_internal/operations/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

def freeze(
requirement=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
local_only=False, # type: bool
user_only=False, # type: bool
paths=None, # type: Optional[List[str]]
Expand All @@ -44,10 +43,6 @@ def freeze(
skip=() # type: Container[str]
):
# type: (...) -> Iterator[str]
find_links = find_links or []

for link in find_links:
yield f'-f {link}'
installations = {} # type: Dict[str, FrozenRequirement]

for dist in get_installed_distributions(
Expand Down
63 changes: 0 additions & 63 deletions tests/functional/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,19 +270,6 @@ def test_freeze_git_clone(script, tmpdir):
).strip()
_check_output(result.stdout, expected)

result = script.pip(
'freeze', '-f', f'{repo_dir}#egg=pip_test_package',
expect_stderr=True,
)
expected = textwrap.dedent(
"""
-f {repo}#egg=pip_test_package...
-e git+...#egg=version_pkg
...
""".format(repo=repo_dir),
).strip()
_check_output(result.stdout, expected)

# Check that slashes in branch or tag names are translated.
# See also issue #1083: https://github.com/pypa/pip/issues/1083
script.run(
Expand Down Expand Up @@ -335,19 +322,6 @@ def test_freeze_git_clone_srcdir(script, tmpdir):
).strip()
_check_output(result.stdout, expected)

result = script.pip(
'freeze', '-f', f'{repo_dir}#egg=pip_test_package',
expect_stderr=True,
)
expected = textwrap.dedent(
"""
-f {repo}#egg=pip_test_package...
-e git+...#egg=version_pkg&subdirectory=subdir
...
""".format(repo=repo_dir),
).strip()
_check_output(result.stdout, expected)


@need_mercurial
def test_freeze_mercurial_clone_srcdir(script, tmpdir):
Expand Down Expand Up @@ -376,19 +350,6 @@ def test_freeze_mercurial_clone_srcdir(script, tmpdir):
).strip()
_check_output(result.stdout, expected)

result = script.pip(
'freeze', '-f', f'{repo_dir}#egg=pip_test_package',
expect_stderr=True,
)
expected = textwrap.dedent(
"""
-f {repo}#egg=pip_test_package...
-e hg+...#egg=version_pkg&subdirectory=subdir
...
""".format(repo=repo_dir),
).strip()
_check_output(result.stdout, expected)


@pytest.mark.git
def test_freeze_git_remote(script, tmpdir):
Expand Down Expand Up @@ -482,19 +443,6 @@ def test_freeze_mercurial_clone(script, tmpdir):
).strip()
_check_output(result.stdout, expected)

result = script.pip(
'freeze', '-f', f'{repo_dir}#egg=pip_test_package',
expect_stderr=True,
)
expected = textwrap.dedent(
"""
-f {repo}#egg=pip_test_package...
...-e hg+...#egg=version_pkg
...
""".format(repo=repo_dir),
).strip()
_check_output(result.stdout, expected)


@need_bzr
def test_freeze_bazaar_clone(script, tmpdir):
Expand All @@ -521,17 +469,6 @@ def test_freeze_bazaar_clone(script, tmpdir):
...""")
_check_output(result.stdout, expected)

result = script.pip(
'freeze', '-f',
f'{checkout_path}/#egg=django-wikiapp',
expect_stderr=True,
)
expected = textwrap.dedent("""\
-f {repo}/#egg=django-wikiapp
...-e bzr+file://...@...#egg=version_pkg
...""".format(repo=checkout_path))
_check_output(result.stdout, expected)


@need_mercurial
@pytest.mark.git
Expand Down