entrypoints.py 1.0 KB

123456789101112131415161718192021222324252627
  1. import sys
  2. from typing import List, Optional
  3. from pip._internal.cli.main import main
  4. def _wrapper(args: Optional[List[str]] = None) -> int:
  5. """Central wrapper for all old entrypoints.
  6. Historically pip has had several entrypoints defined. Because of issues
  7. arising from PATH, sys.path, multiple Pythons, their interactions, and most
  8. of them having a pip installed, users suffer every time an entrypoint gets
  9. moved.
  10. To alleviate this pain, and provide a mechanism for warning users and
  11. directing them to an appropriate place for help, we now define all of
  12. our old entrypoints as wrappers for the current one.
  13. """
  14. sys.stderr.write(
  15. "WARNING: pip is being invoked by an old script wrapper. This will "
  16. "fail in a future version of pip.\n"
  17. "Please see https://github.com/pypa/pip/issues/5599 for advice on "
  18. "fixing the underlying issue.\n"
  19. "To avoid this problem you can invoke Python with '-m pip' instead of "
  20. "running pip directly.\n"
  21. )
  22. return main(args)