diff --git a/CHANGES.txt b/CHANGES.txt index 6bed771063f..f96bbc08e88 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,10 @@ **8.2.0 (unreleased)** +* **DEPRECATION** ``pip install --egg`` have been deprecated and will be + removed in the future. This "feature" has a long list of drawbacks where it + breaks almost all of pip's other features in subtle and hard to diagnose + ways. + * Added Appveyor CI * Uninstall existing packages when performing an editable installation of diff --git a/pip/commands/install.py b/pip/commands/install.py index 28d30c59f7b..af577c673d1 100644 --- a/pip/commands/install.py +++ b/pip/commands/install.py @@ -179,6 +179,15 @@ def run(self, options, args): cmdoptions.resolve_wheel_no_use_binary(options) cmdoptions.check_install_build_global(options) + if options.as_egg: + warnings.warn( + "--egg has been deprecated and will be removed in the future. " + "This flag is mutually exclusive with large parts of pip, and " + "actually using it invalidates pip's ability to manage the " + "installation process.", + RemovedInPip10Warning, + ) + if options.allow_external: warnings.warn( "--allow-external has been deprecated and will be removed in " diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py index dd4f7ea6639..e7988fd601c 100644 --- a/tests/functional/test_install.py +++ b/tests/functional/test_install.py @@ -397,7 +397,7 @@ def test_install_as_egg(script, data): Test installing as egg, instead of flat install. """ to_install = data.packages.join("FSPkg") - result = script.pip('install', to_install, '--egg', expect_error=False) + result = script.pip('install', to_install, '--egg', expect_error=True) fspkg_folder = script.site_packages / 'fspkg' egg_folder = script.site_packages / 'FSPkg-0.1.dev0-py%s.egg' % pyversion assert fspkg_folder not in result.files_created, str(result.stdout) diff --git a/tests/functional/test_uninstall.py b/tests/functional/test_uninstall.py index a41881e9994..6fe43b5fa24 100644 --- a/tests/functional/test_uninstall.py +++ b/tests/functional/test_uninstall.py @@ -341,7 +341,7 @@ def test_uninstall_as_egg(script, data): Test uninstall package installed as egg. """ to_install = data.packages.join("FSPkg") - result = script.pip('install', to_install, '--egg', expect_error=False) + result = script.pip('install', to_install, '--egg', expect_error=True) fspkg_folder = script.site_packages / 'fspkg' egg_folder = script.site_packages / 'FSPkg-0.1.dev0-py%s.egg' % pyversion assert fspkg_folder not in result.files_created, str(result.stdout)