chore: adopt the NAPALM driver standard #7

Merged
christianmanivong merged 4 commits from chore/driver-standard into main 2026-10-23 12:53:46 +00:00
Owner

Summary

napalm-fritzbox adopts the NAPALM driver standard (https://git.netork.io/NAPALM/driver-standard).
Epic: NAPALM/driver-standard#2.

Changes

  • style: ruff format and ruff check --fix with the standard's rule set (E, F, I, UP, B, line length 100, Python 3.10). Mechanical.
  • fix: bandit is clean: the catch-all except Exception: continue in get_wan_status logs at debug level before the next WAN service is tried (B112); the "any remote host" placeholder of get_nat_translations is a named constant with a nosec (B104, reported data, never a bind). No behaviour change.
  • chore: CI in .gitea/ calling the shared workflow, .github/ removed; napalm-device-types >=4.21.1 from PyPI; LICENSE, CHANGELOG, py.typed, SPDX license, setuptools>=77, dev extra floors, URLs on git.netork.io (README included); strict mypy with napalm_fritzbox.fritzbox exempt; coverage floor 81 %; quality baseline.

Related Issue

Closes #6

Testing

Locally: 70 tests, coverage 81.36 %, ruff, mypy, bandit clean; napalm-standard check and
ratchet clean; build + twine check --strict pass.

## Summary napalm-fritzbox adopts the NAPALM driver standard (https://git.netork.io/NAPALM/driver-standard). Epic: NAPALM/driver-standard#2. ## Changes - **style**: ruff format and ruff check --fix with the standard's rule set (E, F, I, UP, B, line length 100, Python 3.10). Mechanical. - **fix**: bandit is clean: the catch-all `except Exception: continue` in `get_wan_status` logs at debug level before the next WAN service is tried (B112); the "any remote host" placeholder of `get_nat_translations` is a named constant with a nosec (B104, reported data, never a bind). No behaviour change. - **chore**: CI in .gitea/ calling the shared workflow, .github/ removed; napalm-device-types >=4.21.1 from PyPI; LICENSE, CHANGELOG, py.typed, SPDX license, setuptools>=77, dev extra floors, URLs on git.netork.io (README included); strict mypy with napalm_fritzbox.fritzbox exempt; coverage floor 81 %; quality baseline. ## Related Issue Closes #6 ## Testing Locally: 70 tests, coverage 81.36 %, ruff, mypy, bandit clean; `napalm-standard check` and `ratchet` clean; build + `twine check --strict` pass.
christianmanivong added 3 commits 2026-10-23 07:04:00 +00:00
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
- get_wan_status: the catch-all except Exception: continue (B112) now logs
  at debug level before the next WAN service is tried, so a swallowed
  failure leaves a trace. A module logger is new.
- The "any remote host" placeholder of get_nat_translations is a named
  constant with a nosec (B104): an address reported as data, never a
  bind. The output is unchanged.
- ruff found nothing left after the mechanical pass.
chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 55s
driver / test (3.10) (pull_request) Successful in 5m52s
driver / test (3.11) (pull_request) Successful in 5m58s
driver / test (3.12) (pull_request) Successful in 5m49s
driver / test (3.13) (pull_request) Successful in 5m32s
driver / lowest (pull_request) Successful in 5m19s
driver / security (pull_request) Successful in 47s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 31m5s
driver / publish (pull_request) Skipped
e352801a1a
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ is gone.
- napalm-device-types >=4.21.1 from PyPI (the floor was 0.4.0).
- LICENSE, CHANGELOG, py.typed, SPDX license string, setuptools>=77,
  version floors on the dev extra (black is gone), links to git.netork.io;
  the README names Python 3.10 and the Gitea CI.
- mypy strict for the package; napalm_fritzbox.fritzbox is exempt for now
  (6 errors), recorded in the quality baseline with four long getters.
- Coverage floor 81 % (measured 81.36 %).
christianmanivong added 1 commit 2026-10-23 09:37:05 +00:00
chore(release): 0.3.0
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 47s
driver / test (3.10) (pull_request) Successful in 5m50s
driver / test (3.11) (pull_request) Successful in 5m47s
driver / test (3.12) (pull_request) Successful in 5m47s
driver / security (pull_request) Successful in 1m7s
driver / build (pull_request) Successful in 28s
driver / lowest (pull_request) Successful in 5m26s
driver / test (3.13) (pull_request) Successful in 5m50s
CI / driver (pull_request) Successful in 12m9s
driver / publish (pull_request) Skipped
c5d0b0d0f6
christianmanivong merged commit efe253dc42 into main 2026-10-23 12:53:46 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 12:53:46 +00:00
Sign in to join this conversation.