chore: adopt the NAPALM driver standard #38

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

Summary

napalm-linux adopts the NAPALM driver standard
(https://git.netork.io/NAPALM/driver-standard, STANDARDS.md); second repo of the pilot,
after napalm-device-types (NAPALM/napalm-device-types#52).

Changes

  • style: ruff format + ruff check --fix with the standard's rules. No behaviour change.
  • fix: long shell lines split; a dead loop in get_os_users removed (output
    unchanged); the five except Exception: pass log at debug level (bandit B110);
    nosec for two bandit false positives; test lint.
  • chore: CI in .gitea/ calling the shared workflow (device-types from git until
    it is on PyPI); requires-python >=3.10; LICENSE; py.typed; SPDX license; links to
    git.netork.io; strict mypy with napalm_linux.linux exempt for now (21 errors) and
    recorded in the quality baseline; coverage floor 58 %.

The default branch stays master in this PR; renaming it to main is a separate step.

Related Issue

NetOrk/netork#734

Testing

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

## Summary napalm-linux adopts the NAPALM driver standard (https://git.netork.io/NAPALM/driver-standard, STANDARDS.md); second repo of the pilot, after napalm-device-types (NAPALM/napalm-device-types#52). ## Changes - **style**: ruff format + ruff check --fix with the standard's rules. No behaviour change. - **fix**: long shell lines split; a dead loop in `get_os_users` removed (output unchanged); the five `except Exception: pass` log at debug level (bandit B110); nosec for two bandit false positives; test lint. - **chore**: CI in `.gitea/` calling the shared workflow (device-types from git until it is on PyPI); `requires-python >=3.10`; LICENSE; `py.typed`; SPDX license; links to git.netork.io; strict mypy with `napalm_linux.linux` exempt for now (21 errors) and recorded in the quality baseline; coverage floor 58 %. The default branch stays `master` in this PR; renaming it to `main` is a separate step. ## Related Issue NetOrk/netork#734 ## Testing Locally: 212 tests, coverage 58.23 %, ruff, mypy, bandit clean; `napalm-standard check` and `ratchet` clean; build + `twine check --strict` pass.
christianmanivong added 3 commits 2026-10-22 17:12:12 +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.
- Long shell command lines are split into adjacent string literals.
- get_os_users: a first loop over /etc/group filled a map nobody read;
  it is gone, the output is unchanged.
- The five except Exception: pass now log at debug level (B110), so a
  swallowed failure leaves a trace.
- nosec for the staging path on the device (B108) and the sudo hint
  message (B105); both are false positives.
- tests: raise ... from exc, unused loop variable.
chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 56s
driver / lint (pull_request) Successful in 49s
driver / types (pull_request) Failing after 1m6s
driver / test (3.10) (pull_request) Failing after 5m48s
driver / test (3.11) (pull_request) Failing after 3m11s
driver / test (3.12) (pull_request) Successful in 2m48s
driver / test (3.13) (pull_request) Successful in 4m16s
driver / lowest (pull_request) Successful in 4m47s
driver / security (pull_request) Successful in 6m8s
driver / build (pull_request) Failing after 52s
CI / driver (pull_request) Failing after 30m42s
driver / publish (pull_request) Skipped
9b3ac3f3eb
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; napalm-device-types comes from git until it is
  on PyPI.
- requires-python >=3.10 (napalm-device-types needs it), LICENSE file,
  py.typed, SPDX license string, links to git.netork.io.
- mypy strict for the package; napalm_linux.linux is exempt for now (21
  errors), recorded in the quality baseline with its long functions and
  the 2200-line module. Coverage floor 58 % (measured 58.23 %).
christianmanivong added 1 commit 2026-10-23 06:29:21 +00:00
Merge remote-tracking branch 'origin/master' into chore/driver-standard
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Failing after 42s
driver / test (3.10) (pull_request) Failing after 38s
driver / test (3.11) (pull_request) Failing after 38s
driver / test (3.12) (pull_request) Failing after 33s
driver / test (3.13) (pull_request) Failing after 30s
driver / lowest (pull_request) Failing after 17s
driver / security (pull_request) Failing after 45s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Failing after 4m51s
driver / publish (pull_request) Skipped
e0960085c7
# Conflicts:
#	napalm_linux/linux.py
christianmanivong added 1 commit 2026-10-23 06:29:33 +00:00
ci: say which napalm-device-types the git install waits for
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Failing after 41s
driver / test (3.10) (pull_request) Failing after 38s
driver / test (3.11) (pull_request) Failing after 38s
driver / test (3.12) (pull_request) Failing after 35s
driver / test (3.13) (pull_request) Failing after 31s
driver / lowest (pull_request) Failing after 19s
driver / security (pull_request) Failing after 46s
driver / build (pull_request) Successful in 23s
CI / driver (pull_request) Failing after 4m55s
driver / publish (pull_request) Skipped
cc0e0358f2
christianmanivong added 1 commit 2026-10-23 10:02:11 +00:00
chore(release): 0.15.0
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 54s
driver / test (3.10) (pull_request) Successful in 59s
driver / test (3.11) (pull_request) Successful in 58s
driver / lowest (pull_request) Successful in 29s
driver / test (3.12) (pull_request) Successful in 56s
driver / test (3.13) (pull_request) Successful in 52s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m42s
driver / publish (pull_request) Skipped
9a4bc76dbf
christianmanivong merged commit 3aa1955382 into main 2026-10-23 12:55:55 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 12:55:55 +00:00
Sign in to join this conversation.