Compare commits

..
5 Commits
Author SHA1 Message Date
christianmanivong d2a3f8c89d Merge pull request 'fix(driver): load_replace_candidate is None, not a stub that raises (NetOrk/netork#2503)' (#7) from fix/no-config-replace into main
driver / standard (push) Successful in 14s
driver / lint (push) Successful in 12s
driver / test (3.12) (push) Successful in 47s
driver / types (push) Successful in 54s
driver / lowest (push) Successful in 22s
driver / test (3.13) (push) Successful in 46s
driver / build (push) Successful in 27s
driver / security (push) Successful in 57s
CI / driver (push) Successful in 2m16s
driver / publish (push) Skipped
2026-11-13 21:39:06 +00:00
Christian Manivong 23bc5f206a fix(driver): load_replace_candidate is None, not a stub that raises (NetOrk/netork#2503)
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 50s
driver / test (3.12) (pull_request) Successful in 50s
driver / test (3.13) (pull_request) Successful in 46s
driver / lowest (pull_request) Successful in 23s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m17s
driver / publish (pull_request) Skipped
The driver cannot replace a device's configuration, and said so with a
load_replace_candidate that raised NotImplementedError. A method that only
raises still 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.

None is how a driver switches off a method, the convention netOrk's
capability checks and napalm-device-types follow, so asking now says no.
Nothing in the driver calls it.
2026-11-13 21:45:24 +01:00
christianmanivong 19ecdce214 Merge pull request 'chore: Python 3.12 is the floor (NAPALM/driver-standard#6)' (#6) from chore/python-312-floor into main
driver / standard (push) Successful in 15s
driver / lint (push) Successful in 14s
driver / types (push) Successful in 57s
driver / test (3.12) (push) Successful in 55s
driver / test (3.13) (push) Successful in 48s
driver / lowest (push) Successful in 27s
driver / build (push) Successful in 26s
driver / security (push) Successful in 1m1s
CI / driver (push) Successful in 2m25s
driver / publish (push) Skipped
2026-10-27 10:48:31 +00:00
Christian Manivong 8ab5999ec7 fix: the floor on napalm is 5.1 (NAPALM/driver-standard#6)
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 21s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 58s
driver / lowest (pull_request) Successful in 33s
driver / test (3.13) (pull_request) Successful in 57s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m15s
CI / driver (pull_request) Successful in 2m51s
driver / publish (pull_request) Skipped
napalm 5.0 and older import pkg_resources, which a Python 3.12 venv no
longer has, so the lowest job failed on them.
2026-10-27 10:49:33 +01:00
Christian Manivong c2bcf61e67 chore: Python 3.12 is the floor (NAPALM/driver-standard#6)
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m5s
driver / test (3.12) (pull_request) Successful in 1m2s
driver / test (3.13) (pull_request) Successful in 53s
driver / lowest (pull_request) Failing after 21s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Failing after 2m39s
driver / publish (pull_request) Skipped
netOrk runs every driver in its own containers on Python 3.12, so 3.10
and 3.11 are no longer supported or tested. requires-python, mypy and
ruff move to 3.12, along with what ruff's pyupgrade rules then rewrite.
2026-10-27 10:19:01 +01:00
4 changed files with 34 additions and 10 deletions

No files matched your search

+10
View File
@@ -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.
+3 -4
View File
@@ -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
View File
@@ -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
+17
View File
@@ -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))