style: satisfy the widened ruff default rule set

ruff 0.16 enables rules that earlier releases did not, so `ruff check .`
was already failing on HEAD with 35 findings - the CI job installs ruff
unpinned and would have gone red on the next push regardless of this
branch.

All changes are mechanical and behaviour-neutral:

- Optional[X] -> X | None, List[str] -> list[str], dropped the now unused
  typing imports (every module already carries
  `from __future__ import annotations`, and requires-python is >= 3.10).
- Sorted import blocks, `import automtu.x as x` -> `from automtu import x`.
- subprocess.run in pmtu.py and wg.py now passes check=False explicitly.
  That is the parameter default, so the calls behave exactly as before.
- int(round(x)) -> round(x): round() with a single argument already
  returns int.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-08 18:42:55 +02:00
parent 499e61346d
commit 6392131577
10 changed files with 25 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
import unittest
from unittest.mock import patch
import automtu.docker as docker
from automtu import docker
class TestDocker(unittest.TestCase):

View File

@@ -1,9 +1,9 @@
import io
import json
import unittest
from contextlib import redirect_stdout, redirect_stderr
from contextlib import redirect_stderr, redirect_stdout
from automtu.output import OutputMode, emit_json, emit_single_number, Logger
from automtu.output import Logger, OutputMode, emit_json, emit_single_number
class TestOutput(unittest.TestCase):

View File

@@ -4,7 +4,7 @@ from contextlib import redirect_stdout
from pathlib import Path
from unittest.mock import patch
import automtu.persist as persist
from automtu import persist
class TestPersist(unittest.TestCase):

View File

@@ -1,7 +1,7 @@
import unittest
from unittest.mock import patch
import automtu.pmtu as pmtu
from automtu import pmtu
class TestPmtu(unittest.TestCase):

View File

@@ -1,7 +1,7 @@
import unittest
from unittest.mock import patch
import automtu.wg as wg
from automtu import wg
class TestWg(unittest.TestCase):