Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Python3 fixes#92

Merged
jmchilton merged 2 commits intogalaxyproject:masterfrom
nsoranzo:python3_fixes
Feb 26, 2018
Merged

Python3 fixes#92
jmchilton merged 2 commits intogalaxyproject:masterfrom
nsoranzo:python3_fixes

Conversation

@nsoranzo
Copy link
Copy Markdown
Member

@nsoranzo nsoranzo commented Feb 26, 2018

Fix `planemo lint --conda_requirements`, see the following test
traceback:
```
======================================================================
FAIL: test_lint_dependencies_okay (tests.test_lint.LintTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/galaxyproject/planemo/tests/test_lint.py", line 101, in test_lint_dependencies_okay
    self._check_exit_code(lint_cmd)
  File "/home/travis/build/galaxyproject/planemo/tests/test_utils.py", line 100, in _check_exit_code
    raise AssertionError(message)
nose.proxy.AssertionError: Planemo command [lint --conda_requirements /home/travis/build/galaxyproject/planemo/tests/../project_templates/seqtk_complete/seqtk_seq.xml] resulted in unexpected exit code [-1], expected exit code [0]]. Command output [Linting tool /home/travis/build/galaxyproject/planemo/project_templates/seqtk_complete/seqtk_seq.xml
...
Traceback (most recent call last):
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/click/testing.py", line 279, in invoke
    prog_name=self.get_default_prog_name(cli), **extra)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/travis/build/galaxyproject/planemo/planemo/cli.py", line 177, in handle_blended_options
    return f(*args, **kwds)
  File "/home/travis/build/galaxyproject/planemo/planemo/commands/cmd_lint.py", line 58, in cli
    recursive=kwds["recursive"]
  File "/home/travis/build/galaxyproject/planemo/planemo/tool_lint.py", line 31, in lint_tools_on_path
    if not lint_tool_source(tool_xml, **lint_args):
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/galaxy/tools/lint.py", line 17, in lint_tool_source
    lint_tool_source_with(lint_context, tool_source, extra_modules)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/galaxy/tools/lint.py", line 53, in lint_tool_source_with
    lint_context.lint(name, value, tool_source)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/galaxy/tools/lint.py", line 81, in lint
    lint_func(lint_target, self)
  File "/home/travis/build/galaxyproject/planemo/planemo/linters/conda_requirements.py", line 18, in lint_requirements_in_conda
    (best_hit, exact) = best_practice_search(conda_target)
  File "/home/travis/build/galaxyproject/planemo/planemo/conda.py", line 155, in best_practice_search
    return conda_util.best_search_result(conda_target, conda_context=conda_context, channels_override=BEST_PRACTICE_CHANNELS, offline=offline)
  File "/home/travis/build/galaxyproject/planemo/.tox/py34/lib/python3.4/site-packages/galaxy/tools/deps/conda_util.py", line 462, in best_search_result
    hits = json.loads(res).get(conda_target.package, [])
  File "/usr/lib/python3.4/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
```
@jmchilton jmchilton merged commit d24b871 into galaxyproject:master Feb 26, 2018
@jmchilton
Copy link
Copy Markdown
Member

Thanks a million, you are awesome! I've published 18.1.0 that includes this to help with galaxyproject/planemo#774.

@nsoranzo nsoranzo deleted the python3_fixes branch February 26, 2018 19:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants