Skip to content

Commit

Permalink
update conda package string regex (#597)
Browse files Browse the repository at this point in the history
channel prefix can now be present in some versions (ex.
“bioconda::biopython-1.68-py35_0”)
  • Loading branch information
tomkinsc authored Feb 22, 2017
1 parent 8379025 commit 728da21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ def get_installed_version(self):
installed_package_string = data[0]["dist_name"]
else:
installed_package_string = data[0]
package_info_re = re.compile(r"(?P<package_name>.*)-(?P<version>.*)-(?P<build_type>.*)")
# regex to match package specs in the format bioconda::biopython-1.68-py35_0
package_info_re = re.compile(r"(?:(?P<channel>.*)::)?(?P<package_name>.*)-(?P<version>.*)-(?P<build_type>.*)")
matches = package_info_re.match(installed_package_string)
if matches:
installed_version = matches.group("version")
Expand Down

0 comments on commit 728da21

Please sign in to comment.