chore: adopt the NAPALM driver standard #20

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

Summary

napalm-bsd 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: nosec for the staging path on the device (B108, a mktemp template on the remote host) and for the wildcard listen address parsed from sockstat/netstat (B104, reported data, never a bind), now a named constant. No behaviour change.
  • chore: CI in .gitea/ calling the shared workflow, .github/ removed; napalm-device-types >=4.21.1 from PyPI; py.typed, SPDX license, setuptools>=77, dev extra floors, Issues/Changelog URLs; strict mypy with napalm_bsd.base, napalm_bsd.freebsd and napalm_bsd.openbsd exempt; coverage floor 94 %; quality baseline; CHANGELOG entry.

Related Issue

Closes #19

Testing

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

## Summary napalm-bsd 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: nosec for the staging path on the device (B108, a mktemp template on the remote host) and for the wildcard listen address parsed from sockstat/netstat (B104, reported data, never a bind), now a named constant. No behaviour change. - **chore**: CI in .gitea/ calling the shared workflow, .github/ removed; napalm-device-types >=4.21.1 from PyPI; py.typed, SPDX license, setuptools>=77, dev extra floors, Issues/Changelog URLs; strict mypy with napalm_bsd.base, napalm_bsd.freebsd and napalm_bsd.openbsd exempt; coverage floor 94 %; quality baseline; CHANGELOG entry. ## Related Issue Closes #19 ## Testing Locally: 138 tests, coverage 94.63 %, ruff, mypy, bandit clean; `napalm-standard check` and `ratchet` clean; build + `twine check --strict` pass.
christianmanivong added 3 commits 2026-10-23 06:35:08 +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 the staging path on the device (B108); it is a mktemp
  template on the remote host, not a local temp file.
- The wildcard listen addresses parsed from sockstat/netstat are named
  constants with a nosec (B104): reported 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 13s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 43s
driver / test (3.10) (pull_request) Successful in 58s
driver / test (3.11) (pull_request) Successful in 48s
driver / test (3.12) (pull_request) Successful in 47s
driver / test (3.13) (pull_request) Successful in 39s
driver / lowest (pull_request) Successful in 24s
driver / security (pull_request) Successful in 1m2s
driver / build (pull_request) Successful in 25s
CI / driver (pull_request) Successful in 6m10s
driver / publish (pull_request) Skipped
121343ee51
- 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 README no longer installs
  it from git), py.typed, SPDX license string, setuptools>=77, version
  floors on the dev extra, Issues and Changelog links on git.netork.io.
- mypy strict for the package; napalm_bsd.base, napalm_bsd.freebsd and
  napalm_bsd.openbsd are exempt for now (28 errors, mostly getters typed
  as plain dicts rather than the device-types TypedDicts), recorded in the
  quality baseline with three complex parsers. parse.py is strict after a
  one-line annotation.
- Coverage floor 94 % (measured 94.63 %).
christianmanivong added 1 commit 2026-10-23 08:29:02 +00:00
chore(release): 0.5.0
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 43s
driver / test (3.10) (pull_request) Successful in 45s
driver / test (3.11) (pull_request) Successful in 45s
driver / test (3.12) (pull_request) Successful in 42s
driver / test (3.13) (pull_request) Successful in 39s
driver / lowest (pull_request) Successful in 21s
driver / security (pull_request) Successful in 54s
driver / build (pull_request) Successful in 27s
CI / driver (pull_request) Successful in 5m40s
driver / publish (pull_request) Skipped
040a073863
christianmanivong merged commit 7ca6827421 into main 2026-10-23 09:40:30 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 09:40:30 +00:00
Sign in to join this conversation.