Skip to content

Commit

Permalink
Allow user to pass minimum supported pip version to the function as an
Browse files Browse the repository at this point in the history
argument.
  • Loading branch information
Kami committed Jun 28, 2018
1 parent f9455e2 commit 8c6659c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand Down

0 comments on commit 8c6659c

Please sign in to comment.