You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-python/pip/files/pip-19.3.1-r2-disable-syste...

18 lines
835 B

install: Raise an error to avoid breaking python-exec
Running pip without --target, --root, or --user will result in packages
being installed systemwide. This has a tendency to break python-exec if
setuptools gets installed or upgraded.
--- pip-19.1/src/pip/_internal/commands/install.py
+++ pip-19.1/src/pip/_internal/commands/install.py
@@ -246,6 +246,9 @@ class InstallCommand(RequirementCommand):
if options.upgrade:
upgrade_strategy = options.upgrade_strategy
+ if not options.use_user_site and not options.target_dir and not options.root_path and not os.getenv('GENTOO_PIP_TESTING'):
+ raise CommandError("(Gentoo) Please run pip with the --user option to avoid breaking python-exec")
+
if options.build_dir:
options.build_dir = os.path.abspath(options.build_dir)