The local interface was the second dotted part of the key, so the neighbours of eth0.1 landed under eth0 with every field missed. The remote port was read from port.ifname or port.id.value, and lldpd prints a port given by MAC or local id as port.mac / port.local, never as id.value, so that port came back empty. lldpd's output now goes through napalm-device-types' parse_lldpctl_keyvalue and its two NAPALM projections, which keep the interface name up to the neighbour's first field and read the ids under whatever type lldpd prints. The detail gains the system description and capabilities on the way. The module is under strict mypy now; the floor on napalm-device-types rises to 4.24.0. Closes #26
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.24.0",
|
|
"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
|