Skip to main content

Espressif IDF Component Manager

Project description

IDF Component Manager

The IDF Component Manager is a tool that ensures the correct versions of all components required for a successful build are present in your ESP-IDF project.

Contributing to the project

See CONTRIBUTING.md

Resources

Develop ESP-IDF projects with the IDF Component Manager

Installing a development version of the Component Manager

You can install the development version of the Component Manager from the main branch of this repository:

On Linux/macOS:

Go to the directory with your ESP-IDF installation and run:

# activate ESP-IDF environment
source ./export.sh # or . ./export.fish, if you use fish shell
# remove old version of the Component Manager
python -m pip uninstall -y idf-component-manager
# install the development version (from the main branch)
python -m pip install git+https://github.com/espressif/idf-component-manager.git@main

On Windows:

Run ESP-IDF PowerShell Environment or ESP-IDF Command Prompt (cmd.exe) from the Start menu and run the following command:

# remove old version of the Component Manager
python -m pip uninstall -y idf-component-manager
# install the development version (from the main branch)
python -m pip install git+https://github.com/espressif/idf-component-manager.git@main

Disabling the Component Manager

The Component Manager can be explicitly disabled by setting IDF_COMPONENT_MANAGER environment variable to 0.

Using with a project

You can add idf_component.yml manifest files with the list of dependencies to any component in your project.

IDF Component Manager will download dependencies automatically during the project build process.

When CMake configures the project (e.g. idf.py reconfigure) Component Manager does a few things:

  • Processes idf_component.yml manifests for every component in the project
  • Creates a dependencies.lock file in the root of the project with a full list of dependencies
  • Downloads all dependencies to the managed_components directory

The Component Manager won't try to regenerate dependencies.lock or download any components if manifests, lock file, and content of managed_component directory weren't modified since the last successful build.

Defining dependencies in the manifest

All dependencies are defined in the manifest file.

dependencies:
  # Required IDF version
  idf: ">=4.1"
  # For components maintained by Espressif only name can be used.
  # Same as `espressif/component`
  component:
    version: "~2.0.0"
  # Or in a shorter form
  component2: ">=1.0.0"
  # For 3rd party components :
  username/component:
    version: "~1.0.0"
    # For transient dependencies `public` flag can be set.
    public: true
  anotheruser/component: "<3.2.20"
  # For components hosted on non-default registry:
  company_user/component:
    version: "~1.0.0"
    registry_url: "https://componentregistry.company.com"
  # For components in git repository:
  test_component:
    path: test_component
    git: ssh://git@gitlab.com/user/components.git
  # For test projects during component development
  # components can be used from a local directory
  # with relative or absolute path
  some_local_component:
    path: ../../projects/component
  # For optional dependencies
  optional_component:
    version: "~1.0.0"
    rules: # will add "optional_component" only when all if clauses are True
      - if: "idf_version >=3.3,<5.0" # supports all SimpleSpec grammars (https://python-semanticversion.readthedocs.io/en/latest/reference.html#semantic_version.SimpleSpec)
      - if: "target in [esp32, esp32c3]" # supports boolean operator ==, !=, in, not in.
  # For example of the component
  namespace/component_with_example:
    version: "~1.0.0" # if there is no `override_path` field, use component from registry
    override_path: "../../" # use component in a local directory, not from registry
  namespace/no_required_component:
    version: "*"
    require: no # Download component but don't add it as a requirement
  namespace/pre_release_component:
    version: "*"
    pre_release: true # Allow downloading of pre-release versions

Component metadata caching

By default, information about available versions of components not cached. If you make many requests to the registry from one machine, you can enable caching by setting IDF_COMPONENT_API_CACHE_EXPIRATION_MINUTES environment variable to the number of minutes to cache the data.

External links

You can add links to the idf_component.yml file to the root of the manifest:

url: "https://example.com/homepage" # URL of the component homepage
repository: "https://gitexample.com/test_project" # URL of the public repository with component source code, i.e GitHub, GitLab, etc.
documentation: "https://example.com/documentation" # URL of the component documentation
issues: "https://git.example.com/test_project/tracker" # URL of the issue tracker
discussion: "https://discord.example.com/test_project" # URL of the component discussion, i.e. Discord, Gitter, forum, etc.

A link should be a correct HTTP(S) URL like https://example.com/path except the repository field, it is expected to be a valid Git remote URL.

Add examples to the component

To add examples to your component, place them in the examples directory inside your component. Examples are discovered recursively in subdirectories at this path. A directory with CMakeLists.txt that registers a project is considered as an example.

Custom example paths

You can specify custom example paths for uploading them to the component registry. For that, add examples field to the root of the manifest:

examples:
  - path: ../some/path
  - path: ../some/other_path
  # - path: examples/some_example # this example will be discovered automatically

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idf_component_manager-3.0.1.tar.gz (161.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idf_component_manager-3.0.1-py3-none-any.whl (177.5 kB view details)

Uploaded Python 3

File details

Details for the file idf_component_manager-3.0.1.tar.gz.

File metadata

  • Download URL: idf_component_manager-3.0.1.tar.gz
  • Upload date:
  • Size: 161.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for idf_component_manager-3.0.1.tar.gz
Algorithm Hash digest
SHA256 76e4ce0d353d4c2f0c186257df852f78874f9b8d37f670e19789f34c0571ad7c
MD5 2c47aa695a88e2857c03f6eed3692cfb
BLAKE2b-256 b734a4703e9bc2f1193d36e3090d7fbb55d04c3751d4ac72ca1588fcd562c4cb

See more details on using hashes here.

File details

Details for the file idf_component_manager-3.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for idf_component_manager-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33a625138801cdad7ee175534964cec824800feb7d43aa03d7ce972000fbb1e3
MD5 3f2d6175b2682e0286d0d5b82a17e3b1
BLAKE2b-256 10998f41c0ff67a723168f3aab4a0fbfc6271b533bdbc733c3d4bf4f27027fa1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page