feat: each package's architecture, 0.28.0 (NetOrk/netork#2907) #95

Open
christianmanivong wants to merge 1 commits from feat/package-architecture into main
pull from: feat/package-architecture
Owner

Driver half of NetOrk/netork#2907, on napalm-device-types 4.59.0 (NAPALM/napalm-device-types#149).

A multiarch host lists one name twice: libc6 for amd64 and for i386 on Debian, glibc for x86_64 and for i686 on an rpm host. get_packages() now reports each package's architecture, so the two are told apart:

  • dpkg: ${Architecture} (amd64, i386, all). It goes in before ${binary:Summary}, which stays last and keeps its tabs. An empty value is left out.
  • rpm: %{ARCH} (x86_64, i686, noarch), also before the summary. rpm writes (none) for a package without an architecture (gpg-pubkey); such a package leaves the key out.
  • apk and pacman leave it out. Alpine and Arch install one architecture per host, and their listings (apk info -v, pacman -Q) do not name it, so it was not cheap to add.
  • _rpm no longer postpones its annotations. Until now, RpmPackageDict.source_rpm read as a required key at runtime. This is the same bug as napalm-device-types#144.
  • The parsers read their fields through a small _field helper, which keeps _package and parse_rpm_query within complexity 10.
  • The floor is napalm-device-types>=4.59.0. Merge #149 in napalm-device-types first: this PR's CI pre-installs device-types from main, so lowest and test stay red until it is merged (re-run CI then).

Version 0.28.0, CHANGELOG and README updated.

Tests: new tests/test_package_architecture.py (dpkg and rpm multiarch, empty or (none) architecture, optional keys at runtime). The fixtures in tests/test_linux.py now follow the new column layout. Run against the device-types branch: full suite 491 passed, 79.75% coverage (floor 57). Also green: ruff check, ruff format --check, mypy napalm_linux (strict), napalm-standard ratchet and napalm-standard check.

Priority: P4 (as NetOrk/netork#2907).

Driver half of NetOrk/netork#2907, on napalm-device-types 4.59.0 (NAPALM/napalm-device-types#149). A multiarch host lists one name twice: `libc6` for amd64 and for i386 on Debian, `glibc` for x86_64 and for i686 on an rpm host. `get_packages()` now reports each package's `architecture`, so the two are told apart: - **dpkg:** `${Architecture}` (`amd64`, `i386`, `all`). It goes in before `${binary:Summary}`, which stays last and keeps its tabs. An empty value is left out. - **rpm:** `%{ARCH}` (`x86_64`, `i686`, `noarch`), also before the summary. rpm writes `(none)` for a package without an architecture (`gpg-pubkey`); such a package leaves the key out. - **apk and pacman** leave it out. Alpine and Arch install one architecture per host, and their listings (`apk info -v`, `pacman -Q`) do not name it, so it was not cheap to add. - `_rpm` no longer postpones its annotations. Until now, `RpmPackageDict.source_rpm` read as a required key at runtime. This is the same bug as napalm-device-types#144. - The parsers read their fields through a small `_field` helper, which keeps `_package` and `parse_rpm_query` within complexity 10. - The floor is `napalm-device-types>=4.59.0`. **Merge #149 in napalm-device-types first**: this PR's CI pre-installs device-types from `main`, so `lowest` and `test` stay red until it is merged (re-run CI then). Version 0.28.0, CHANGELOG and README updated. Tests: new `tests/test_package_architecture.py` (dpkg and rpm multiarch, empty or `(none)` architecture, optional keys at runtime). The fixtures in `tests/test_linux.py` now follow the new column layout. Run against the device-types branch: full suite 491 passed, 79.75% coverage (floor 57). Also green: `ruff check`, `ruff format --check`, `mypy napalm_linux` (strict), `napalm-standard ratchet` and `napalm-standard check`. Priority: P4 (as NetOrk/netork#2907).
christianmanivong added 1 commit 2026-12-05 00:32:23 +00:00
feat: each package's architecture, 0.28.0 (NetOrk/netork#2907)
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Failing after 38s
driver / types (pull_request) Failing after 46s
driver / lowest (pull_request) Failing after 19s
driver / test (3.13) (pull_request) Failing after 43s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Failing after 55s
CI / driver (pull_request) Failing after 1m49s
driver / publish (pull_request) Skipped
40cb888da7
A multiarch host lists one name twice: libc6 for amd64 and for i386,
glibc for x86_64 and for i686. get_packages now reads dpkg's
${Architecture} and rpm's %{ARCH}, before the summary that stays last,
and reports it as PackageDict.architecture (napalm-device-types
4.59.0, the new floor). apk and pacman leave it out.

_rpm no longer postpones its annotations, so source_rpm is optional at
runtime too.
Some required checks failed
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / test (3.12) (pull_request) Failing after 38s
driver / types (pull_request) Failing after 46s
driver / lowest (pull_request) Failing after 19s
driver / test (3.13) (pull_request) Failing after 43s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Failing after 55s
CI / driver (pull_request) Failing after 1m49s
driver / publish (pull_request) Skipped
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/package-architecture:feat/package-architecture
git checkout feat/package-architecture
Sign in to join this conversation.