Skip to content

Commit

Permalink
Fix ruff isort configuration (#240)
Browse files Browse the repository at this point in the history
As brought up in #239 (comment), the isort settings for ruff were not being applied.
  • Loading branch information
nicoddemus committed Jan 30, 2024
1 parent 907e87a commit e849675
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 18 deletions.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ Homepage = "https://execnet.readthedocs.io/en/latest/"

[tool.ruff.lint]
ignore = ["E741"]
extend-select = ["I001"]

[tool.ruff.lint.isort]
case-sensitive = true
force-single-line = true
known-third-party = ["src"]

[tool.hatch.version]
source = "vcs"
Expand Down
9 changes: 4 additions & 5 deletions src/execnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@
"""
from ._version import version as __version__
from .gateway_base import DataFormatError
from .gateway_base import RemoteError
from .gateway_base import TimeoutError
from .gateway_base import dump
from .gateway_base import dumps
from .gateway_base import load
from .gateway_base import loads
from .gateway_base import RemoteError
from .gateway_base import TimeoutError
from .gateway_bootstrap import HostNotFound
from .multi import default_group
from .multi import Group
from .multi import makegateway
from .multi import MultiChannel
from .multi import default_group
from .multi import makegateway
from .multi import set_execmodel
from .rsync import RSync
from .xspec import XSpec


__all__ = [
"__version__",
"makegateway",
Expand Down
2 changes: 1 addition & 1 deletion src/execnet/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def __repr__(self):


def rinfo_source(channel):
import sys
import os
import sys

channel.send(
dict(
Expand Down
2 changes: 1 addition & 1 deletion src/execnet/gateway_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ def trace(*msg):
pass # nothing we can do, likely interpreter-shutdown

elif DEBUG:
import tempfile
import os
import tempfile

fn = os.path.join(tempfile.gettempdir(), "execnet-debug-%d" % pid)
# sys.stderr.write("execnet-debug at %r" % (fn,))
Expand Down
6 changes: 4 additions & 2 deletions src/execnet/gateway_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import sys

try:
from execnet.gateway_base import Popen2IO, Message
from execnet.gateway_base import Message
from execnet.gateway_base import Popen2IO
except ImportError:
from __main__ import Popen2IO, Message # type: ignore[no-redef]
from __main__ import Message # type: ignore[no-redef]
from __main__ import Popen2IO # type: ignore[no-redef]

from functools import partial

Expand Down
2 changes: 1 addition & 1 deletion src/execnet/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

from . import gateway_bootstrap
from . import gateway_io
from .gateway_base import WorkerPool
from .gateway_base import get_execmodel
from .gateway_base import trace
from .gateway_base import WorkerPool
from .xspec import XSpec

NO_ENDMARKER_WANTED = object()
Expand Down
2 changes: 1 addition & 1 deletion src/execnet/rsync_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

def serve_rsync(channel):
import os
import stat
import shutil
import stat
from hashlib import md5

destdir, options = channel.receive()
Expand Down
1 change: 0 additions & 1 deletion src/execnet/script/quitserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import socket
import sys


host, port = sys.argv[1].split(":")
hostport = (host, int(port))

Expand Down
1 change: 0 additions & 1 deletion src/execnet/script/socketserverservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import win32service
import win32serviceutil


appname = "ExecNetSocketServer"


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

import execnet
import pytest
from execnet.gateway_base import get_execmodel
from execnet.gateway_base import WorkerPool
from execnet.gateway_base import get_execmodel

collect_ignore = ["build", "doc/_build"]

Expand Down
1 change: 0 additions & 1 deletion testing/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from execnet.gateway_base import Message
from execnet.gateway_base import Popen2IO


skip_win_pypy = pytest.mark.xfail(
condition=hasattr(sys, "pypy_version_info") and sys.platform.startswith("win"),
reason="failing on Windows on PyPy (#63)",
Expand Down
1 change: 0 additions & 1 deletion testing/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import pytest


needs_early_gc = pytest.mark.skipif("not hasattr(sys, 'getrefcount')")
needs_osdup = pytest.mark.skipif("not hasattr(os, 'dup')")
TESTTIMEOUT = 10.0 # seconds
Expand Down
1 change: 0 additions & 1 deletion testing/test_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import execnet
import pytest


# We use the execnet folder in order to avoid triggering a missing apipkg.
pyimportdir = os.fspath(Path(execnet.__file__).parent)

Expand Down

0 comments on commit e849675

Please sign in to comment.