fix(packages): architecture is PackageDict's optional key, left out when unnamed (#14) #15

Merged
christianmanivong merged 1 commits from fix/package-architecture-optional into main 2026-12-05 06:41:22 +00:00
Owner

Closes #14

napalm-device-types 4.59.0 (NAPALM/napalm-device-types#149, for NetOrk/netork#2907) declares architecture as an optional key of PackageDict itself. Strict mypy refuses a subclass that makes it required, so WindowsPackageDict has to change.

  • WindowsPackageDict no longer redeclares architecture. It inherits the contract's NotRequired[str].
  • _package leaves architecture out when the Uninstall key names none, as the contract asks. Before, it wrote "". The sort reads p.get("architecture", "").
  • The floor is now napalm-device-types>=4.59.0.
  • CHANGELOG under [Unreleased]. Following this repo's practice, the version is bumped in a separate chore(release) commit, so it stays at 0.3.0 here.

CI will be red until napalm-device-types 4.59.0 is installable. This repo's CI has no pre-install and installs the floor from PyPI, so it stays red until #149 is merged and 4.59.0 is released. To test earlier, add a temporary pre-install of device-types from git, as 63a04c0 did for 4.56.0.

Tests, run against the device-types branch of #149:

  • New tests in tests/test_packages.py: architecture is in WindowsPackageDict.__optional_keys__, and a program with a missing or empty arch leaves the key out and stays sorted by name.
  • Full suite: 640 passed, 99.43% coverage.
  • Also green: strict mypy napalm_windows (before this change it failed with Field "architecture" can be deleted in base class "PackageDict"), ruff check, ruff format --check, napalm-standard ratchet and napalm-standard check.

Priority: P3 (as #14).

Closes #14 napalm-device-types 4.59.0 (NAPALM/napalm-device-types#149, for NetOrk/netork#2907) declares `architecture` as an optional key of `PackageDict` itself. Strict mypy refuses a subclass that makes it required, so `WindowsPackageDict` has to change. - `WindowsPackageDict` no longer redeclares `architecture`. It inherits the contract's `NotRequired[str]`. - `_package` leaves `architecture` out when the Uninstall key names none, as the contract asks. Before, it wrote `""`. The sort reads `p.get("architecture", "")`. - The floor is now `napalm-device-types>=4.59.0`. - CHANGELOG under `[Unreleased]`. Following this repo's practice, the version is bumped in a separate `chore(release)` commit, so it stays at 0.3.0 here. **CI will be red until napalm-device-types 4.59.0 is installable.** This repo's CI has no `pre-install` and installs the floor from PyPI, so it stays red until #149 is merged and 4.59.0 is released. To test earlier, add a temporary `pre-install` of device-types from git, as `63a04c0` did for 4.56.0. Tests, run against the device-types branch of #149: - New tests in `tests/test_packages.py`: `architecture` is in `WindowsPackageDict.__optional_keys__`, and a program with a missing or empty `arch` leaves the key out and stays sorted by name. - Full suite: 640 passed, 99.43% coverage. - Also green: strict `mypy napalm_windows` (before this change it failed with `Field "architecture" can be deleted in base class "PackageDict"`), `ruff check`, `ruff format --check`, `napalm-standard ratchet` and `napalm-standard check`. Priority: P3 (as #14).
christianmanivong added 1 commit 2026-12-05 05:52:56 +00:00
fix(packages): architecture is PackageDict's optional key, left out when unnamed (#14)
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Successful in 18s
driver / lowest (pull_request) Successful in 33s
driver / types (pull_request) Successful in 1m7s
driver / test (3.13) (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 1m14s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Successful in 1m50s
driver / publish (pull_request) Skipped
9b9fd261bd
napalm-device-types 4.59.0 declares architecture as an optional key of
PackageDict. WindowsPackageDict redeclared it as required, which strict
mypy refuses for a subclass. It now inherits the key and leaves it out
of a program whose Uninstall key names none, instead of writing "".
The floor is napalm-device-types 4.59.0.
christianmanivong merged commit 1dc005ff29 into main 2026-12-05 06:41:22 +00:00
christianmanivong deleted branch fix/package-architecture-optional 2026-12-05 06:41:22 +00:00
Sign in to join this conversation.