Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Add get_pkg_name().
  • Loading branch information
ericsnowcurrently committed Mar 28, 2022
commit abf70c24b1782f0c3ed1e2045db4df4c172b594d
10 changes: 10 additions & 0 deletions pyperformance/_pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
OLD_SETUPTOOLS = '18.5'


def get_pkg_name(req):
"""Return the name of the package in the given requirement text."""
# strip env markers
req = req.partition(';')[0]
# strip version
req = req.partition('==')[0]
req = req.partition('>=')[0]
return req


def get_best_pip_version(python):
"""Return the pip to install for the given Python executable."""
if not python or isinstance(python, str):
Expand Down