chore: adopt the NAPALM driver standard #9

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

Summary

napalm-openmediavault 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).
  • fix: the five except Exception: pass (OMV version, smartctl per disk, /proc/mdstat, mdadm --detail, shared folder lookup) log at debug level instead (bandit B110); a docstring example is wrapped to 100 columns. No change in returned data.
  • chore: CI in .gitea/workflows/ci.yml calling the shared workflow (napalm-device-types and napalm-linux from git until napalm-linux 0.15.0 is on PyPI); .github/ removed; requires-python >=3.10, SPDX license, setuptools>=77, py.typed, LICENSE, README and CHANGELOG; dependencies napalm-device-types>=4.22.0, napalm-linux>=0.15.0, napalm>=4.0; URLs on git.netork.io. mypy strict for the whole package with no exempt module (_omv_read got a precise return type). Coverage floor 15 % (measured 15.89 %); four long getters and the complexity of get_disks recorded in tests/quality_baseline.json. The committed egg-info and __pycache__ files are untracked.

CI needs napalm-linux 0.15.0 on its main branch (NAPALM/napalm-linux#38) or on PyPI: until then the git pre-install gets 0.14.0 and the install of this package cannot resolve napalm-linux>=0.15.0.

Related Issue

Closes #8

Testing

Locally: 6 tests, coverage 15.89 %, ruff, mypy, bandit clean; lowest versions ok on Python 3.10 (napalm-linux 0.15.0 from its PR branch; also with napalm 4.0.0); napalm-standard check and ratchet clean; build + twine check --strict pass.

## Summary napalm-openmediavault 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). - **fix**: the five `except Exception: pass` (OMV version, smartctl per disk, /proc/mdstat, mdadm --detail, shared folder lookup) log at debug level instead (bandit B110); a docstring example is wrapped to 100 columns. No change in returned data. - **chore**: CI in `.gitea/workflows/ci.yml` calling the shared workflow (napalm-device-types and napalm-linux from git until napalm-linux 0.15.0 is on PyPI); `.github/` removed; requires-python >=3.10, SPDX license, setuptools>=77, `py.typed`, LICENSE, README and CHANGELOG; dependencies napalm-device-types>=4.22.0, napalm-linux>=0.15.0, napalm>=4.0; URLs on git.netork.io. mypy strict for the whole package with no exempt module (`_omv_read` got a precise return type). Coverage floor 15 % (measured 15.89 %); four long getters and the complexity of `get_disks` recorded in `tests/quality_baseline.json`. The committed egg-info and `__pycache__` files are untracked. CI needs napalm-linux 0.15.0 on its main branch (NAPALM/napalm-linux#38) or on PyPI: until then the git pre-install gets 0.14.0 and the install of this package cannot resolve `napalm-linux>=0.15.0`. ## Related Issue Closes #8 ## Testing Locally: 6 tests, coverage 15.89 %, ruff, mypy, bandit clean; lowest versions ok on Python 3.10 (napalm-linux 0.15.0 from its PR branch; also with napalm 4.0.0); `napalm-standard check` and `ratchet` clean; build + `twine check --strict` pass.
christianmanivong added 3 commits 2026-10-23 10:07:20 +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 five except Exception: pass (OMV version, smartctl per disk,
  /proc/mdstat, mdadm --detail, shared folder lookup) now log at debug
  level with the module logger (B110), so a swallowed failure leaves a
  trace. The returned data is unchanged.
- The get_storage_services docstring example is wrapped to 100 columns.
chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 55s
driver / test (3.10) (pull_request) Successful in 58s
driver / test (3.11) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 26s
driver / test (3.12) (pull_request) Successful in 55s
driver / test (3.13) (pull_request) Successful in 48s
driver / build (pull_request) Successful in 24s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 3m0s
driver / publish (pull_request) Skipped
aba36b3b11
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; napalm-device-types and napalm-linux come from
  git until napalm-linux 0.15.0 is on PyPI.
- requires-python >=3.10 (napalm-device-types needs it), SPDX license
  string, setuptools>=77, LICENSE file, py.typed, links to git.netork.io.
- Dependencies: napalm-device-types>=4.22.0, napalm-linux>=0.15.0,
  napalm>=4.0 (tested at 4.0.0); dev extra with pytest, pytest-cov, mypy
  and ruff.
- mypy strict for the whole package, no exempt module: _omv_read is
  annotated as returning list[dict[str, Any]] (types only).
- Coverage floor 15 % (measured 15.89 %); the four long getters and the
  complexity of get_disks are recorded in the quality baseline.
- README (what it is, how it connects, the getters, what it does not do)
  and CHANGELOG are new.
- The committed egg-info and __pycache__ files are untracked; .gitignore
  from the template keeps them, .venv and build output out.
christianmanivong added 1 commit 2026-10-23 14:01:57 +00:00
chore(release): 0.3.0
driver / standard (pull_request) Successful in 13s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 51s
driver / test (3.10) (pull_request) Successful in 57s
driver / test (3.11) (pull_request) Successful in 55s
driver / test (3.12) (pull_request) Successful in 53s
driver / lowest (pull_request) Successful in 24s
driver / test (3.13) (pull_request) Successful in 47s
driver / build (pull_request) Successful in 24s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 3m8s
driver / publish (pull_request) Skipped
e8c09ac37c
christianmanivong merged commit 481f047fff into main 2026-10-23 14:44:39 +00:00
christianmanivong deleted branch chore/driver-standard 2026-10-23 14:44:39 +00:00
Sign in to join this conversation.