chore: adopt the NAPALM driver standard (pilot) #52

Merged
christianmanivong merged 4 commits from chore/driver-standard into main 2026-10-22 22:08:14 +00:00
4 Commits
Author SHA1 Message Date
christianmanivong 49830671c9 chore(release): 4.21.1
driver / standard (pull_request) Successful in 36s
driver / lint (pull_request) Successful in 1m12s
driver / types (pull_request) Successful in 1m12s
driver / test (3.10) (pull_request) Successful in 3m3s
driver / test (3.11) (pull_request) Successful in 49s
driver / test (3.12) (pull_request) Successful in 1m53s
driver / test (3.13) (pull_request) Successful in 4m52s
driver / lowest (pull_request) Successful in 26s
driver / security (pull_request) Successful in 3m10s
driver / build (pull_request) Successful in 4m38s
CI / driver (pull_request) Successful in 21m52s
driver / publish (pull_request) Skipped
2026-10-22 21:12:28 +02:00
christianmanivong 0475184684 chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 54s
driver / lint (pull_request) Successful in 50s
driver / types (pull_request) Failing after 1m17s
driver / test (3.10) (pull_request) Successful in 1m43s
driver / test (3.11) (pull_request) Failing after 9m18s
driver / test (3.12) (pull_request) Failing after 1m20s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Failing after 1m38s
driver / security (pull_request) Failing after 4m33s
driver / build (pull_request) Failing after 1m29s
CI / driver (pull_request) Failing after 24m6s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard: conformance, ruff, strict mypy, tests on
  3.10-3.13 and at the lowest declared versions, bandit, pip-audit, build,
  and on a release tag the upload to PyPI.
- tests/quality_baseline.json records today's long and complex functions
  and the one file over 1000 lines; they may shrink, not grow.
- Coverage floor 95 % (measured 95.15 %).
- CHANGELOG.md starts here; project links point at git.netork.io; the
  license is the SPDX string PEP 639 wants.
2026-10-22 19:06:19 +02:00
christianmanivong b7350a9b2c fix: what bandit and the remaining lint rules found
- Long docstring and command lines are wrapped; recorded device output in
  tests/ keeps its lines (E501 is off there).
- host_firewall: the negation token is the named constant _NEGATION. bandit
  read token == "!" as a hardcoded password.
- ssh_host_keys: _known_hosts_file takes the expected key as an argument
  instead of asserting it; both callers had already returned when it is None.
- ssh_server: the staged path is on the device, not a local temp file
  (nosec B108).
- tests: raise ... from exc, zip(strict=True).
2026-10-22 19:05:11 +02:00
christianmanivong 08296d0d2e style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100). typing.List/Dict/Optional
become builtin generics and X | None, imports are sorted, the coding cookies
are gone. Two tests that read the source text follow the new spelling.

What ruff cannot fix comes in the next commit.
2026-10-22 19:03:21 +02:00