Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.01] Replace distutils.version with packaging.version #5588

Merged
merged 1 commit into from Feb 22, 2018

Conversation

Projects
None yet
4 participants
@jmchilton
Copy link
Member

jmchilton commented Feb 22, 2018

This is a backport from dev because this seems to fix the tool lineage for deployed freebayes versions.

distutils under Python3 has this bug:

https://bugs.python.org/issue14894

which causes this traceback:

Traceback (most recent call last):
  File "lib/galaxy/webapps/galaxy/buildapp.py", line 49, in app_factory
    app = galaxy.app.UniverseApplication(global_conf=global_conf, **kwargs)
  File "lib/galaxy/app.py", line 125, in __init__
    self._configure_toolbox()
  File "lib/galaxy/config.py", line 930, in _configure_toolbox
    self.toolbox = tools.ToolBox(tool_configs, self.config.tool_path, self)
  File "lib/galaxy/tools/__init__.py", line 232, in __init__
    app=app,
  File "lib/galaxy/tools/toolbox/base.py", line 1056, in __init__
    super(BaseGalaxyToolBox, self).__init__(config_filenames, tool_root_dir, app)
  File "lib/galaxy/tools/toolbox/base.py", line 84, in __init__
    self._load_tool_panel()
  File "lib/galaxy/tools/toolbox/base.py", line 358, in _load_tool_panel
    self.__add_tool_to_tool_panel(section_val, section, section=True)
  File "lib/galaxy/tools/toolbox/base.py", line 278, in __add_tool_to_tool_panel
    related_tool = self._lineage_in_panel(panel_dict, tool=tool)
  File "lib/galaxy/tools/toolbox/base.py", line 961, in _lineage_in_panel
    lineage_tool_versions = reversed(tool_lineage.get_versions())
  File "lib/galaxy/tools/toolbox/lineages/interface.py", line 77, in get_versions
    return [ToolLineageVersion(tool_id, tool_version) for tool_id, tool_version in zip(self.tool_ids, self.tool_versions)]
  File "lib/galaxy/tools/toolbox/lineages/interface.py", line 55, in tool_ids
    return ["%s/%s" % (tool_id, version) for version in self.tool_versions]
  File "lib/galaxy/tools/toolbox/lineages/interface.py", line 49, in tool_versions
    return sorted(self._tool_versions, key=LooseVersion)
  File "/usr/lib/python3.4/distutils/version.py", line 58, in __lt__
    c = self._cmp(other)
  File "/usr/lib/python3.4/distutils/version.py", line 343, in _cmp
    if self.version < other.version:
TypeError: unorderable types: str() < int()

when a tool version contains a letter in the "wrong" place (e.g. in the first position).

Fix #5408 .

Replace distutils.version with packaging.version
distutils under Python3 has this bug:

https://bugs.python.org/issue14894

which causes this traceback:

```
Traceback (most recent call last):
  File "lib/galaxy/webapps/galaxy/buildapp.py", line 49, in app_factory
    app = galaxy.app.UniverseApplication(global_conf=global_conf, **kwargs)
  File "lib/galaxy/app.py", line 125, in __init__
    self._configure_toolbox()
  File "lib/galaxy/config.py", line 930, in _configure_toolbox
    self.toolbox = tools.ToolBox(tool_configs, self.config.tool_path, self)
  File "lib/galaxy/tools/__init__.py", line 232, in __init__
    app=app,
  File "lib/galaxy/tools/toolbox/base.py", line 1056, in __init__
    super(BaseGalaxyToolBox, self).__init__(config_filenames, tool_root_dir, app)
  File "lib/galaxy/tools/toolbox/base.py", line 84, in __init__
    self._load_tool_panel()
  File "lib/galaxy/tools/toolbox/base.py", line 358, in _load_tool_panel
    self.__add_tool_to_tool_panel(section_val, section, section=True)
  File "lib/galaxy/tools/toolbox/base.py", line 278, in __add_tool_to_tool_panel
    related_tool = self._lineage_in_panel(panel_dict, tool=tool)
  File "lib/galaxy/tools/toolbox/base.py", line 961, in _lineage_in_panel
    lineage_tool_versions = reversed(tool_lineage.get_versions())
  File "lib/galaxy/tools/toolbox/lineages/interface.py", line 77, in get_versions
    return [ToolLineageVersion(tool_id, tool_version) for tool_id, tool_version in zip(self.tool_ids, self.tool_versions)]
  File "lib/galaxy/tools/toolbox/lineages/interface.py", line 55, in tool_ids
    return ["%s/%s" % (tool_id, version) for version in self.tool_versions]
  File "lib/galaxy/tools/toolbox/lineages/interface.py", line 49, in tool_versions
    return sorted(self._tool_versions, key=LooseVersion)
  File "/usr/lib/python3.4/distutils/version.py", line 58, in __lt__
    c = self._cmp(other)
  File "/usr/lib/python3.4/distutils/version.py", line 343, in _cmp
    if self.version < other.version:
TypeError: unorderable types: str() < int()
```

when a tool version contains a letter in the "wrong" place (e.g. in the first position).

Fix #5408 .

@martenson martenson merged commit fc52fe5 into galaxyproject:release_18.01 Feb 22, 2018

6 checks passed

api test Build finished. 351 tests run, 4 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 171 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 79 tests run, 4 skipped, 0 failed.
Details
selenium test Build finished. 118 tests run, 2 skipped, 0 failed.
Details
toolshed test Build finished. 577 tests run, 0 skipped, 0 failed.
Details

@martenson martenson added this to the 18.01 milestone Feb 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.