Skip to content

Commit

Permalink
Merge pull request #550 from jmchilton/import_order_fixes
Browse files Browse the repository at this point in the history
Fix import order throughout project.
  • Loading branch information
jmchilton authored Aug 27, 2016
2 parents bb1fff2 + f0ab46a commit e1f2284
Show file tree
Hide file tree
Showing 74 changed files with 283 additions and 245 deletions.
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ readme
# Used for code checking.
pyflakes
flake8
flake8-import-order

# For release
wheel
Expand Down
11 changes: 6 additions & 5 deletions planemo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

import click

from .io import error
from planemo import __version__
from planemo.exit_codes import ExitCodeException
from planemo.galaxy import profiles

from .config import (
read_global_config,
OptionSource,
read_global_config,
)
from planemo.galaxy import profiles
from planemo.exit_codes import ExitCodeException
from planemo import __version__
from .io import error

PYTHON_2_7_COMMANDS = ["run", "cwl_script"]
IS_PYTHON_2_7 = sys.version_info[0] == 2 and sys.version_info[1] >= 7
Expand Down
11 changes: 5 additions & 6 deletions planemo/commands/cmd_brew.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
"""Module describing the planemo ``brew`` command."""
import click

from planemo.cli import command_function
from planemo import options

from galaxy.tools.loader_directory import load_tool_elements_from_path

from galaxy.tools.deps.requirements import parse_requirements_from_xml
from galaxy.tools.deps import brew_exts
from galaxy.tools.deps import brew_util
from galaxy.tools.deps.requirements import parse_requirements_from_xml
from galaxy.tools.loader_directory import load_tool_elements_from_path
from galaxy.util import bunch

from planemo import options
from planemo.cli import command_function


@click.command('brew')
@options.optional_tools_arg()
Expand Down
13 changes: 7 additions & 6 deletions planemo/commands/cmd_brew_env.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
"""Module describing the planemo ``brew_env`` command."""
from __future__ import print_function
import click
import os

from planemo.cli import command_function
from planemo import options
from planemo.io import ps1_for_path
import click

from galaxy.tools.loader import load_tool
from galaxy.tools.deps.requirements import parse_requirements_from_xml
from galaxy.tools.deps import brew_exts
from galaxy.tools.deps import brew_util
from galaxy.tools.deps.requirements import parse_requirements_from_xml
from galaxy.tools.loader import load_tool
from galaxy.util import bunch

from planemo import options
from planemo.cli import command_function
from planemo.io import ps1_for_path


@click.command('brew_env')
@options.optional_tools_arg()
Expand Down
4 changes: 2 additions & 2 deletions planemo/commands/cmd_brew_init.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Module describing the planemo ``brew_init`` command."""
import click

import urllib
from tempfile import mkstemp

import click

from planemo.cli import command_function
from planemo.io import shell

Expand Down
13 changes: 6 additions & 7 deletions planemo/commands/cmd_conda_env.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
"""Module describing the planemo ``conda_env`` command."""
from __future__ import print_function
import click

from planemo.cli import command_function
from planemo import options
import click

from planemo.io import ps1_for_path
from planemo.io import error
from galaxy.tools.deps import conda_util

from planemo import options
from planemo.cli import command_function
from planemo.conda import build_conda_context, collect_conda_targets

from galaxy.tools.deps import conda_util
from planemo.io import error
from planemo.io import ps1_for_path


SOURCE_COMMAND = """
Expand Down
6 changes: 3 additions & 3 deletions planemo/commands/cmd_conda_init.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Module describing the planemo ``conda_init`` command."""
import click

from planemo.cli import command_function
from galaxy.tools.deps import conda_util

from planemo import options
from planemo.cli import command_function
from planemo.conda import build_conda_context

from galaxy.tools.deps import conda_util


@click.command('conda_init')
@options.conda_target_options()
Expand Down
9 changes: 4 additions & 5 deletions planemo/commands/cmd_conda_install.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"""Module describing the planemo ``conda_install`` command."""
import click

from planemo.cli import command_function
from planemo.io import coalesce_return_codes
from planemo import options
from galaxy.tools.deps import conda_util

from planemo import options
from planemo.cli import command_function
from planemo.conda import build_conda_context, collect_conda_targets

from galaxy.tools.deps import conda_util
from planemo.io import coalesce_return_codes


@click.command('conda_install')
Expand Down
6 changes: 3 additions & 3 deletions planemo/commands/cmd_config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo import config
from planemo.io import warn, info
from planemo import options
from planemo.cli import command_function
from planemo.io import info, warn

CONFIG_TEMPLATE = """## Planemo Global Configuration File.
## Everything in this file is completely optional - these values can all be
Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_create_gist.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Module describing the planemo ``create_gist`` command."""
import click

from planemo import github_util
from planemo.cli import command_function
from planemo.io import info
from planemo import github_util

target_path = click.Path(
file_okay=True,
Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_cwl_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.cwl import to_script


Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_database_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.database import create_database_source


Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_database_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.database import create_database_source


Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_database_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.database import create_database_source


Expand Down
9 changes: 4 additions & 5 deletions planemo/commands/cmd_dependency_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
import os
import sys

import click

from xml.etree import ElementTree as ET

from planemo.io import info, error
from planemo.cli import command_function
from planemo import options
import click

from planemo import options
from planemo.cli import command_function
from planemo.io import error, info
from planemo.shed2tap.base import BasePackage, Dependency


Expand Down
8 changes: 5 additions & 3 deletions planemo/commands/cmd_docker_build.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""Module describing the planemo ``docker_build`` command."""

import click
from planemo.cli import command_function
from planemo import options
from planemo.io import error

from galaxy.tools.deps import dockerfiles

from planemo import options
from planemo.cli import command_function
from planemo.io import error


@click.command('docker_build')
@options.optional_tools_arg()
Expand Down
10 changes: 6 additions & 4 deletions planemo/commands/cmd_docker_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
such a tag from a Dockerfile located in the tool's directory.
"""
from __future__ import print_function
import click
import os
from planemo.cli import command_function
from planemo import options

from galaxy.tools.loader import load_tool
import click

from galaxy.tools.deps import docker_util
from galaxy.tools.deps import dockerfiles
from galaxy.tools.deps.requirements import parse_requirements_from_xml
from galaxy.tools.loader import load_tool

from planemo import options
from planemo.cli import command_function


@click.command('docker_shell')
Expand Down
3 changes: 1 addition & 2 deletions planemo/commands/cmd_lint.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""Module describing the planemo ``lint`` command."""
import click

from planemo.cli import command_function
from planemo import options

from planemo.cli import command_function
from planemo.tool_lint import build_lint_args
from planemo.tool_lint import lint_tools_on_path

Expand Down
8 changes: 4 additions & 4 deletions planemo/commands/cmd_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import click

from planemo.cli import command_function
from planemo import options

from galaxy.tools.linters.xml_order import TAG_ORDER
from galaxy.tools.loader import (
load_tool,
raw_tool_xml_tree,
)
from galaxy.tools.linters.xml_order import TAG_ORDER

from planemo import options
from planemo.cli import command_function


@click.command('normalize')
Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_profile_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.galaxy import profiles


Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_profile_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.galaxy import profiles


Expand Down
8 changes: 4 additions & 4 deletions planemo/commands/cmd_project_init.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""Module describing the planemo ``project_init`` command."""
import os
import tempfile
import shutil
import tempfile

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.io import (
warn,
shell,
untar_to,
shell
warn,
)

SOURCE_HOST = "https://codeload.github.com"
Expand Down
2 changes: 1 addition & 1 deletion planemo/commands/cmd_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import click

from planemo.cli import command_function
from planemo import options
from planemo.cli import command_function
from planemo.engine import engine_context
from planemo.io import conditionally_captured_io, warn

Expand Down
4 changes: 2 additions & 2 deletions planemo/commands/cmd_serve.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Module describing the planemo ``serve`` command."""
import click

from planemo import options
from planemo.cli import command_function
from planemo.runnable import for_paths
from planemo.galaxy import galaxy_serve
from planemo import options
from planemo.runnable import for_paths


@click.command('serve')
Expand Down
4 changes: 2 additions & 2 deletions planemo/commands/cmd_share_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Module describing the planemo ``share_test`` command."""
import click

from planemo.cli import command_function
from planemo import github_util
from planemo import options
from planemo.cli import command_function
from planemo.io import info
from planemo import github_util

PLANEMO_TEST_VIEWER_URL_TEMPLATE = (
"http://galaxyproject.github.io/planemo/tool_test_viewer.html"
Expand Down
6 changes: 3 additions & 3 deletions planemo/commands/cmd_shed_build.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Module describing the planemo ``shed_build`` command."""

import shutil
import sys

import click
import shutil

from planemo.cli import command_function
from planemo import options
from planemo import shed
from planemo.cli import command_function


@click.command("shed_build")
Expand All @@ -18,7 +19,6 @@ def cli(ctx, path, **kwds):
This will use the .shed.yml file to prepare a tarball
(which you could upload to the Tool Shed manually).
"""

def build(realized_repository):
tarpath = shed.build_tarball(realized_repository.path)
outpath = realized_repository.real_path + ".tar.gz"
Expand Down
Loading

0 comments on commit e1f2284

Please sign in to comment.