amrox / asdf-pyapp

A generic Python Application plugin the asdf version manager.
MIT License
60 stars 8 forks source link

asdf-pyapp fails when pip version string not in major.minor.patch format #25

Closed barlik closed 2 years ago

barlik commented 2 years ago

Describe the bug

asdf-pyapp fails to install an app with pip version 21.0

Steps to reproduce

$ python3 -m pip --version pip 21.0 from /usr/lib/python3.10/site-packages/pip (python 3.10)

$ asdf install yamllint asdf-pyapp: [ERROR] Unable to parse pip version

With shell trace:

++ local 'regex=pip (.+) from.*\(python (.+)\)'
++ [[ pip 21.0 from /usr/lib/python3.10/site-packages/pip (python 3.10) =~ pip (.+) from.*\(python (.+)\) ]]
++ echo -n 21.0
+ pip_version=21.0
+ [[ 21.0 =~ ^([0-9]+)\.([0-9]+)\. ]]
+ fail 'Unable to parse pip version'
+ echo -e 'asdf-pyapp: [ERROR] Unable to parse pip version'
asdf-pyapp: [ERROR] Unable to parse pip version

Expected behavior

asdf-pyapp working with PIP version specified in major.minor format.