chore: Python 3.12 is the floor (NAPALM/driver-standard#6) #9

Merged
christianmanivong merged 3 commits from chore/python-312-floor into main 2026-10-27 11:38:15 +00:00
5 changed files with 16 additions and 13 deletions

No files matched your search

+7
View File
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Changed
- 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.
- The floor on PyYAML is 6.0.1: 6.0 has no Python 3.12 wheel and does not build there.
## [0.3.0] - 2026-10-23 ## [0.3.0] - 2026-10-23
The first release on PyPI. The first release on PyPI.
+1 -1
View File
@@ -57,7 +57,7 @@ Unverified assumptions, to be checked against real hardware:
## Install ## Install
Python 3.10 or later. Python 3.12 or later.
```bash ```bash
pip install napalm-vmware pip install napalm-vmware
+2 -4
View File
@@ -9,14 +9,12 @@ from __future__ import annotations
import time import time
from collections.abc import Callable from collections.abc import Callable
from typing import Any, TypeVar from typing import Any
from pyVmomi import vmodl from pyVmomi import vmodl
from napalm_vmware._plain import to_plain from napalm_vmware._plain import to_plain
T = TypeVar("T")
_POLL_SECONDS = 0.5 _POLL_SECONDS = 0.5
_FREE_LICENSE = ( _FREE_LICENSE = (
"the host runs the free vSphere Hypervisor license, which makes the " "the host runs the free vSphere Hypervisor license, which makes the "
@@ -31,7 +29,7 @@ def fault_message(fault: dict[str, Any]) -> str:
return fault.get("localizedMessage") or fault.get("msg") or fault.get("_type", "unknown fault") return fault.get("localizedMessage") or fault.get("msg") or fault.get("_type", "unknown fault")
def invoke(call: Callable[..., T], *args: Any, **kwargs: Any) -> T: def invoke[T](call: Callable[..., T], *args: Any, **kwargs: Any) -> T:
"""Run a vSphere call, re-raising any ``MethodFault`` as ``RuntimeError``.""" """Run a vSphere call, re-raising any ``MethodFault`` as ``RuntimeError``."""
try: try:
return call(*args, **kwargs) return call(*args, **kwargs)
+5 -7
View File
@@ -7,7 +7,7 @@ name = "napalm-vmware"
version = "0.3.0" version = "0.3.0"
description = "NAPALM drivers for VMware ESXi hosts and vCenter Server (vSphere API via pyVmomi)" description = "NAPALM drivers for VMware ESXi hosts and vCenter Server (vSphere API via pyVmomi)"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.12"
license = "Apache-2.0" license = "Apache-2.0"
authors = [ authors = [
{ name = "Christian Manivong", email = "christian@manivong.de" }, { name = "Christian Manivong", email = "christian@manivong.de" },
@@ -19,8 +19,6 @@ classifiers = [
"Intended Audience :: System Administrators", "Intended Audience :: System Administrators",
"Operating System :: OS Independent", "Operating System :: OS Independent",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.13",
"Topic :: System :: Networking", "Topic :: System :: Networking",
@@ -28,13 +26,13 @@ classifiers = [
"Typing :: Typed", "Typing :: Typed",
] ]
dependencies = [ dependencies = [
"napalm>=5.0.0", "napalm>=5.1", # older releases import pkg_resources, which a 3.12 venv lacks
"napalm-device-types>=4.21.1", "napalm-device-types>=4.21.1",
"pyvmomi>=8.0.1", "pyvmomi>=8.0.1",
# Provisioning: download the image, write the NoCloud seed ISO and its YAML. # Provisioning: download the image, write the NoCloud seed ISO and its YAML.
"requests>=2.31", "requests>=2.31",
"pycdlib>=1.14", "pycdlib>=1.14",
"PyYAML>=6.0", "PyYAML>=6.0.1", # 6.0 has no Python 3.12 wheel and does not build there
] ]
[project.optional-dependencies] [project.optional-dependencies]
@@ -69,7 +67,7 @@ markers = [
[tool.ruff] [tool.ruff]
line-length = 100 line-length = 100
target-version = "py310" target-version = "py312"
[tool.ruff.lint] [tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"] select = ["E", "F", "I", "UP", "B"]
@@ -79,7 +77,7 @@ select = ["E", "F", "I", "UP", "B"]
"tests/**" = ["E501"] "tests/**" = ["E501"]
[tool.mypy] [tool.mypy]
python_version = "3.10" python_version = "3.12"
strict = true strict = true
# napalm itself is untyped, so every driver subclasses Any. # napalm itself is untyped, so every driver subclasses Any.
disallow_subclassing_any = false disallow_subclassing_any = false
+1 -1
View File
@@ -54,7 +54,7 @@ def test_lists_are_converted_elementwise():
def test_datetime_becomes_epoch_seconds(): def test_datetime_becomes_epoch_seconds():
when = datetime.datetime(2026, 1, 1, tzinfo=datetime.timezone.utc) when = datetime.datetime(2026, 1, 1, tzinfo=datetime.UTC)
assert to_plain(when) == 1767225600.0 assert to_plain(when) == 1767225600.0