Skip to content

Commit 0e29d8b

Browse files
author
Ruinong Tian
committed
Handle non-semver format package in report generation
1 parent 3191870 commit 0e29d8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/package_report.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ def _get_package_versions_in_upstream(target_packages_match_spec_out, target_ver
3232
# packages such as pytorch-gpu are present only in linux-64 sub directory
3333
match_spec_out = target_packages_match_spec_out[package]
3434
package_version = str(match_spec_out.get("version")).removeprefix("==")
35-
package_version = get_semver(package_version)
35+
try:
36+
package_version = get_semver(package_version)
37+
except ValueError:
38+
print(f"Skipping package {package} with non-semver version: {package_version}")
39+
continue
3640
channel = match_spec_out.get("channel").channel_name
3741
subdir_filter = "[subdir=" + match_spec_out.get("subdir") + "]"
3842
search_result = conda.cli.python_api.run_command(

0 commit comments

Comments
 (0)