Registry / devops / cmsis-pack-manager

cmsis-pack-manager

JSON →
library0.6.0pypypi✓ verified 24d ago

cmsis-pack-manager is a Python module, Rust crate, and command-line utility designed for managing CMSIS-Pack indexes and caches. It enables users to query for embedded device information such as processor types, flash algorithms, and memory layouts within Python programs or via its `pack-manager` CLI. The library leverages a fast Rust backend for performance. The current stable Python version is 0.6.0, with ongoing development and updates released periodically.

pip install cmsis-pack-manager
INSTALL
IMPORT
SIG · CMSIS-PACK-MANAGER
C
cmsis-pack-manager
devopspythonv0.6.0
Install
2.1s avg
Import
30ms
Disk
33MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.030s · 34MB
33MB installed
● package 33MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Cache
from cmsis_pack_manager import Cache
CmsisPackManager
from cmsis_pack_manager.cmsis_pack_manager import CmsisPackManager
The core manager class is nested within cmsis_pack_manager.cmsis_pack_manager.

This quickstart demonstrates how to initialize the CMSIS-Pack manager and access its cache path. It also shows how to list installed packs, noting that an update is required to fetch packs from online sources. The `update_pdsc_idx()` and `get_device_by_name()` calls are commented out to make the example immediately runnable without network interaction or requiring pre-installed packs, highlighting where user action would be needed.

from cmsis_pack_manager import Cache from cmsis_pack_manager.cmsis_pack_manager import CmsisPackManager # Initialize the cache and manager cache = Cache(False, False) # Args: no_create, no_setup_logging cmsis_manager = CmsisPackManager(cache) print(f"CMSIS-Pack cache directory: {cache.data_path()}") # Update the pack index (requires network access and can take time) # This line is commented out for quickstart to avoid network call by default # cmsis_manager.update_pdsc_idx() # List some installed packs (will be empty if no packs updated/installed) packs = cmsis_manager.get_installed_packs() if packs: print("Installed Packs:") for pack in packs: print(f" - {pack.vendor}::{pack.pack_id}@{pack.version}") else: print("No CMSIS-Packs found in cache. Run `pack-manager update` or `cmsis_manager.update_pdsc_idx()` to fetch them.") # Example: Find a device (requires packs to be installed) # device = cmsis_manager.get_device_by_name("ATSAMD21E15A") # if device: # print(f"Found device: {device.name}, Vendor: {device.vendor}") # else: # print("Device not found. Ensure relevant packs are installed.")
pack-manager --version
Debug
Known issues
gotchaBuilding `cmsis-pack-manager` from source on non-x86 architectures (e.g., ARM-based systems like Raspberry Pi) or with newer Python versions (e.g., Python 3.11) can encounter build failures. This is often due to underlying Rust build requirements or specific `maturin`/`cffi` interactions.
fix
Prefer installing pre-built wheels via `pip install cmsis-pack-manager`. If building from source is necessary, check GitHub issues for specific workarounds, which may involve installing a particular `maturin` branch or temporarily removing `cmsis-pack-manager` from `install_requires` in a `setup.py`/`setup.cfg` file for related projects (e.g., `pyocd`). Ensure a stable Rust compiler is installed and up-to-date if building from source.
affects: All versions when building from source on non-standard architectures/environments, particularly with Python 3.11+ before specific fixes.
breakingPython 3.6 support has been removed in recent development versions. While PyPI metadata currently indicates `>=3.6`, newer internal releases and the Rust backend's evolution have dropped support for older Python versions.
fix
Ensure your project uses Python 3.7 or newer. Python 3.11 is explicitly supported in recent releases.
affects: Development versions beyond 0.2.x; future stable releases.
deprecatedThe `milksnake` runtime dependency was replaced by `maturin` for building the Python bindings to the Rust backend. While this is an internal build change, users compiling from source or relying on specific older build environments might be affected.
fix
This is generally handled by the `pip install` process. If building from source, ensure `maturin` is correctly installed and configured in your build environment.
affects: Versions prior to the change (specific Python `cmsis-pack-manager` version is not clearly documented for this change, but occurred around `cmsis-pack` Rust crate 0.2.x development).
gotchaThe cache directory where CMSIS-Packs are stored, once set, is generally not easily changeable without manually re-downloading packs. While this warning primarily applies to GUI-based pack managers like the Eclipse plugin, the underlying principle of managing a persistent local pack repository applies. Programmatic changes to the cache location might require manual intervention or re-initialization to reflect.
fix
The cache location can be queried using `cmsis_pack_manager.Cache().data_path()`. If a different location is desired, the existing cache might need to be manually moved or cleared, and packs re-downloaded to the new location.
affects: All versions.
Errors
Common errors & fixes
error: subprocess-exited-with-error × Building wheel for cmsis-pack-manager (pyproject.toml) did not run successfully.
This error occurs when the Rust backend of cmsis-pack-manager fails to compile during installation, often due to missing Python development headers, a C compiler, or platform-specific build issues.
fix
Ensure you have a stable Rust toolchain installed (`rustup install stable`), Python development headers (e.g., `python3-dev` on Debian/Ubuntu, `python-devel` on Fedora), and try `pip install maturin cffi` before installing `cmsis-pack-manager`.
pack-manager: command not found
The `pack-manager` command-line utility, which is part of the `cmsis-pack-manager` Python package, is not accessible in your system's PATH, or the installation was incomplete.
fix
Ensure your Python environment's script directory (e.g., `venv/bin` or `Python/Scripts`) is added to your system's PATH. Alternatively, invoke the CLI directly using `python -m cmsis_pack_manager.pack_manager <command>`.
ERRO download of ... Its TLS configuration doesn't include any modern ciphers ... rustls crate refuses to connect
The `cmsis-pack-manager` Rust backend (using `rustls`) often fails to download CMSIS packs or indexes from older servers (like Keil.com) due to their outdated TLS configurations or unexpected HTTP redirects.
fix
This is often a server-side issue. Workarounds include manually downloading the problematic packs from the vendor's website and installing them locally, or ensuring no firewall/proxy is interfering with the connection.
ModuleNotFoundError: No module named 'cmsis_pack_manager'
The `cmsis-pack-manager` Python package is either not installed in the active Python environment or the Python interpreter being used cannot locate it.
fix
Install the package using pip: `pip install cmsis-pack-manager`. If using a virtual environment, ensure it is activated. Verify that the Python interpreter running your code is the one where the package was installed.
Upgrade
Version history
0.6.0latest on PyPI · released Jun 27, 2025
Audit
Dependencies
appdirsrequiredUsed for determining appropriate user-specific paths for cache and data directories.
cffirequiredUsed for Python to C Foreign Function Interface, enabling communication with the Rust backend.
pyyamlrequiredLikely used for parsing or handling YAML-based configuration or pack metadata.
Agent activity
7 hits · last 30 days
node
6
Resources
cmsis-pack-manager — pip install cmsis-pack-manager · libregistry