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

Add pip.main as func raising clean error #5254

Closed
wants to merge 1 commit into from
Closed
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 src/pip/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
__version__ = "10.0.0"


def main(*args, **kwargs):
"""
This is an importable main func.
Its only purpose is to raise a clean error for users who call `pip.main()`
-- a usage which was never supported.
"""
raise RuntimeError(
"pip.main() is unsupported and should not be used. "
"If you want to invoke pip from within your program, see the "
"documentation here: "
"https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program"
"\n"
"You may find that pip.main() works on pip<10, but pip cannot and "
"does not support or condone such usage.")