chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m0s
driver / test (3.10) (pull_request) Successful in 1m9s
driver / test (3.11) (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 46s
driver / test (3.13) (pull_request) Successful in 55s
driver / lowest (pull_request) Failing after 25s
driver / security (pull_request) Successful in 1m0s
driver / build (pull_request) Successful in 26s
CI / driver (pull_request) Failing after 7m18s
driver / publish (pull_request) Skipped

- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ is gone.
- requires-python >=3.10 (napalm-device-types needs it), napalm-device-types
  >=4.21.1, LICENSE file, py.typed, SPDX license string, a dev extra with
  floors, links to git.netork.io (README included), CHANGELOG.md.
- mypy strict for the package; exempt for now, with 130 errors between
  them: napalm_openwrt.config_mixin, .interfaces_mixin, .lldp_mixin,
  .openwrt, .packages_mixin, .routing_mixin, .system_mixin, .vlan_mixin and
  .wireless_mixin. They are recorded in the quality baseline with the long
  and complex functions and the one unannotated public method.
- Coverage floor 65 % (measured 65.03 %).
This commit is contained in:
Christian Manivong committed 2026-10-23 08:35:03 +02:00
1 parent 8b8905f0c7
commit 6d884898c7
8 files changed
+330 -65

No files matched your search

+45 -14
View File
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=64", "wheel"]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
@@ -7,17 +7,14 @@ name = "napalm-openwrt"
version = "0.6.0"
description = "NAPALM driver for OpenWrt routers/access-points"
readme = "README.md"
license = { text = "Apache-2.0" }
requires-python = ">=3.8"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "Christian Manivong" },
]
classifiers = [
"Topic :: Utilities",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
@@ -26,30 +23,30 @@ classifiers = [
]
dependencies = [
"napalm>=4.0.0",
"napalm_device_types>=4.19.0",
"napalm_device_types>=4.21.1",
"netmiko>=4.0.0",
"paramiko>=5.0.0", # CVE-2026-44405
"netaddr",
]
[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"black",
"ruff",
]
dev = ["pytest>=8", "pytest-cov>=5", "mypy>=1.11", "ruff>=0.6"]
[project.entry-points."napalm.drivers"]
openwrt = "napalm_openwrt:OpenWrtDriver"
[project.urls]
Repository = "https://github.com/napalm-automation-community/napalm-openwrt"
Repository = "https://git.netork.io/NAPALM/napalm-openwrt"
Issues = "https://git.netork.io/NAPALM/napalm-openwrt/issues"
Changelog = "https://git.netork.io/NAPALM/napalm-openwrt/src/branch/main/CHANGELOG.md"
[tool.setuptools.packages.find]
where = ["."]
include = ["napalm_openwrt*"]
[tool.setuptools.package-data]
napalm_openwrt = ["py.typed"]
[tool.ruff]
line-length = 100
target-version = "py310"
@@ -60,3 +57,37 @@ select = ["E", "F", "I", "UP", "B"]
[tool.ruff.lint.per-file-ignores]
# Recorded device output keeps its lines.
"tests/**" = ["E501"]
[tool.mypy]
python_version = "3.10"
strict = true
# napalm itself is untyped, so every driver subclasses Any.
disallow_subclassing_any = false
[[tool.mypy.overrides]]
module = ["napalm.*", "netmiko.*", "paramiko.*", "netaddr.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Not yet under strict mypy (quality baseline); may only shrink.
module = [
"napalm_openwrt.config_mixin",
"napalm_openwrt.interfaces_mixin",
"napalm_openwrt.lldp_mixin",
"napalm_openwrt.openwrt",
"napalm_openwrt.packages_mixin",
"napalm_openwrt.routing_mixin",
"napalm_openwrt.system_mixin",
"napalm_openwrt.vlan_mixin",
"napalm_openwrt.wireless_mixin",
]
ignore_errors = true
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.coverage.run]
source = ["napalm_openwrt"]
[tool.coverage.report]
fail_under = 65