chore: adopt the NAPALM driver standard #19

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

Summary

napalm-hpe-aruba-procurve 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: the six except Exception: pass log at debug level (B110); nosec with a reason for comparing a reported address with 0.0.0.0 (B104) and the empty password field of get_users (B105, now a named constant); one long message split; the failed-open test expects ConnectionException; raise ... from exc in a test.
  • chore: CI in .gitea/workflows/ci.yml calling the shared workflow, .github/ removed; Python 3.10 floor, SPDX license, LICENSE, CHANGELOG, py.typed, URLs on git.netork.io; napalm-device-types >=4.21.1; [tool.napalm-standard] package = "napalm_procurve"; true floors for netaddr (>=0.7.10) and urllib3 (>=1.23), without which the lowest job cannot import on Python 3.10; strict mypy with api_client, parsers and procurve exempt for now; coverage floor 54 %; quality baseline.

Related Issue

Closes #18

Testing

Locally: 92 tests, coverage 54.28 %, ruff, mypy, bandit clean; napalm-standard check and ratchet clean; build + twine check --strict pass. The lowest job's install (uv --resolution lowest-direct, Python 3.10) passes too. Fixtures only.

## Summary napalm-hpe-aruba-procurve 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**: the six `except Exception: pass` log at debug level (B110); nosec with a reason for comparing a reported address with `0.0.0.0` (B104) and the empty `password` field of `get_users` (B105, now a named constant); one long message split; the failed-open test expects `ConnectionException`; `raise ... from exc` in a test. - **chore**: CI in `.gitea/workflows/ci.yml` calling the shared workflow, `.github/` removed; Python 3.10 floor, SPDX license, LICENSE, CHANGELOG, `py.typed`, URLs on git.netork.io; napalm-device-types >=4.21.1; `[tool.napalm-standard] package = "napalm_procurve"`; true floors for netaddr (>=0.7.10) and urllib3 (>=1.23), without which the lowest job cannot import on Python 3.10; strict mypy with `api_client`, `parsers` and `procurve` exempt for now; coverage floor 54 %; quality baseline. ## Related Issue Closes #18 ## Testing Locally: 92 tests, coverage 54.28 %, ruff, mypy, bandit clean; `napalm-standard check` and `ratchet` clean; build + `twine check --strict` pass. The lowest job's install (`uv --resolution lowest-direct`, Python 3.10) passes too. Fixtures only.
christianmanivong added 3 commits 2026-10-23 06:40:39 +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.
- The six except Exception: pass (REST logout, the extra-ports lookup, the
  per-port detail in get_interfaces, closing CLI and REST sessions) now log
  at debug level (B110), so a swallowed failure leaves a trace.
- nosec for comparing a reported address with 0.0.0.0 (B104) and for the
  empty password field of get_users (B105, now a named constant); both are
  false positives.
- A long error message is split into adjacent f-strings; the unused ARP
  entry type is named _entry_type.
- tests: the failed-open test expects ConnectionException instead of any
  Exception; raise ... from exc.
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 44s
driver / test (3.10) (pull_request) Successful in 45s
driver / test (3.11) (pull_request) Successful in 44s
driver / test (3.12) (pull_request) Successful in 43s
driver / test (3.13) (pull_request) Successful in 37s
driver / lowest (pull_request) Successful in 22s
driver / security (pull_request) Successful in 46s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 5m28s
driver / publish (pull_request) Skipped
779b42c193
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ goes.
- requires-python >=3.10 (napalm-device-types needs it), LICENSE file,
  CHANGELOG, py.typed, SPDX license string, links to git.netork.io;
  napalm-device-types >=4.21.1, a dev extra with floors.
- [tool.napalm-standard] names the import package napalm_procurve, which is
  not the distribution name.
- True floors for netaddr (>=0.7.10) and urllib3 (>=1.23): unbounded, the
  lowest job installed versions that do not import on Python 3.10.
- mypy strict for the package; napalm_procurve.api_client, .parsers and
  .procurve are exempt for now (136 errors), recorded in the quality
  baseline with their long functions and the 1400-line procurve.py.
  Coverage floor 54 % (measured 54.28 %).
christianmanivong added 1 commit 2026-10-23 08:29:04 +00:00
chore(release): 0.6.0
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 46s
driver / test (3.10) (pull_request) Successful in 52s
driver / test (3.11) (pull_request) Successful in 54s
driver / test (3.12) (pull_request) Successful in 47s
driver / test (3.13) (pull_request) Successful in 40s
driver / lowest (pull_request) Successful in 24s
driver / security (pull_request) Successful in 46s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 5m59s
driver / publish (pull_request) Skipped
1a7cf93709
christianmanivong merged commit b842aa5763 into main 2026-10-23 09:46:46 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 09:46:46 +00:00
Sign in to join this conversation.