driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 53s
driver / test (3.12) (pull_request) Successful in 58s
driver / test (3.13) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 27s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m26s
driver / publish (pull_request) Skipped
netOrk aligns every device's time sources and zone through the driver (NetOrk/netork#2360); for APs that replaces the UCI commands netOrk built itself for the AP profile fields (NetOrk/netork#2364). Both values live in UCI's system config: - The servers are system.ntp.server. A write replaces the list, enables the client, sets use_dhcp=0 so the servers of a DHCP lease are not added, and restarts sysntpd: the router ends up with exactly these. A disabled client reads as no servers. - The zone is zonename (the IANA name, in LuCI's spelling with spaces) and timezone, the POSIX rule from posix_tz that libc reads as TZ. The rule is what counts (NetOrk/netork#1849), so the name is read as the zone only where the rule in force is that zone's; a rule alone reads as the one zone that has it, or None where several share it. A write sets both, reloads /etc/init.d/system and restarts logd, which reads the zone at start. netOrk aligns on every poll, so each step compares first and writes and restarts nothing when the router already has the values. GMT0 (the stock rule) counts as UTC's time. get_ntp_servers now uses the same reading, so it agrees with get_time_sync; it used to keep only the first server of a list, as uci prints a list as 'a' 'b' on one line. synchronized is None: BusyBox ntpd keeps no state to read. The floor on napalm-device-types is 4.35.0, the first with TimeSyncMixin.
91 lines
2.3 KiB
TOML
91 lines
2.3 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=77"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "napalm-openwrt"
|
|
version = "0.7.0"
|
|
description = "NAPALM driver for OpenWrt routers/access-points"
|
|
readme = "README.md"
|
|
license = "Apache-2.0"
|
|
requires-python = ">=3.12"
|
|
authors = [
|
|
{ name = "Christian Manivong" },
|
|
]
|
|
classifiers = [
|
|
"Topic :: Utilities",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Operating System :: POSIX :: Linux",
|
|
"Operating System :: MacOS",
|
|
]
|
|
dependencies = [
|
|
"napalm>=5.1", # older releases import pkg_resources, which a 3.12 venv lacks
|
|
"napalm_device_types>=4.35.0", # TimeSyncMixin, posix_tz
|
|
"netmiko>=4.0.0",
|
|
"paramiko>=5.0.0", # CVE-2026-44405
|
|
"netaddr>=0.7.19", # IPAddress; below it the package has none (CI lowest job)
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
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://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 = "py312"
|
|
|
|
[tool.ruff.lint]
|
|
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.12"
|
|
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.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
|