chore: adopt the NAPALM driver standard #6

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

Summary

napalm-sonos 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: open() raises ConnectionException ... from the SoCo error (B904); the swallowed exception in _check_wired_connection is logged at debug level (B110); nosec for the empty password default (B107, a Sonos speaker takes no login); tests raise AssertionError instead of assert False (B011).
  • chore: CI in .gitea/ calling the shared workflow, .github/ removed; napalm-device-types >=4.21.1 declared (the driver imports it, it was never a dependency); requires-python >=3.10; LICENSE, README, CHANGELOG, py.typed, SPDX license, setuptools>=77, dev extra floors, URLs on git.netork.io; strict mypy with napalm_sonos.sonos_driver exempt; coverage floor 71 %; quality baseline.

Related Issue

Closes #5

Testing

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

## Summary napalm-sonos 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**: `open()` raises `ConnectionException ... from` the SoCo error (B904); the swallowed exception in `_check_wired_connection` is logged at debug level (B110); nosec for the empty password default (B107, a Sonos speaker takes no login); tests raise `AssertionError` instead of `assert False` (B011). - **chore**: CI in .gitea/ calling the shared workflow, .github/ removed; napalm-device-types >=4.21.1 declared (the driver imports it, it was never a dependency); requires-python >=3.10; LICENSE, README, CHANGELOG, py.typed, SPDX license, setuptools>=77, dev extra floors, URLs on git.netork.io; strict mypy with napalm_sonos.sonos_driver exempt; coverage floor 71 %; quality baseline. ## Related Issue Closes #5 ## Testing Locally: 24 tests, coverage 71.30 %, ruff, mypy, bandit clean; `napalm-standard check` and `ratchet` clean; build + `twine check --strict` pass.
christianmanivong added 3 commits 2026-10-23 07:00:29 +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.
- open() raises ConnectionException from the SoCo error (B904), so the
  cause stays attached.
- _check_wired_connection: the except Exception: pass (B110) now logs at
  debug level, so a swallowed failure leaves a trace. A module logger is
  new.
- nosec for the empty password default (B107): a Sonos speaker takes no
  login, the argument exists for NAPALM's constructor signature.
- tests: raise AssertionError instead of assert False (B011).
chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 45s
driver / test (3.10) (pull_request) Successful in 2m40s
driver / test (3.11) (pull_request) Successful in 2m40s
driver / test (3.12) (pull_request) Successful in 2m37s
driver / test (3.13) (pull_request) Successful in 2m34s
driver / lowest (pull_request) Successful in 2m16s
driver / security (pull_request) Successful in 47s
driver / build (pull_request) Successful in 22s
CI / driver (pull_request) Successful in 15m6s
driver / publish (pull_request) Skipped
168841ebb8
- 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 is now declared: the driver imports
  MediaDriver, PortSpec and FingerprintRule from it, and CI used to
  install it by hand.
- requires-python >=3.10 (napalm-device-types needs it), LICENSE, README,
  CHANGELOG, py.typed, SPDX license string, setuptools>=77, version floors
  on the dev extra, links to git.netork.io; .gitignore as in the template.
- mypy strict for the package; napalm_sonos.sonos_driver is exempt for now
  (5 errors, two of them return types that differ from MediaDriver's),
  recorded in the quality baseline.
- Coverage floor 71 % (measured 71.30 %).
christianmanivong added 1 commit 2026-10-23 14:01:56 +00:00
chore(release): 0.3.0
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 47s
driver / test (3.10) (pull_request) Successful in 2m44s
driver / test (3.11) (pull_request) Successful in 2m46s
driver / test (3.12) (pull_request) Successful in 2m41s
driver / security (pull_request) Successful in 47s
driver / build (pull_request) Successful in 22s
driver / test (3.13) (pull_request) Successful in 2m35s
driver / lowest (pull_request) Successful in 2m18s
CI / driver (pull_request) Successful in 5m55s
driver / publish (pull_request) Skipped
89698c5bd6
christianmanivong merged commit a0a43de734 into main 2026-10-23 14:42:36 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 14:42:36 +00:00
Sign in to join this conversation.