Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lint errors
Browse files Browse the repository at this point in the history
nickstenning committed Oct 6, 2024

Verified

This commit was signed with the committer’s verified signature.
nickstenning Nick Stenning
1 parent 734e480 commit 9ffa805
Showing 22 changed files with 41 additions and 61 deletions.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from honcho import __version__

# -*- coding: utf-8 -*-
#
# honcho documentation build configuration file, created by
@@ -11,7 +13,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -48,7 +49,6 @@
# built documents.
#
# The short X.Y version.
from honcho import __version__
version = __version__
# The full version, including alpha/beta/rc tags.
release = __version__
11 changes: 4 additions & 7 deletions honcho/command.py
Original file line number Diff line number Diff line change
@@ -3,18 +3,15 @@
import logging
import os
import shlex
import sys
import signal
from collections import ChainMap
from collections import OrderedDict
from collections import defaultdict
import sys
from collections import ChainMap, OrderedDict, defaultdict

from honcho import __version__
from honcho import __version__, compat, environ
from honcho.environ import Env
from honcho.process import Popen
from honcho.manager import Manager
from honcho.printer import Printer
from honcho import compat, environ
from honcho.process import Popen

if sys.version_info < (3, 10):
from backports.entry_points_selectable import entry_points
7 changes: 2 additions & 5 deletions honcho/environ.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from collections import OrderedDict
from collections import defaultdict
from collections import namedtuple
import shlex
import os
import re

import shlex
from collections import OrderedDict, defaultdict, namedtuple

PROCFILE_LINE = re.compile(r'^([A-Za-z0-9_-]+):\s*(.+)$')

5 changes: 2 additions & 3 deletions honcho/export/runit.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os

import jinja2

from honcho.export.base import BaseExport
from honcho.export.base import File
from honcho.export.base import dashrepl
from honcho.export.base import BaseExport, File, dashrepl


class Export(BaseExport):
3 changes: 1 addition & 2 deletions honcho/export/supervisord.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import jinja2

from honcho.export.base import BaseExport
from honcho.export.base import File
from honcho.export.base import BaseExport, File


class Export(BaseExport):
4 changes: 1 addition & 3 deletions honcho/export/systemd.py
Original file line number Diff line number Diff line change
@@ -2,9 +2,7 @@

import jinja2

from honcho.export.base import BaseExport
from honcho.export.base import File
from honcho.export.base import dashrepl
from honcho.export.base import BaseExport, File, dashrepl


class Export(BaseExport):
4 changes: 1 addition & 3 deletions honcho/export/upstart.py
Original file line number Diff line number Diff line change
@@ -2,9 +2,7 @@

import jinja2

from honcho.export.base import BaseExport
from honcho.export.base import File
from honcho.export.base import dashrepl
from honcho.export.base import BaseExport, File, dashrepl


class Export(BaseExport):
4 changes: 2 additions & 2 deletions honcho/manager.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import datetime
import queue
import multiprocessing
import queue
import signal
import sys

from .colour import get_colours
from .compat import ProcessManager
from .printer import Message, Printer
from .process import Process
from .printer import Printer, Message

KILL_WAIT = 5
SIGNALS = {
4 changes: 2 additions & 2 deletions honcho/printer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import namedtuple
import sys
from collections import namedtuple

from .compat import ON_WINDOWS

@@ -76,7 +76,7 @@ def _colour_string(colour, s):
try:
import colorama
except ImportError:
def _colour_string(colour, s): # noqa
def _colour_string(colour, s):
return s
else:
colorama.init()
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ def path(self, *args):

def run_honcho(self, args):
result = subprocess.run(
['honcho'] + args,
['honcho', *args],
cwd=self.root,
stdout=PIPE,
stderr=PIPE,
3 changes: 2 additions & 1 deletion tests/integration/test_main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import textwrap

import pytest


@pytest.mark.parametrize('testenv', [{
'Procfile': textwrap.dedent("""
2 changes: 1 addition & 1 deletion tests/integration/test_start.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import textwrap
import sys
import textwrap

import pytest

4 changes: 2 additions & 2 deletions tests/test_environ.py
Original file line number Diff line number Diff line change
@@ -88,8 +88,8 @@
# Unicode values
r"""
MYVAR=⋃ñᴉ—☪ó∂ǝ
""",
{'MYVAR': '⋃ñᴉ—☪ó∂ǝ'}
""", # noqa: RUF001
{'MYVAR': '⋃ñᴉ—☪ó∂ǝ'} # noqa: RUF001
],
[
# Unicode keys
7 changes: 2 additions & 5 deletions tests/test_export_base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-

from mock import Mock
from mock import patch
import pytest
from mock import Mock, patch

from honcho.export.base import BaseExport
from honcho.export.base import dashrepl
from honcho.export.base import percentescape
from honcho.export.base import BaseExport, dashrepl, percentescape


class GiraffeExport(BaseExport):
4 changes: 2 additions & 2 deletions tests/test_export_runit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import collections

from mock import patch
import pytest
from mock import patch

from honcho.export.runit import Export

@@ -12,7 +12,7 @@

class TestExportRunit(object):
@pytest.fixture(autouse=True)
def exporter(self, request): # noqa
def exporter(self, request):
self.export = Export()

get_template_patcher = patch.object(Export, 'get_template')
3 changes: 1 addition & 2 deletions tests/test_export_supervisord.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from mock import MagicMock
from mock import patch
from mock import MagicMock, patch

from honcho.export.supervisord import Export

6 changes: 2 additions & 4 deletions tests/test_export_systemd.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import collections

from mock import MagicMock
from mock import call
from mock import patch
import pytest
from mock import MagicMock, call, patch

from honcho.export.systemd import Export

@@ -17,7 +15,7 @@

class TestExportSystemd(object):
@pytest.fixture(autouse=True)
def exporter(self, request): # noqa
def exporter(self, request):
self.export = Export()

self.master = MagicMock()
6 changes: 2 additions & 4 deletions tests/test_export_upstart.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import collections

from mock import MagicMock
from mock import call
from mock import patch
import pytest
from mock import MagicMock, call, patch

from honcho.export.upstart import Export

@@ -17,7 +15,7 @@

class TestExportUpstart(object):
@pytest.fixture(autouse=True)
def exporter(self, request): # noqa
def exporter(self, request):
self.export = Export()

self.master = MagicMock()
6 changes: 2 additions & 4 deletions tests/test_invocation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import sys
import subprocess
import re

import pytest
import subprocess
import sys


def test_runpy_invoke():
7 changes: 3 additions & 4 deletions tests/test_manager.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import datetime
import queue
import multiprocessing
import queue

import pytest

from honcho.manager import SYSTEM_PRINTER_NAME, Manager
from honcho.printer import Message
from honcho.manager import Manager
from honcho.manager import SYSTEM_PRINTER_NAME

HISTORIES = {
'one': {
@@ -191,7 +190,7 @@ def find_line(self, data):

class TestManager(object):
@pytest.fixture(autouse=True)
def printer(self): # noqa
def printer(self):
self.p = FakePrinter()
self.m = Manager(printer=self.p)
self.m._clock = FakeClock()
3 changes: 2 additions & 1 deletion tests/test_printer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import datetime

import pytest

from honcho.printer import Printer, Message
from honcho.printer import Message, Printer


def fake_message(data, **kwargs):
3 changes: 2 additions & 1 deletion tests/test_process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime

import pytest

from honcho.process import Process
@@ -82,7 +83,7 @@ def close(self):
class TestProcess(object):

@pytest.fixture(autouse=True)
def queue(self): # noqa
def queue(self):
self.q = FakeQueue()

def test_ctor_cmd(self):

0 comments on commit 9ffa805

Please sign in to comment.