chore: adopt the NAPALM driver standard #5

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

Summary

napalm-yealink 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 MD5 of the password is the login API's wire format, not a protection of ours: hashlib.md5(..., usedforsecurity=False) (B324, same digest); a failed logout and an unreadable system info log at debug level (B110).
  • chore: CI in .gitea/workflows/ci.yml via the shared workflow, .github/ removed; license = "Apache-2.0" and LICENSE (none was declared); floors napalm-device-types>=4.21.1, napalm>=4.0, requests>=2.28.0 (unfloored, the lowest job picks napalm 0.10, which does not build); README, CHANGELOG.md, py.typed, URLs on git.netork.io, dev extra; strict mypy with yealink exempt (20 errors), quality baseline, coverage floor 42 %.

Related Issue

Closes #4

Testing

Locally: 13 tests, coverage 42.61 %, 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-yealink 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 MD5 of the password is the login API's wire format, not a protection of ours: `hashlib.md5(..., usedforsecurity=False)` (B324, same digest); a failed logout and an unreadable system info log at debug level (B110). - **chore**: CI in `.gitea/workflows/ci.yml` via the shared workflow, `.github/` removed; `license = "Apache-2.0"` and LICENSE (none was declared); floors `napalm-device-types>=4.21.1`, `napalm>=4.0`, `requests>=2.28.0` (unfloored, the lowest job picks napalm 0.10, which does not build); README, CHANGELOG.md, `py.typed`, URLs on git.netork.io, dev extra; strict mypy with `yealink` exempt (20 errors), quality baseline, coverage floor 42 %. ## Related Issue Closes #4 ## Testing Locally: 13 tests, coverage 42.61 %, 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:46:21 +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 MD5 of the password is what the phone's login API expects, the wire
  format and no protection of ours (the session runs over HTTPS):
  hashlib.md5(..., usedforsecurity=False) (B324). The digest is the same.
- A failed logout in close() and an unreadable system info in get_facts()
  now log at debug level (B110), so a swallowed failure leaves a trace; the
  module gets its logger.
- The comment on the "yealink" fingerprint rule moves above it (ruff
  format had split the line around it) and is in English.
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 47s
driver / test (3.12) (pull_request) Successful in 44s
driver / test (3.13) (pull_request) Successful in 41s
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 5m35s
driver / publish (pull_request) Skipped
75869eae06
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ is gone.
- license = "Apache-2.0" and a LICENSE file: the package declared no
  license at all. README and CHANGELOG.md, py.typed, links to
  git.netork.io, a dev extra with floors; .venv/ and build output ignored.
- Floors on every dependency: napalm-device-types>=4.21.1 (had none),
  napalm>=4.0 (what napalm-device-types needs) and requests>=2.28.0.
  Without them the lowest CI job resolves napalm 0.10, which does not
  build; the tests pass at exactly these floors.
- mypy strict for the package; napalm_yealink.yealink is exempt for now
  (20 errors), recorded in the quality baseline with get_facts'
  complexity. Coverage floor 42 % (measured 42.61 %).

Closes #4
christianmanivong added 1 commit 2026-10-23 08:29:08 +00:00
chore(release): 0.2.0
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 53s
driver / test (3.10) (pull_request) Successful in 55s
driver / test (3.11) (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 52s
driver / test (3.13) (pull_request) Successful in 48s
driver / lowest (pull_request) Successful in 29s
driver / security (pull_request) Successful in 56s
driver / build (pull_request) Successful in 30s
CI / driver (pull_request) Successful in 6m46s
driver / publish (pull_request) Skipped
d56da13b4c
christianmanivong merged commit b03fa0e6a1 into main 2026-10-23 10:28:53 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 10:28:53 +00:00
Sign in to join this conversation.