cmsis-pack-manager is a python module, Rust crate and command line utility for managing current device information that is stored in many CMSIS PACKs

Overview

cmsis-pack-manager

cmsis-pack-manager is a python module, Rust crate and command line utility for managing current device information that is stored in many CMSIS PACKs. Users of cmsis-pack-manager may query for information such as processor type, flash algorithm and memory layout information in a python program or through the command line utility, pack-manager, provided as part of this module.

CI Status

Windows Build status Mac and Linux Build Status

Wheels

The last step of CI uploads binary wheels to this S3 bucket.

DOCS!

They live here: https://pyocd.github.io/cmsis-pack-manager/

Building

To build cmsis-pack-manager locally, Install a stable rust compiler. See https://rustup.rs/ for details on installing rustup, the rust toolchain updater. Afterwards, run rustup update stable to get the most recent stable rust toolchain and build system.

After installing the rust toolchain and downloading a stable compiler, run python2 setup.py bdist_wheel from the root of this repo to generate a binary wheel (.whl file) in the same way as we release.

For testing purposes, there is a CLI written in Rust within the rust workspace as the package cmsis-cli. For example From the rust directory, cargo run -p cmsis-cli -- update builds this testing CLI and runs the update command, for example.

Comments
  • Using pack manager on arm-based system

    Using pack manager on arm-based system

    I've tried to install newest pyocd version on armbian, but when trying to install it even with pip, every time installed version of pack manager is 0.1. Is it possible to install newest version of pack manager on arm-based system? sorry for newbie question, but i've tried to google it, without any results.

    opened by harrrson 33
  • build problem on FreeBSD

    build problem on FreeBSD

    Hello world, I have problem building on FreeBSD.. any hints welcome :-)

    (venv37bsd) python setup.py -v install
    fatal: not a git repository (or any parent up to mount point /ztuff)
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
    running install
    running bdist_egg
    running egg_info
    writing cmsis_pack_manager.egg-info/PKG-INFO
    writing dependency_links to cmsis_pack_manager.egg-info/dependency_links.txt
    writing entry points to cmsis_pack_manager.egg-info/entry_points.txt
    writing requirements to cmsis_pack_manager.egg-info/requires.txt
    writing top-level names to cmsis_pack_manager.egg-info/top_level.txt
    'license_file' option was not specified
    reading manifest file 'cmsis_pack_manager.egg-info/SOURCES.txt'
    writing manifest file 'cmsis_pack_manager.egg-info/SOURCES.txt'
    installing library code to build/bdist.freebsd-12.0-RELEASE-p3-amd64/egg
    running install_lib
    running build_py
    not copying cmsis_pack_manager/__init__.py (output up-to-date)
    not copying cmsis_pack_manager/pack_manager.py (output up-to-date)
    error: [Errno 2] No such file or directory: 'cargo': 'cargo'
    
    (venv37bsd) pip show cargo
    Name: cargo
    Version: 0.1.1
    Summary: Transform dictionaries into Python objects
    Home-page: github.com/eugene-eeo/cargo
    Author: Eugene Eeo
    Author-email: [email protected]
    License: UNKNOWN
    Location: /ztuff/cederom/(..)/venv37bsd/lib/python3.7/site-packages
    Requires:
    Required-by:
    
    (venv37bsd) python --version
    Python 3.7.3
    
    (venv37bsd) uname -a
    FreeBSD 0xCFC2 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC  amd64
    
    (venv37bsd) ls
    LICENSE                         appveyor.yml                    cmsis_pack_manager.egg-info     setup.py
    README.md                       build                           requirements.txt                setup_requirements.txt
    apache-2.0.txt                  build-wheels.sh                 rust                            test_requirements.txt
    appveyor.bat                    cmsis_pack_manager              setup.cfg                       tests
    (venv37bsd)
    

    Would be really nice if cmsis-pack-manager was also provided in PyPI as sources so it can be automtically compiled by pip on platforms that have no binaries provided :-)

    opened by cederom 33
  • Switch HTTP implementation to `reqwest`

    Switch HTTP implementation to `reqwest`

    The prior HTTP implementation was hyper, and provided a low level of abstraction. This low level required me to implement redirect and proxy support. I omitted proxy support.

    Now, we use reqwest to handle HTTP. This allows us to delete our custom (but not special) redirect support and pick up proxy support.


    Note: This contains format changes and a minor refactor (move vidx/pidx-related code to methods on DownloadContext)

    opened by theotherjimmy 21
  • Install with pip >=20 always triggers build

    Install with pip >=20 always triggers build

    Downgrading to < 20 uses wheel.

    $ pip --version
    pip 20.0.1 from /home/juho/py3/lib/python3.5/site-packages/pip (python 3.5)
    (py3) juho@ub:~$ pip install cmsis-pack-manager
    Collecting cmsis-pack-manager
      Using cached cmsis-pack-manager-0.2.9.tar.gz (42 kB)
    Collecting appdirs>=1.4
      Using cached appdirs-1.4.3-py2.py3-none-any.whl (12 kB)
    Collecting milksnake>=0.1.2
      Using cached milksnake-0.1.5-py2.py3-none-any.whl (9.6 kB)
    Processing ./.cache/pip/wheels/e4/76/4d/a95b8dd7b452b69e8ed4f68b69e1b55e12c9c9624dd962b191/PyYAML-5.3-cp35-cp35m-linux_x86_64.whl
    Collecting cffi>=1.6.0
      Using cached cffi-1.13.2-cp35-cp35m-manylinux1_x86_64.whl (397 kB)
    Processing ./.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511/pycparser-2.19-py2.py3-none-any.whl
    Building wheels for collected packages: cmsis-pack-manager
      Building wheel for cmsis-pack-manager (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-tar7vy6_
           cwd: /tmp/pip-install-aa67zdj0/cmsis-pack-manager/
      Complete output (9 lines):
      running bdist_wheel
      running build
      running build_py
      creating build/lib
      creating build/lib/cmsis_pack_manager
      copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
      copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
      copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
      error: [Errno 2] No such file or directory: 'cargo'
      ----------------------------------------
      ERROR: Failed building wheel for cmsis-pack-manager
      Running setup.py clean for cmsis-pack-manager
    Failed to build cmsis-pack-manager
    Installing collected packages: appdirs, pycparser, cffi, milksnake, pyyaml, cmsis-pack-manager
        Running setup.py install for cmsis-pack-manager ... error
        ERROR: Command errored out with exit status 1:
         command: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jt_ysbz4/install-record.txt --single-version-externally-managed --compile --install-headers /home/juho/py3/include/site/python3.5/cmsis-pack-manager
             cwd: /tmp/pip-install-aa67zdj0/cmsis-pack-manager/
        Complete output (9 lines):
        running install
        running build
        running build_py
        creating build/lib
        creating build/lib/cmsis_pack_manager
        copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
        copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
        copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
        error: [Errno 2] No such file or directory: 'cargo'
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jt_ysbz4/install-record.txt --single-version-externally-managed --compile --install-headers /home/juho/py3/include/site/python3.5/cmsis-pack-manager Check the logs for full command output.
    (py3) juho@ub:~$ pip install pip==19.3.1
    Collecting pip==19.3.1
      Using cached pip-19.3.1-py2.py3-none-any.whl (1.4 MB)
    Installing collected packages: pip
      Attempting uninstall: pip
        Found existing installation: pip 20.0.1
        Uninstalling pip-20.0.1:
          Successfully uninstalled pip-20.0.1
    Successfully installed pip-19.3.1
    (py3) juho@ub:~$ pip install cmsis-pack-manager
    Collecting cmsis-pack-manager
      Using cached https://files.pythonhosted.org/packages/fd/6b/b1f8f4117b3a4efafbdb04eaa7e7685a395cda565b3b221860d04f2a827c/cmsis_pack_manager-0.2.9-py2.py3-none-manylinux1_x86_64.whl
    Requirement already satisfied: pyyaml>=3.12 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (5.3)
    Requirement already satisfied: milksnake>=0.1.2 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (0.1.5)
    Requirement already satisfied: appdirs>=1.4 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (1.4.3)
    Requirement already satisfied: cffi>=1.6.0 in ./py3/lib/python3.5/site-packages (from milksnake>=0.1.2->cmsis-pack-manager) (1.13.2)
    Requirement already satisfied: pycparser in ./py3/lib/python3.5/site-packages (from cffi>=1.6.0->milksnake>=0.1.2->cmsis-pack-manager) (2.19)
    Installing collected packages: cmsis-pack-manager
    Successfully installed cmsis-pack-manager-0.2.9
    WARNING: You are using pip version 19.3.1; however, version 20.0 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    
    opened by juhhov 15
  • cmsis-pack-manager 0.1.1

    cmsis-pack-manager 0.1.1

    on a raspberry pi running ubuntu 18.04.2 "pip3 install pyocd" complains about "cmsis-pack-manager 0.1.1":

    ERROR: pyocd 0.21.0 has requirement cmsis-pack-manager>=0.2.7, but you'll have cmsis-pack-manager 0.1.1 which is incompatible.
    Installing collected packages: cmsis-pack-manager
      Found existing installation: cmsis-pack-manager 0.1.1
        Uninstalling cmsis-pack-manager-0.1.1:
          Successfully uninstalled cmsis-pack-manager-0.1.1
    Successfully installed cmsis-pack-manager-0.1.1
    

    upon investigation, this https://github.com/ARMmbed/cmsis-pack-manager/blob/e26f87d797715aa2f5111b6333e0908dea8ece80/setup.py#L55

    seems to be the cause.

    after downloading 0.2.8 source tarball from pypi, changing "0.1.1" to "0.2.8", building cmsis-pack-manager and installation in a new virtualenv, installation of pyocd finally succeeds.

    opened by rmu75 9
  • Add HTTP proxy support

    Add HTTP proxy support

    This is a request to add support for the http_proxy environment variable so that the index and packs can be downloaded through a proxy server.

    See below from @jeromecoutant in mbedmicro/pyOCD#638. The gist is that curl is able to access the Keil index files from a corporate network behind a proxy, where CPM cannot (it fails with a DNS error).

    Hi Back to this issue... I agree that I have some network/PC restrictions due to company policy...
    $ pyocd pack --install stm32f303
    0000348:INFO:__main__:No pack index present, downloading now...
    May 03 11:43:05.522 ERRO No such host is known. (os error 11001), uri: http://www.keil.com/pack/keil.vidx
    May 03 11:43:05.523 ERRO No such host is known. (os error 11001), uri: http://www.keil.com/pack/keil.pidx
    

    OK

    $ curl -L http://www.keil.com/pack/keil.vidx -O
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  5668  100  5668    0     0  21308      0 --:--:-- --:--:-- --:--:-- 21308
    100  9622  100  9622    0     0  17590      0 --:--:-- --:--:-- --:--:-- 17590
    
    $ curl -L http://www.keil.com/pack/keil.pidx -O
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  5672  100  5672    0     0  60340      0 --:--:-- --:--:-- --:--:-- 60340
    100 14216  100 14216    0     0  19771      0 --:--:-- --:--:-- --:--:-- 19771
    

    Seems that curl is calling directly GET HTTP function, whereas pack manager use first DNS call without any proxy setting.

    All commands using http_proxy environment variable are working (git clone, curl, …)

    So it seems that restrictions I have could be avoid ?

    enhancement 
    opened by flit 8
  • Error Building Wheel with Python 3.11

    Error Building Wheel with Python 3.11

    I was attempting to update my Zephyr workspace after updating to Fedora 37 and it seems as though the wheel for cmsis-pack-manager no longer builds:

    (.venv) [mbanducci zephyr]$ pip install cmsis-pack-manager
    Collecting cmsis-pack-manager
      Using cached cmsis-pack-manager-0.4.0.tar.gz (43 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting appdirs<2.0,>=1.4
      Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
    Collecting milksnake<1.0,>=0.1.5
      Using cached milksnake-0.1.5-py2.py3-none-any.whl (9.6 kB)
    Requirement already satisfied: pyyaml<7.0,>=6.0 in /home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages (from cmsis-pack-manager) (6.0)
    Collecting cffi>=1.6.0
      Using cached cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (462 kB)
    Collecting pycparser
      Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
    Building wheels for collected packages: cmsis-pack-manager
      Building wheel for cmsis-pack-manager (pyproject.toml) ... error
      error: subprocess-exited-with-error
      
      × Building wheel for cmsis-pack-manager (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [285 lines of output]
          /tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
            warnings.warn(msg, warning_class)
          running bdist_wheel
          running build
          running build_py
          creating build/lib
          creating build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/_native__ffi.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/_native.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
              Updating crates.io index
             Compiling libc v0.2.137
             Compiling autocfg v1.1.0
             Compiling cfg-if v1.0.0
             Compiling cfg-if v0.1.10
             Compiling futures v0.1.31
             Compiling log v0.4.17
             Compiling byteorder v1.4.3
             Compiling semver-parser v0.7.0
             Compiling either v1.8.0
             Compiling maybe-uninit v2.0.0
             Compiling lazy_static v1.4.0
             Compiling cc v1.0.76
             Compiling scopeguard v1.1.0
             Compiling proc-macro2 v1.0.47
             Compiling unicode-ident v1.0.5
             Compiling quote v1.0.21
             Compiling fnv v1.0.7
             Compiling tinyvec_macros v0.1.0
             Compiling syn v1.0.103
             Compiling rand_core v0.4.2
             Compiling unicode-bidi v0.3.8
             Compiling once_cell v1.16.0
             Compiling version_check v0.9.4
             Compiling spin v0.5.2
             Compiling untrusted v0.7.1
             Compiling tinyvec v1.6.0
             Compiling memchr v2.5.0
             Compiling lock_api v0.3.4
             Compiling matches v0.1.9
             Compiling serde_derive v1.0.147
             Compiling itoa v0.4.8
             Compiling serde v1.0.147
             Compiling semver v0.9.0
             Compiling autocfg v0.1.8
             Compiling adler v1.0.2
             Compiling rand_core v0.3.1
             Compiling httparse v1.8.0
             Compiling failure_derive v0.1.8
             Compiling hashbrown v0.12.3
             Compiling percent-encoding v1.0.1
             Compiling miniz_oxide v0.5.4
             Compiling gimli v0.26.2
             Compiling percent-encoding v2.2.0
             Compiling unicode-xid v0.2.4
             Compiling rustc_version v0.2.3
             Compiling crossbeam-utils v0.7.2
             Compiling slab v0.4.7
             Compiling memoffset v0.5.6
             Compiling crossbeam-epoch v0.8.2
             Compiling unicase v2.6.0
             Compiling smallvec v0.6.14
             Compiling indexmap v1.9.1
             Compiling rand_pcg v0.1.2
             Compiling rand_chacha v0.1.1
             Compiling form_urlencoded v1.1.0
             Compiling rand v0.6.5
             Compiling num-traits v0.2.15
             Compiling base64 v0.10.1
             Compiling rustc-demangle v0.1.21
             Compiling parking_lot_core v0.6.2
             Compiling parking_lot v0.9.0
             Compiling hyper v0.12.36
             Compiling try-lock v0.2.3
             Compiling serde_json v1.0.87
             Compiling crc32fast v1.3.2
             Compiling num-integer v0.1.45
             Compiling object v0.29.0
             Compiling unicode-normalization v0.1.22
             Compiling rand_xorshift v0.1.1
             Compiling rand_hc v0.1.0
             Compiling rand_isaac v0.1.1
             Compiling rand_jitter v0.1.4
             Compiling ryu v1.0.11
             Compiling encoding_rs v0.8.31
             Compiling iovec v0.1.4
             Compiling num_cpus v1.14.0
             Compiling net2 v0.2.38
             Compiling ring v0.16.20
             Compiling tokio-sync v0.1.8
             Compiling bytes v0.4.12
             Compiling time v0.1.44
             Compiling backtrace v0.3.66
             Compiling want v0.2.0
             Compiling mime_guess v2.0.4
             Compiling rand_os v0.1.3
             Compiling itoa v1.0.4
             Compiling try_from v0.3.2
             Compiling tokio-executor v0.1.10
             Compiling mio v0.6.23
             Compiling crossbeam-queue v0.2.3
             Compiling futures-cpupool v0.1.8
             Compiling mime v0.3.16
             Compiling dtoa v0.4.8
             Compiling crossbeam-utils v0.8.12
             Compiling idna v0.1.5
             Compiling tokio-current-thread v0.1.7
             Compiling tokio-timer v0.2.13
             Compiling tokio-io v0.1.13
             Compiling http v0.1.21
             Compiling string v0.2.1
             Compiling crossbeam-deque v0.7.4
             Compiling tokio-buf v0.1.1
             Compiling idna v0.3.0
             Compiling idna v0.2.3
             Compiling flate2 v1.0.24
             Compiling dirs-sys v0.3.7
             Compiling quick-xml v0.17.2
             Compiling scoped-tls v0.1.2
             Compiling iana-time-zone v0.1.53
             Compiling tokio-threadpool v0.1.18
             Compiling unicode-width v0.1.10
             Compiling dirs v4.0.0
             Compiling termcolor v1.1.3
             Compiling tokio-codec v0.1.2
             Compiling xdg v2.4.1
             Compiling textwrap v0.11.0
             Compiling atty v0.2.14
             Compiling strsim v0.8.0
             Compiling url v1.7.2
             Compiling tokio-reactor v0.1.12
             Compiling mio-uds v0.6.8
             Compiling url v2.3.1
             Compiling uuid v0.7.4
             Compiling tokio-fs v0.1.7
             Compiling minidom v0.12.0
             Compiling crossbeam-channel v0.5.6
             Compiling bitflags v1.3.2
             Compiling ansi_term v0.12.1
             Compiling vec_map v0.8.2
             Compiling tokio-tcp v0.1.4
             Compiling tokio-uds v0.2.7
             Compiling tokio-udp v0.1.6
             Compiling app_dirs v1.2.1
             Compiling clap v2.34.0
             Compiling chrono v0.4.23
             Compiling cookie v0.12.0
             Compiling tokio v0.1.22
             Compiling publicsuffix v1.5.6
             Compiling pbr v1.0.4
             Compiling addr2line v0.17.0
             Compiling tokio-core v0.1.18
             Compiling sct v0.6.1
             Compiling webpki v0.21.4
             Compiling http-body v0.1.0
             Compiling h2 v0.1.26
             Compiling ct-logs v0.6.0
             Compiling rustls v0.16.0
             Compiling webpki-roots v0.17.0
             Compiling simplelog v0.8.0
             Compiling synstructure v0.12.6
             Compiling tokio-rustls v0.10.3
             Compiling ctor v0.1.26
             Compiling failure v0.1.8
             Compiling hyper-rustls v0.17.1
             Compiling serde_urlencoded v0.5.5
             Compiling cookie_store v0.7.0
             Compiling reqwest v0.9.24
             Compiling cmsis-pack v0.3.0 (/tmp/pip-install-t1h86i5d/cmsis-pack-manager_0df7306226554d2ab758737493fb3cfd/rust/cmsis-pack)
          warning: fields `name`, `description` and `doc` are never read
             --> cmsis-pack/src/pdsc/component.rs:160:5
              |
          159 | pub struct Bundle {
              |            ------ fields in this struct
          160 |     name: String,
              |     ^^^^
          ...
          164 |     description: String,
              |     ^^^^^^^^^^^
          165 |     doc: String,
              |     ^^^
              |
              = note: `#[warn(dead_code)]` on by default
              = note: `Bundle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
          
             Compiling cmsis-cli v0.3.0 (/tmp/pip-install-t1h86i5d/cmsis-pack-manager_0df7306226554d2ab758737493fb3cfd/rust/cmsis-cli)
          warning: `cmsis-pack` (lib) generated 1 warning
             Compiling cmsis-cffi v0.3.0 (/tmp/pip-install-t1h86i5d/cmsis-pack-manager_0df7306226554d2ab758737493fb3cfd/rust/cmsis-cffi)
          warning: unused return value of `std::mem::replace` that must be used
             --> cmsis-cffi/src/pack_index.rs:145:13
              |
          145 |             mem::replace(boxed.borrow_mut(), next_state);
              |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              |
              = note: `#[warn(unused_must_use)]` on by default
              = note: if you don't need the old value, you can just assign the new value directly
          
          warning: unused return value of `std::mem::replace` that must be used
             --> cmsis-cffi/src/pack_index.rs:191:13
              |
          191 |             mem::replace(boxed.borrow_mut(), next_state);
              |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              |
              = note: if you don't need the old value, you can just assign the new value directly
          
          warning: `cmsis-cffi` (lib) generated 2 warnings
              Finished release [optimized] target(s) in 28.11s
          copying dylib libcmsis_cffi.so
          Traceback (most recent call last):
            File "/home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
              main()
            File "/home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
              return _build_backend().build_wheel(wheel_directory, config_settings,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 412, in build_wheel
              return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
              self.run_setup()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
              exec(code, locals())
            File "<string>", line 66, in <module>
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
              return distutils.core.setup(**attrs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
              return run_commands(dist)
                     ^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
              dist.run_commands()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
              self.run_command(cmd)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 325, in run
              self.run_command("build")
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
              self.distribution.run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
              self.run_command(cmd_name)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
              self.distribution.run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/setuptools_ext.py", line 88, in run
              func(base_path=base_path, inplace=False)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/setuptools_ext.py", line 276, in build_cffi
              ffi = make_ffi()
                    ^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/setuptools_ext.py", line 262, in make_ffi
              from milksnake.ffi import make_ffi
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/ffi.py", line 8, in <module>
              _directive_re = re.compile(r'^\s*#.*?$(?m)')
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/__init__.py", line 227, in compile
              return _compile(pattern, flags)
                     ^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/__init__.py", line 294, in _compile
              p = _compiler.compile(pattern, flags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_compiler.py", line 743, in compile
              p = _parser.parse(p, flags)
                  ^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_parser.py", line 980, in parse
              p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_parser.py", line 455, in _parse_sub
              itemsappend(_parse(source, state, verbose, nested + 1,
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_parser.py", line 841, in _parse
              raise source.error('global flags not at the start '
          re.error: global flags not at the start of the expression at position 9
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for cmsis-pack-manager
    Failed to build cmsis-pack-manager
    ERROR: Could not build wheels for cmsis-pack-manager, which is required to install pyproject.toml-based projects
    

    Other notes:

    • This was all working fine on Fedora 36 immediately before the reboot, which defaults to Python 3.10
    • I checked to ensure I had python3-devel installed, just in case, but adding it did not alter behavior
    • I tried to install cmsis-pack-manager both inside of and outside of my Zephyr venv with identical results
    opened by banduccm 5
  • Fix clippy lints

    Fix clippy lints

    I fixed all the clipply lints.

    Somehow now cbindgen doesn't generate bindings for many of the extern "C" functions. Also, python2 setup.py bdist_wheel as stated in the readme does not work at all. It tells me that bdist_wheel is no valid command.

    Maybe you can have a look and help me get this right (I fix it myself, I just need a hint)

    opened by Yatekii 5
  • Failure to download STM32F4xx DFP

    Failure to download STM32F4xx DFP

    If the Python API is used to download the Keil::STM32F4xx_DFP::2.13.0 pack, you get this file instead:

    <?xml version="1.0" encoding="utf-8"?><Error><Code>BlobNotFound</Code><Message>The specified blob does not exist.
    RequestId:00ffc5ad-601e-00b2-3a34-f61678000000
    Time:2019-04-18T22:14:45.2212973Z</Message></Error>
    

    Downloading manually from http://www.keil.com/dd2/pack works fine.

    priority 
    opened by flit 5
  • Consider replacing milksnake with maturin

    Consider replacing milksnake with maturin

    Hi! It looks like maturin is the more actively maintained project, whereas milksnake appears rather dead (no release in four years, open pull requests are ignored).

    Would it be possible for this project to facilitate maturin instead of milksnake (unless I'm misinterpreting the scope).

    I'm asking this because I'm packaging maturin on Arch Linux already and packaging a rather undead package for building cmsis-pack-manager could potentially be circumvented.

    opened by dvzrv 4
  • Purge slog for more ergonomic usage

    Purge slog for more ergonomic usage

    I removed slog from the crate to make usage more ergonomic and similar to what other crates do mostly.

    There is no real replacement for the kv-replacement feature of slog. I tried my best to keep the information logged as before, but surely it wount be 100% the same.

    Also, I used simplelog, which should generate nice, colored terminal output.

    If anything is unsound, please point me to it, I'll hapily fix it.

    opened by Yatekii 4
  • the pdsc parser doesn't handle families well

    the pdsc parser doesn't handle families well

    The pdsc does nothing to part the elements of the famly tag under the package/devices tag. This means that things like the debugconfig and sequences are not available via parsing. It would be pretty awesome to parse the families more fully.

    It looks like the builder suffers similarly and doesn't know how to build a pdsc with multiple families.

    opened by wt 0
  • Too many concurrent requests trigger DoS protection

    Too many concurrent requests trigger DoS protection

    CPM is too aggressive in parallelizing the index download. While this is great for index update performance, it can trigger the servers' CDN's DoS protection and the requests are blocked. Only Keil and NXP CDNs seem to have this response (they both use Akamai).

    Specifically what happens is that the request queue can result in many concurrent requests targeted at one server. If the number of requests is greater than the maximum allowed per source IP, the requests are blocked and either a 403 or other error is returned. After triggering the DoS protection, typically all new requests from the source IP are blocked for a timeout period.

    This is made far worse by #162 and #155, since the responses are not checked and the HTML error page included in the response is saved to the .pdsc index file (and then you get PDSC parse errors, of course).

    The solution is to throttle the number of concurrent requests. It would be nice to have a maximum per server domain, but limiting the total number is a good first step that would solve the issue.

    A while back I wrote the cmsis-pack-index-monitor script to explore this issue outside of CPM. You can use it to see the problem for yourself and experiment with a maximum number of jobs.

    opened by flit 0
  • cmsis-pack crate does not respect local configuration of root certificates

    cmsis-pack crate does not respect local configuration of root certificates

    Cache is unable to download packs in enterprise environments with "transparent" TLS-terminating middleboxes:

    $ pack-manager cache packs
    Caching all packs; this will take some time. Press Control-C to quit.
    20:57:14 [WARN] Sending fatal alert BadCertificate
    20:57:14 [ERROR] https://sadevicepacksprodus.blob.core.windows.net/idxfile/index.pidx: error trying to connect: invalid certificate: UnknownIssuer
    

    reqwest supports bundling Mozilla's root certificates (rusttls-tls, i.e., rust-tls-webpki-roots) or using the platform's native certificate store (rustls-tls-native-roots). See rustls-native-certs for a comparison of the two approaches.

    Consider switching from rust-tls-webpki-roots to rustls-tls-native-roots to support enterprise environments with "transparent" TLS-terminating middleboxes.

    opened by claymation 0
  • PYD libraries can't be loaded in 32bit Python on Windows

    PYD libraries can't be loaded in 32bit Python on Windows

    Hello, In version 0.3.0 I'm getting the following error when starting 'pack-manager' (or more generally 'pyocd')

    OSError: cannot load library '...venv_39_32\lib\site-packages\cmsis_pack_manager_native__lib.cp39-win32.pyd': error 0xc1

    This error occurs on Python 3.6 up to 3.9, but only in the 32bit versions. It would seem that the 32bit versions of wheels contain 64bit libraries because on 64bit Python everything works just fine (I've tried Python 3.6 up to 3.9)

    Best Regards, Michal

    bug os: windows 
    opened by mstarecek 12
  • Fine grained download control and version status

    Fine grained download control and version status

    Currently the only the entire set of PDSCs can be cached as a whole.

    It would be very useful to have the abilities to separately:

    • Download only the index.
    • Determine if and which PDSCs and (downloaded) packs are out of date (or entirely new)
    • Download/update specified PDSCs.

    The primary use case is to quickly check for new PDSCs and versions of already downloaded packs, and then download only those that are needed. Specifically, it would be highly useful if pyocd could quickly check for a new PDSC/pack, and potentially download it, when it is connecting to a target.

    opened by flit 0
Releases(v0.5.1)
Owner
pyocd
Organisation for pyOCD and related projects
pyocd
A Python module and command line utility for working with web archive data using the WACZ format specification

py-wacz The py-wacz repository contains a Python module and command line utility for working with web archive data using the WACZ format specification

Webrecorder 14 Oct 24, 2022
A Python module and command-line utility for converting .ANS format ANSI art to HTML

ansipants A Python module and command-line utility for converting .ANS format ANSI art to HTML. Installation pip install ansipants Command-line usage

null 4 Oct 16, 2022
💻VIEN is a command-line tool for managing Python Virtual Environments.

vien VIEN is a command-line tool for managing Python Virtual Environments. It provides one-line shortcuts for: creating and deleting environments runn

Artёm IG 5 Mar 19, 2022
Command-line program for organizing and managing ebook collections

Command-line program for organizing and managing ebook collections. It is a Python port from the original shell scripts ebook-tools

Raul 14 Nov 12, 2022
This is a tool for managing file notes through the command line

This is a tool for managing file notes through the command line

null 2 Jun 22, 2022
A command line tool to query source code from your current Python env

wxc wxc (pronounced "which") allows you to inspect source code in your Python environment from the command line. It is based on the inspect module fro

Clément Robert 13 Nov 8, 2022
pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo

pyGinit pyGinit is a command line tools that help you to initialize your current project a local git repo and remote repo Requirements Requirements be

AlphaBeta 15 Feb 26, 2022
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Stream your favorite shows straight from the command line.

A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Jonardon Hazarika 17 Dec 11, 2022
Command line tool to keep track of your favorite playlists on YouTube and many other places.

Command line tool to keep track of your favorite playlists on YouTube and many other places.

Wolfgang Popp 144 Jan 5, 2023
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

null 18.6k Dec 30, 2022
split-manga-pages: a command line utility written in Python that converts your double-page layout manga to single-page layout.

split-manga-pages split-manga-pages is a command line utility written in Python that converts your double-page layout manga (or any images in double p

Christoffer Aakre 3 May 24, 2022
A Python command-line utility for validating that the outputs of a given Declarative Form Azure Portal UI JSON template map to the input parameters of a given ARM Deployment Template JSON template

A Python command-line utility for validating that the outputs of a given Declarative Form Azure Portal UI JSON template map to the input parameters of a given ARM Deployment Template JSON template

Glenn Musa 1 Feb 3, 2022
Library and command-line utility for rendering projects templates.

A library for rendering project templates. Works with local paths and git URLs. Your project can include any file and Copier can dynamically replace v

null 808 Jan 4, 2023
A handy command-line utility for generating and sending iCalendar events

A handy command-line utility for generating and sending iCalendar events This simple command-line utility is designed to generate an iCalendar event,

Baochun Li 17 Nov 21, 2022
Baseline is a cross-platform library and command-line utility that creates file-oriented baselines of your systems.

Baselining, on steroids! Baseline is a cross-platform library and command-line utility that creates file-oriented baselines of your systems. The proje

Nelson 4 Dec 9, 2022
🔖 Lemnos: A simple, light-weight command-line to-do list manager.

?? Lemnos: CLI To-do List Manager This is a simple program that allows one to manage a to-do list via the command-line. Example $ python3 todo.py add

Rohan Sikand 1 Dec 7, 2022
A command line utility to export Google Keep notes to markdown.

Keep-Exporter A command line utility to export Google Keep notes to markdown files with metadata stored as a frontmatter header. Supports exporting: S

Nathan Beals 85 Dec 17, 2022
A command line utility for tracking a stock market portfolio. Primarily featuring high resolution braille graphs.

A command line stock market / portfolio tracker originally insipred by Ericm's Stonks program, featuring unicode for incredibly high detailed graphs even in a terminal.

Conrad Selig 51 Nov 29, 2022
📦 A command line utility to put text in a box.

boxie A command line utility to put text in a box. Installation pip install boxie If you are on Linux you may need to use sudo to access this globally

Eliaz Bobadilla 10 Jun 30, 2022