Skip to content
Open
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
6 changes: 5 additions & 1 deletion libpip2pi/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def try_int(x):


if pip_version:
if pip_version >= (10, 0, 0):
if pip_version >= (19, 3, 1):
from pip._internal.main import main as pip_main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought, that as pip user guide suggests to use pip program and the pip program is defined in entry points in setup.py, would getting that entry point to be a version independent way to find main function. Could something like this work:

Suggested change
from pip._internal.main import main as pip_main
pip_main = pkg_resources.load_entry_point('pip', 'console_scripts', 'pip')

pip_download_command = 'download --dest'
pip_no_binary_command = '--no-binary=:all:'
elif pip_version >= (10, 0, 0):
from pip._internal import main as pip_main
pip_download_command = 'download --dest'
pip_no_binary_command = '--no-binary=:all:'
Expand Down