The component manager for ESP-IDF
Project description
IDF Component Manager
The IDF Component manager is a tool that downloads dependencies for any ESP-IDF CMake project. It makes sure that the right versions of all components required for a successful build of your project are in place. The download happens automatically during a run of CMake. It can source components either from the component registry or from a git repository.
A list of components can be found at https://components.espressif.com/
Official documentation
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"
service_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
Environment variables
Variable | Default value (or example for required) | Description |
---|---|---|
IDF_COMPONENT_API_TOKEN | API token to access the component registry | |
IDF_COMPONENT_REGISTRY_URL | https://components.espressif.com/ | URL of the default component registry |
IDF_COMPONENT_STORAGE_URL | https://components-file.espressif.com/ | URL of the default file storage server |
IDF_COMPONENT_REGISTRY_PROFILE | default | Profile in the config file to use for component registry |
IDF_COMPONENT_API_CACHE_EXPIRATION_MINUTES | 0 | API Cache expiration time in minutes |
IDF_COMPONENT_CACHE_PATH | * Depends on OS | Cache directory for component manager |
COMPONENT_MANAGER_JOB_TIMEOUT | 300 | Timeout in seconds to wait for component processing |
IDF_COMPONENT_OVERWRITE_MANAGED_COMPONENTS | 0 | Overwrite files in the managed_component directory, even if they have been modified by the user |
IGNORE_UNKNOWN_FILES_FOR_MANAGED_COMPONENTS | 0 | Ignore unknown files in managed_components directory |
IDF_COMPONENT_CHECK_NEW_VERSION | 0 | Check for new versions of components |
IDF_COMPONENT_VERIFY_SSL | 1 | Verify SSL certificates when making requests to the registry, set it 0 to disable or provide a CA bundle path |
Contributions Guide
We welcome all contributions to the Component Manager project.
You can contribute by fixing bugs, adding features, adding documentation, or reporting an issue. We accept contributions via GitHub Pull Requests.
Before reporting an issue, make sure you've searched for a similar one that was already created. If you are reporting a new issue, please follow the Issue Template.
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
Resources
- The Component manager Documentation
- The Python Package Index project page https://pypi.org/project/idf-component-manager/
- The Component Manager section in the ESP-IDF Programming Guide
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
Built Distribution
File details
Details for the file idf_component_manager-1.5.0.tar.gz
.
File metadata
- Download URL: idf_component_manager-1.5.0.tar.gz
- Upload date:
- Size: 120.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c0fe09980d0cb75590db467a09fb2f6ff1281432cf6735a048c5da68be79de7 |
|
MD5 | fba727d54a74744ea436df96c1b0d286 |
|
BLAKE2b-256 | 46a01e36c1f674a48264b2a205300e894b7c3652fb12671140d3b8514be46d97 |
File details
Details for the file idf_component_manager-1.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: idf_component_manager-1.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 160.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fcc664d0009f02f7d729d615c9d4b188d5e4faf8e53eb9f25bb345c44fd5bd9 |
|
MD5 | fff97529fd0478005d687472efb08b8d |
|
BLAKE2b-256 | 4fe10a03875b3b2370f89ef5ca2128eb2589b0d95034101afe0d44ce811ad8a9 |