Skip to content

Commit

Permalink
Ignore invalid version number (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnne authored May 5, 2023
1 parent 0279570 commit e42ed76
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mamba_gator/envmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import tornado
from jupyter_client.kernelspec import KernelSpecManager

from packaging.version import parse
from packaging.version import parse, InvalidVersion

try:
import nb_conda_kernels
Expand Down Expand Up @@ -659,7 +659,13 @@ def format_packages(data: Dict) -> List:
if pkg_entry is None:
pkg_entry = entry

version = parse(entry.get("version", ""))
try:
version = parse(entry.get("version", ""))
except InvalidVersion:
name = entry.get("name")
version = entry.get("version")
self.log.warning(f"Unable to parse version '{version}' of '{name}'")
continue

if version not in versions:
versions.append(version)
Expand Down

0 comments on commit e42ed76

Please sign in to comment.