mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 00:14:41 +01:00
style: sort imports
This commit is contained in:
parent
72fd026c52
commit
f2b7d4ed4f
26 changed files with 30 additions and 29 deletions
|
@ -42,4 +42,5 @@ force_exclude = '''.*/__amalgam__.py'''
|
|||
profile = "black"
|
||||
extend_skip_glob = ["xonsh/*_table.py", "xonsh/ply/**.py", "*/__amalgam__.py", "**/__amalgam__.py"]
|
||||
src_paths = ["xonsh", "xontrib", "xompletions", "tests"]
|
||||
known_third_party = ["ply"]
|
||||
known_first_party = ["xonsh", "xontrib", "xompletions", "tests"]
|
||||
known_third_party = ["ply", "pytest"]
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
from xonsh.completers.base import complete_base
|
||||
from xonsh.parsers.completion_context import CommandContext, CompletionContext
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
|
||||
CUR_DIR = (
|
||||
"." if ON_WINDOWS else "./"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_darwin, skip_if_on_windows
|
||||
from xonsh.completers.bash import complete_from_bash
|
||||
from xonsh.completers.tools import RichCompletion
|
||||
from xonsh.parsers.completion_context import (
|
||||
|
@ -8,6 +7,7 @@ from xonsh.parsers.completion_context import (
|
|||
CommandContext,
|
||||
CompletionContext,
|
||||
)
|
||||
from xonsh.pytest.tools import skip_if_on_darwin, skip_if_on_windows
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -2,7 +2,6 @@ from unittest.mock import Mock
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import ON_WINDOWS, completions_from_result, skip_if_on_windows
|
||||
from xonsh.completer import Completer
|
||||
from xonsh.completers.commands import complete_command, complete_skipper
|
||||
from xonsh.parsers.completion_context import (
|
||||
|
@ -10,6 +9,7 @@ from xonsh.parsers.completion_context import (
|
|||
CommandContext,
|
||||
CompletionContext,
|
||||
)
|
||||
from xonsh.pytest.tools import ON_WINDOWS, completions_from_result, skip_if_on_windows
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -3,8 +3,8 @@ from os import sep
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
from xonsh.completers.tools import RichCompletion
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
|
||||
CUR_DIR = "." if ON_WINDOWS else "./"
|
||||
PARENT_DIR = ".." if ON_WINDOWS else "../"
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_pre_3_8
|
||||
from xonsh.completers.imports import complete_import
|
||||
from xonsh.completers.python import complete_python, python_signature_complete
|
||||
from xonsh.parsers.completion_context import CompletionContext, PythonContext
|
||||
from xonsh.pytest.tools import skip_if_pre_3_8
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -5,10 +5,10 @@ from subprocess import Popen
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
from xonsh.procs.posix import PopenThread
|
||||
from xonsh.procs.proxies import STDOUT_DISPATCHER, ProcProxy, ProcProxyThread
|
||||
from xonsh.procs.specs import cmds_to_specs, run_subproc
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
|
||||
|
||||
@skip_if_on_windows
|
||||
|
|
|
@ -5,8 +5,8 @@ import os
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
from xonsh.aliases import Aliases, ExecAlias
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
|
||||
|
||||
def cd(args, stdin=None, **kwargs):
|
||||
|
|
|
@ -3,9 +3,9 @@ import ast as pyast
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import nodes_equal
|
||||
from xonsh import ast
|
||||
from xonsh.ast import BinOp, Call, Name, Store, Tuple, isexpression, min_line
|
||||
from xonsh.pytest.tools import nodes_equal
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -8,7 +8,6 @@ from pathlib import Path
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
from xonsh.built_ins import (
|
||||
call_macro,
|
||||
convert_macro_arg,
|
||||
|
@ -25,6 +24,7 @@ from xonsh.built_ins import (
|
|||
superhelper,
|
||||
)
|
||||
from xonsh.environ import Env
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
|
||||
HOME_PATH = os.path.expanduser("~")
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ from unittest.mock import MagicMock
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
from xonsh.commands_cache import (
|
||||
SHELL_PREDICTOR_PARSER,
|
||||
CommandsCache,
|
||||
|
@ -13,6 +12,7 @@ from xonsh.commands_cache import (
|
|||
predict_shell,
|
||||
predict_true,
|
||||
)
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
|
||||
|
||||
def test_commands_cache_lazy(xession):
|
||||
|
|
|
@ -5,13 +5,13 @@ from unittest import mock
|
|||
import pytest
|
||||
|
||||
import xonsh.parsers.completion_context as ctx
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
from xonsh.parsers.completion_context import (
|
||||
CommandArg,
|
||||
CommandContext,
|
||||
CompletionContextParser,
|
||||
PythonContext,
|
||||
)
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
|
||||
DEBUG = False
|
||||
MISSING = object()
|
||||
|
|
|
@ -10,7 +10,6 @@ from time import sleep
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_unix
|
||||
from xonsh.environ import (
|
||||
Env,
|
||||
InternalEnvironDict,
|
||||
|
@ -21,6 +20,7 @@ from xonsh.environ import (
|
|||
locate_binary,
|
||||
make_args_env,
|
||||
)
|
||||
from xonsh.pytest.tools import skip_if_on_unix
|
||||
from xonsh.tools import DefaultNotGiven, always_true
|
||||
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import subprocess
|
|||
|
||||
import pytest # noqa F401
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_unix, skip_if_on_windows
|
||||
from xonsh.foreign_shells import foreign_shell_data, parse_aliases, parse_env
|
||||
from xonsh.pytest.tools import skip_if_on_unix, skip_if_on_windows
|
||||
|
||||
|
||||
def test_parse_env():
|
||||
|
|
|
@ -10,6 +10,7 @@ from pathlib import Path
|
|||
import pytest
|
||||
|
||||
import xonsh
|
||||
from xonsh.dirstack import with_pushd
|
||||
from xonsh.pytest.tools import (
|
||||
ON_DARWIN,
|
||||
ON_TRAVIS,
|
||||
|
@ -19,7 +20,6 @@ from xonsh.pytest.tools import (
|
|||
skip_if_on_unix,
|
||||
skip_if_on_windows,
|
||||
)
|
||||
from xonsh.dirstack import with_pushd
|
||||
|
||||
PATH = (
|
||||
os.path.join(os.path.abspath(os.path.dirname(__file__)), "bin")
|
||||
|
|
|
@ -9,8 +9,8 @@ from contextlib import contextmanager
|
|||
import pytest
|
||||
|
||||
import xonsh.main
|
||||
from xonsh.pytest.tools import ON_WINDOWS, TEST_DIR, skip_if_on_windows
|
||||
from xonsh.main import XonshMode
|
||||
from xonsh.pytest.tools import ON_WINDOWS, TEST_DIR, skip_if_on_windows
|
||||
|
||||
|
||||
def Shell(*args, **kwargs):
|
||||
|
|
|
@ -3,8 +3,8 @@ import subprocess
|
|||
|
||||
import pytest # noqa F401
|
||||
|
||||
from xonsh.pytest.tools import skip_if_not_on_darwin, skip_if_on_windows
|
||||
from xonsh.completers.man import complete_from_man
|
||||
from xonsh.pytest.tools import skip_if_not_on_darwin, skip_if_on_windows
|
||||
|
||||
|
||||
@skip_if_on_windows
|
||||
|
|
|
@ -5,15 +5,15 @@ import textwrap
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.ast import AST, Call, Pass, Str, With
|
||||
from xonsh.parser import Parser
|
||||
from xonsh.parsers.fstring_adaptor import FStringAdaptor
|
||||
from xonsh.pytest.tools import (
|
||||
VER_MAJOR_MINOR,
|
||||
nodes_equal,
|
||||
skip_if_pre_3_8,
|
||||
skip_if_pre_3_10,
|
||||
)
|
||||
from xonsh.ast import AST, Call, Pass, Str, With
|
||||
from xonsh.parser import Parser
|
||||
from xonsh.parsers.fstring_adaptor import FStringAdaptor
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
@ -6,9 +6,9 @@ import os
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_unix, skip_if_on_windows
|
||||
from xonsh.platform import ON_WINDOWS
|
||||
from xonsh.procs.pipelines import CommandPipeline
|
||||
from xonsh.pytest.tools import skip_if_on_unix, skip_if_on_windows
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
|
|
|
@ -14,10 +14,10 @@ from pygments.token import (
|
|||
Text,
|
||||
)
|
||||
|
||||
from xonsh.pytest.tools import DummyShell, skip_if_on_windows
|
||||
from xonsh.environ import LsColors
|
||||
from xonsh.events import EventManager, events
|
||||
from xonsh.pyghooks import Color, XonshLexer, XonshStyle, on_lscolors_change
|
||||
from xonsh.pytest.tools import DummyShell, skip_if_on_windows
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
@ -5,9 +5,9 @@ import sys
|
|||
import pyte
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
from xonsh.platform import minimum_required_ptk_version
|
||||
from xonsh.ptk_shell.shell import tokenize_ansi
|
||||
from xonsh.pytest.tools import ON_WINDOWS
|
||||
from xonsh.shell import Shell
|
||||
|
||||
# verify error if ptk not installed or below min
|
||||
|
|
|
@ -8,10 +8,10 @@ from tempfile import TemporaryDirectory
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
from xonsh import __version__
|
||||
from xonsh.lexer import Lexer
|
||||
from xonsh.platform import HAS_PYGMENTS, ON_WINDOWS
|
||||
from xonsh.pytest.tools import skip_if_on_windows
|
||||
from xonsh.tools import (
|
||||
EnvPath,
|
||||
all_permutations,
|
||||
|
|
|
@ -9,8 +9,8 @@ from typing import TYPE_CHECKING
|
|||
|
||||
import pytest
|
||||
|
||||
from xonsh.pytest.tools import skip_if_on_conda, skip_if_on_msys
|
||||
from xonsh.platform import ON_WINDOWS
|
||||
from xonsh.pytest.tools import skip_if_on_conda, skip_if_on_msys
|
||||
from xontrib.voxapi import Vox
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
@ -22,6 +22,7 @@ from xonsh.execer import Execer
|
|||
from xonsh.jobs import tasks
|
||||
from xonsh.main import setup
|
||||
from xonsh.parsers.completion_context import CompletionContextParser
|
||||
|
||||
from .tools import DummyHistory, DummyShell, copy_env, sp
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ from xonsh.platform import (
|
|||
minimum_required_ptk_version,
|
||||
ptk_above_min_supported,
|
||||
)
|
||||
from xonsh.tools import XonshError, print_exception, simple_random_choice, is_class
|
||||
from xonsh.tools import XonshError, is_class, print_exception, simple_random_choice
|
||||
|
||||
events.doc(
|
||||
"on_transform_command",
|
||||
|
|
|
@ -12,12 +12,11 @@ import shutil
|
|||
import textwrap
|
||||
import typing as tp
|
||||
|
||||
from xonsh.ply import ply
|
||||
|
||||
import xonsh.wizard as wiz
|
||||
from xonsh import __version__ as XONSH_VERSION
|
||||
from xonsh.built_ins import XSH
|
||||
from xonsh.cli_utils import Annotated, Arg, ArgParserAlias, add_args
|
||||
from xonsh.events import events
|
||||
from xonsh.foreign_shells import CANON_SHELL_NAMES
|
||||
from xonsh.lazyasd import lazyobject
|
||||
from xonsh.platform import (
|
||||
|
@ -37,6 +36,7 @@ from xonsh.platform import (
|
|||
ptk_version,
|
||||
pygments_version,
|
||||
)
|
||||
from xonsh.ply import ply
|
||||
from xonsh.prompt.base import is_template_string
|
||||
from xonsh.tools import (
|
||||
color_style,
|
||||
|
@ -49,7 +49,6 @@ from xonsh.tools import (
|
|||
)
|
||||
from xonsh.xontribs import find_xontrib, xontribs_loaded
|
||||
from xonsh.xontribs_meta import Xontrib, get_xontribs
|
||||
from xonsh.events import events
|
||||
|
||||
HR = "'`-.,_,.-*'`-.,_,.-*'`-.,_,.-*'`-.,_,.-*'`-.,_,.-*'`-.,_,.-*'`-.,_,.-*'"
|
||||
WIZARD_HEAD = """
|
||||
|
|
Loading…
Add table
Reference in a new issue