chore: adopt the NAPALM driver standard #9

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

Summary

napalm-zyxel 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: justified nosec for SHA512_password in the login payload (B105: an encoding flag, not a password); a failed login raises ConnectionException from the underlying error; tests use pytest.raises instead of assert False (B011).
  • chore: CI in .gitea/workflows/ci.yml via the shared workflow, .github/ removed; Python >= 3.10, napalm-device-types>=4.21.1, SPDX license, LICENSE, py.typed, URLs on git.netork.io, dev extra; README (pyproject pointed at a missing one) and CHANGELOG.md; strict mypy with zyxel_driver exempt (24 errors), quality baseline, coverage floor 68 %.

Related Issue

Closes #8

Testing

Locally: 32 tests, coverage 68.97 %, ruff, mypy, bandit clean; napalm-standard check and ratchet clean; build + twine check --strict pass; the tests also pass at the declared floors (uv pip install --resolution lowest-direct, Python 3.10). Fixtures only.

## Summary napalm-zyxel 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**: justified nosec for `SHA512_password` in the login payload (B105: an encoding flag, not a password); a failed login raises `ConnectionException` from the underlying error; tests use `pytest.raises` instead of `assert False` (B011). - **chore**: CI in `.gitea/workflows/ci.yml` via the shared workflow, `.github/` removed; Python >= 3.10, `napalm-device-types>=4.21.1`, SPDX license, LICENSE, `py.typed`, URLs on git.netork.io, dev extra; README (pyproject pointed at a missing one) and CHANGELOG.md; strict mypy with `zyxel_driver` exempt (24 errors), quality baseline, coverage floor 68 %. ## Related Issue Closes #8 ## Testing Locally: 32 tests, coverage 68.97 %, ruff, mypy, bandit clean; `napalm-standard check` and `ratchet` clean; build + `twine check --strict` pass; the tests also pass at the declared floors (`uv pip install --resolution lowest-direct`, Python 3.10). Fixtures only.
christianmanivong added 3 commits 2026-10-23 06:40:47 +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.
- nosec for SHA512_password in the login payload (B105): it is a flag
  telling the gateway how Input_Passwd is encoded, not a password; a false
  positive.
- A failed login raises ConnectionException from the underlying error, so
  the cause stays attached.
- tests: pytest.raises instead of try / assert False / except, which
  python -O would have turned into tests that always pass.
chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 42s
driver / test (3.10) (pull_request) Successful in 3m25s
driver / test (3.11) (pull_request) Successful in 3m23s
driver / test (3.12) (pull_request) Successful in 3m25s
driver / test (3.13) (pull_request) Successful in 3m19s
driver / lowest (pull_request) Successful in 3m7s
driver / security (pull_request) Successful in 53s
driver / build (pull_request) Successful in 34s
CI / driver (pull_request) Successful in 19m12s
driver / publish (pull_request) Skipped
51b8cda3e4
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ is gone.
- requires-python >=3.10 (napalm-device-types needs it), floor
  napalm-device-types>=4.21.1 (was napalm_device_types>=0.4.0), LICENSE
  file, py.typed, SPDX license string, links to git.netork.io, a dev extra
  with floors.
- README (pyproject named one that did not exist) and CHANGELOG.md.
- mypy strict for the package; napalm_zyxel.zyxel_driver is exempt for now
  (24 errors), recorded in the quality baseline with its two complex
  functions. Coverage floor 68 % (measured 68.97 %).

Closes #8
christianmanivong added 1 commit 2026-10-23 08:29:08 +00:00
chore(release): 0.3.0
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 43s
driver / test (3.10) (pull_request) Successful in 3m24s
driver / test (3.11) (pull_request) Successful in 3m25s
driver / test (3.12) (pull_request) Successful in 3m34s
driver / test (3.13) (pull_request) Successful in 3m22s
driver / lowest (pull_request) Successful in 3m2s
driver / security (pull_request) Successful in 47s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 19m4s
driver / publish (pull_request) Skipped
d8c3a149cc
christianmanivong merged commit b4bd6ae4be into main 2026-10-23 10:22:33 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 10:22:33 +00:00
Sign in to join this conversation.