Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't crash autoupdate on non-PEP440-compliant tool versions
Fix errors like: ``` File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/planemo/commands/cmd_autoupdate.py", line 120, in cli tools_to_update = autoupdate.get_tools_to_update(ctx, workflow, tools_to_skip) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/planemo/autoupdate.py", line 363, in get_tools_to_update return outdated_tools(ctx, wf_dict, ts, tools_to_skip) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/planemo/autoupdate.py", line 349, in outdated_tools outdated_tools_rec(wf_dict) File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/planemo/autoupdate.py", line 337, in outdated_tools_rec outdated_tool_dict.update(check_tool_step(tool_id)) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/planemo/autoupdate.py", line 324, in check_tool_step updated_tool_id = get_newest_tool_id(matching_tool_ids) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/planemo/autoupdate.py", line 290, in get_newest_tool_id return sorted( ^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/planemo/autoupdate.py", line 292, in <lambda> key=lambda n: packaging.version.parse(n.split("/")[-1]), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/packaging/version.py", line 54, in parse return Version(version) ^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/site-packages/packaging/version.py", line 200, in __init__ raise InvalidVersion(f"Invalid version: '{version}'") packaging.version.InvalidVersion: Invalid version: '0.8.1+galaxy0+galaxy0' ``` by replacing an invalid version with version "0".
- Loading branch information