Don't crash autoupdate on non-PEP440-compliant tool versions#1422
Merged
nsoranzo merged 1 commit intogalaxyproject:masterfrom Jan 11, 2024
Merged
Don't crash autoupdate on non-PEP440-compliant tool versions#1422nsoranzo merged 1 commit intogalaxyproject:masterfrom
nsoranzo merged 1 commit intogalaxyproject:masterfrom
Conversation
mvdbeek
reviewed
Jan 8, 2024
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'
```
seen e.g. in https://github.com/planemo-autoupdate/autoupdate/actions/runs/7443075417/job/20247438333 .
84f5137 to
28ed426
Compare
mvdbeek
approved these changes
Jan 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix errors like:
seen e.g. in https://github.com/planemo-autoupdate/autoupdate/actions/runs/7443075417/job/20247438333 by using
parse_versionfromgalaxy.tool_util.version.