Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2a3f8c89d | ||
|
|
23bc5f206a | ||
|
|
19ecdce214 | ||
|
|
8ab5999ec7 | ||
|
|
c2bcf61e67 |
No files matched your search
@@ -6,6 +6,16 @@ All notable changes to this driver. The format follows
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- `load_replace_candidate` is `None` instead of a method that raises
|
||||
`NotImplementedError`, so a caller that asks whether the driver can replace a
|
||||
configuration gets no. netOrk offered a config restore for these devices that
|
||||
could only fail (NetOrk/netork#2503).
|
||||
- Python 3.12 is the floor (`requires-python = ">=3.12"`): netOrk runs every driver
|
||||
on 3.12, so 3.10 and 3.11 are no longer tested (NAPALM/driver-standard#6).
|
||||
- The floor on napalm is 5.1: older releases import `pkg_resources`, which a Python
|
||||
3.12 venv no longer has.
|
||||
|
||||
## [0.2.0] - 2026-10-23
|
||||
|
||||
The first release on PyPI.
|
||||
|
||||
@@ -199,10 +199,9 @@ class YealinkDriver(PhoneDriver):
|
||||
def cli(self, commands: list[str], encoding: str = "text") -> dict:
|
||||
raise NotImplementedError
|
||||
|
||||
def load_replace_candidate(
|
||||
self, filename: str | None = None, config: str | None = None
|
||||
) -> None:
|
||||
raise NotImplementedError
|
||||
#: No config replace: switched off rather than a stub that raises, so asking
|
||||
#: whether the driver has one says no (NetOrk/netork#2503).
|
||||
load_replace_candidate = None # type: ignore[assignment]
|
||||
|
||||
def load_merge_candidate(self, filename: str | None = None, config: str | None = None) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
+4
-6
@@ -8,20 +8,18 @@ version = "0.2.0"
|
||||
description = "NAPALM driver for Yealink IP phones and video endpoints"
|
||||
readme = "README.md"
|
||||
license = "Apache-2.0"
|
||||
requires-python = ">=3.10"
|
||||
requires-python = ">=3.12"
|
||||
authors = [
|
||||
{ name = "Christian Manivong" },
|
||||
]
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Topic :: System :: Networking",
|
||||
]
|
||||
dependencies = [
|
||||
"napalm>=4.0",
|
||||
"napalm>=5.1", # older releases import pkg_resources, which a 3.12 venv lacks
|
||||
"napalm-device-types>=4.21.1",
|
||||
"requests>=2.28.0",
|
||||
]
|
||||
@@ -46,7 +44,7 @@ napalm_yealink = ["py.typed"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 100
|
||||
target-version = "py310"
|
||||
target-version = "py312"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "UP", "B"]
|
||||
@@ -56,7 +54,7 @@ select = ["E", "F", "I", "UP", "B"]
|
||||
"tests/**" = ["E501"]
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.10"
|
||||
python_version = "3.12"
|
||||
strict = true
|
||||
# napalm itself is untyped, so every driver subclasses Any.
|
||||
disallow_subclassing_any = false
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
"""The driver cannot replace a device's configuration, and says so by not having the method.
|
||||
|
||||
A ``load_replace_candidate`` that only raises looks like a replace to anyone who asks
|
||||
whether the driver has one: netOrk offered a config restore for these devices that
|
||||
could only fail (NetOrk/netork#2503). ``None`` is how a driver switches off a method
|
||||
it would otherwise inherit, the convention of napalm-device-types and netOrk's
|
||||
capability checks.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from napalm_yealink import YealinkDriver
|
||||
|
||||
|
||||
def test_the_driver_has_no_config_replace():
|
||||
assert YealinkDriver.load_replace_candidate is None
|
||||
assert not callable(getattr(YealinkDriver, "load_replace_candidate", None))
|
||||
Reference in new issue
Block a user