Commit 7e501f6
committed
LazyToolBox: use packaging.version for get_all_versions sort
The custom sort key in 75f9a52 — ``tuple(int(p) if p.isdigit() else p ...)`` —
mixed ``int`` and ``str`` segments and crashed on tool versions like
``1.0.0+galaxy0`` with ``TypeError: '<' not supported between instances
of 'str' and 'int'``. Two API tests on shard 0 (``test_test_by_versions``)
and shard 1 (``test_job_build_for_rerun_switch_version``) hit the bug
through ``Tool._compare_tool_version`` -> ``get_tool(get_all_versions=True)``
and surfaced as 500 / 400 to the API caller.
Switch to ``packaging.version.parse`` (what the eager ``ToolLineage`` uses
under SortedSet) and bucket unparseable versions to a string-fallback so
the sort still completes if one entry is malformed.1 parent 75f9a52 commit 7e501f6
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1140 | 1140 | | |
1141 | 1141 | | |
1142 | 1142 | | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
1143 | 1154 | | |
1144 | 1155 | | |
1145 | | - | |
| 1156 | + | |
1146 | 1157 | | |
1147 | 1158 | | |
1148 | 1159 | | |
| |||
0 commit comments