1
0
Fork 0
mirror of synced 2024-11-03 00:48:57 -04:00

Add isort as a tox environment, and run it

This commit is contained in:
Kurt McKee 2022-04-30 20:46:09 -05:00
parent 566ba0b853
commit ea98e5eafc
14 changed files with 38 additions and 25 deletions

View file

@ -1,17 +1,16 @@
import glob import glob
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
from .config import ConfigReader, ReadingError
from .dispatcher import Dispatcher, DispatchError
from .messenger import Messenger
from .messenger import Level
from .plugins import Clean, Create, Link, Shell
from .util import module
import dotbot
import os import os
import subprocess import subprocess
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
import dotbot
from .config import ConfigReader, ReadingError
from .dispatcher import Dispatcher, DispatchError
from .messenger import Level, Messenger
from .plugins import Clean, Create, Link, Shell
from .util import module
def add_options(parser): def add_options(parser):

View file

@ -1,6 +1,8 @@
import yaml
import json import json
import os.path import os.path
import yaml
from .util import string from .util import string

View file

@ -1,8 +1,9 @@
import os import os
from argparse import Namespace from argparse import Namespace
from .plugin import Plugin
from .messenger import Messenger
from .context import Context from .context import Context
from .messenger import Messenger
from .plugin import Plugin
class Dispatcher(object): class Dispatcher(object):

View file

@ -1,2 +1,2 @@
from .messenger import Messenger
from .level import Level from .level import Level
from .messenger import Messenger

View file

@ -1,5 +1,5 @@
from ..util.singleton import Singleton
from ..util.compat import with_metaclass from ..util.compat import with_metaclass
from ..util.singleton import Singleton
from .color import Color from .color import Color
from .level import Level from .level import Level

View file

@ -1,5 +1,5 @@
from .messenger import Messenger
from .context import Context from .context import Context
from .messenger import Messenger
class Plugin(object): class Plugin(object):

View file

@ -1,7 +1,7 @@
import os
import sys
import glob import glob
import os
import shutil import shutil
import sys
from ..plugin import Plugin from ..plugin import Plugin
from ..util import shell_command from ..util import shell_command

View file

@ -1,6 +1,6 @@
import os import os
import subprocess
import platform import platform
import subprocess
def shell_command(command, cwd=None, enable_stdin=False, enable_stdout=False, enable_stderr=False): def shell_command(command, cwd=None, enable_stdin=False, enable_stdout=False, enable_stderr=False):

View file

@ -2,8 +2,8 @@ import json
import os import os
import shutil import shutil
import sys import sys
from shutil import rmtree
import tempfile import tempfile
from shutil import rmtree
import pytest import pytest
import yaml import yaml

View file

@ -4,9 +4,10 @@ This file is copied to a location with the name "directory.py",
and is then loaded from within the `test_cli.py` code. and is then loaded from within the `test_cli.py` code.
""" """
import dotbot
import os.path import os.path
import dotbot
class Directory(dotbot.Plugin): class Directory(dotbot.Plugin):
def can_handle(self, directive): def can_handle(self, directive):

View file

@ -4,9 +4,10 @@ This file is copied to a location with the name "file.py",
and is then loaded from within the `test_cli.py` code. and is then loaded from within the `test_cli.py` code.
""" """
import dotbot
import os.path import os.path
import dotbot
class File(dotbot.Plugin): class File(dotbot.Plugin):
def can_handle(self, directive): def can_handle(self, directive):

View file

@ -3,7 +3,6 @@ import sys
import pytest import pytest
# Python 2.7 on Windows does not have an `os.symlink()` function. # Python 2.7 on Windows does not have an `os.symlink()` function.
# PyPy on Windows raises NotImplementedError when `os.symlink()` is called. # PyPy on Windows raises NotImplementedError when `os.symlink()` is called.
# Older Python 3 versions on Windows require admin rights to create symlinks. # Older Python 3 versions on Windows require admin rights to create symlinks.

View file

@ -3,7 +3,6 @@ import sys
import pytest import pytest
# Python 2.7 on Windows does not have an `os.symlink()` function. # Python 2.7 on Windows does not have an `os.symlink()` function.
# PyPy on Windows raises NotImplementedError when `os.symlink()` is called. # PyPy on Windows raises NotImplementedError when `os.symlink()` is called.
# Older Python 3 versions on Windows require admin rights to create symlinks. # Older Python 3 versions on Windows require admin rights to create symlinks.

11
tox.ini
View file

@ -3,6 +3,7 @@ envlist =
py{27, 35, 36, 37, 38, 39, 310} py{27, 35, 36, 37, 38, 39, 310}
pypy{2, 3} pypy{2, 3}
py310-black py310-black
py310-isort
skip_missing_interpreters = true skip_missing_interpreters = true
@ -25,3 +26,13 @@ deps =
commands = commands =
black --check dotbot/ tests/ black --check dotbot/ tests/
[testenv:py310-isort]
skip_install = true
skip_build = true
deps =
isort
commands =
isort --check dotbot/ tests/