fix(ci): check imports with the same isort as pre-commit

flowchart LR
  DEV["developer commit"] -- "pre-commit: isort 6.0.1<br/>keeps exploded imports (trailing comma)" --> CODE["src/"]
  CODE -- "CI validate-mr: isort 5.13.2 from requirements.txt<br/>wants them joined" --> RED["red on 9 files"]
  FIX["this MR: requirements.txt isort==6.0.1"] -.-> CI2["CI and pre-commit run the same isort"]

CI's validate-mr failed at isort on every MR into this branch, e.g. !201 (merged). The hook and CI ran different isort versions, and they disagree about imports that end in a trailing comma. Pinning 6.0.1, the version in .pre-commit-config.yaml, makes them agree. One file, kubernetes/client.py, had a misplaced requests import and gets a two-line move.

validate-mr step, run in python:3.12-slim before this MR this MR + !201 (merged)
isort 10 files clean clean
black clean clean clean
flake8 clean clean clean
pytest common edgecloud / network 3 / 3 passed 3 / 3 passed 3 / 3 passed
pytest contract/ 51 passed 51 passed 60 passed

black has the same kind of drift (24.8.0 in requirements.txt, 25.1.0 in pre-commit) but passes today, so it stays out of this MR.

After this merges, rebase !201 (merged) so its pipeline runs on top of it.

Merge request reports

Loading
+1 −2
Changes for src/openop_tfsdk/edgecloud/adapters/kubernetes/client.py: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -2,10 +2,9 @@
from typing import Dict, List, Optional

from kubernetes.client import V1Deployment

from openop_tfsdk._diagnostics import backend_diagnostics, validation_diagnostics
from requests import Response

from openop_tfsdk._diagnostics import backend_diagnostics, validation_diagnostics
from openop_tfsdk.edgecloud.adapters.kubernetes.lib.core.piedge_encoder import (
    deploy_service_function,
)
+1 −1
Changes for requirements.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ idna==3.10
importlib_metadata==8.7.0
iniconfig==2.0.0
ipython==8.12.3
isort==5.13.2
isort==6.0.1
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
Loading