Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/actions/deps/external/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ runs:
uses: ./.github/actions/deps/python
with:
action: ${{ inputs.action }}
- name: Set ESP-IDF constraints path
if: inputs.port == 'espressif'
run: python3 -u tools/ci_set_idf_constraint.py
shell: bash

- name: Install python dependencies
run: pip install -r requirements-dev.txt
run: |
if [ -n "${IDF_CONSTRAINT_FILE:-}" ] && [ -f "$IDF_CONSTRAINT_FILE" ]; then
pip install -c "$IDF_CONSTRAINT_FILE" -r requirements-dev.txt
else
pip install -r requirements-dev.txt
fi
shell: bash
3 changes: 3 additions & 0 deletions ports/espressif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ INC += \
-isystem esp-idf/components/soc/include \
-isystem esp-idf/components/soc/$(IDF_TARGET)/include \
-isystem esp-idf/components/soc/$(IDF_TARGET)/register \
-isystem esp-idf/components/soc/$(IDF_TARGET)/register/hw_ver3 \
-isystem esp-idf/components/soc/$(IDF_TARGET)/register/hw_ver2 \
-isystem esp-idf/components/soc/$(IDF_TARGET)/register/hw_ver1 \
-isystem esp-idf/components/spi_flash/include \
-isystem esp-idf/components/usb/include \
-isystem esp-idf/components/ulp/ulp_fsm/include \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ CIRCUITPY_ESP_FLASH_SIZE = 2MB
CIRCUITPY_DUALBANK = 0

CIRCUITPY_JPEGIO = 0
CIRCUITPY_CANIO = 0

CIRCUITPY_ESP_USB_SERIAL_JTAG = 0
2 changes: 1 addition & 1 deletion ports/espressif/esp-idf
Submodule esp-idf updated 2974 files
3 changes: 1 addition & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ intelhex
# for building & testing natmods
pyelftools

# newer versions break ESP-IDF now
cryptography<45
cryptography

# for web workflow minify
minify_html
Expand Down
47 changes: 47 additions & 0 deletions tools/ci_set_idf_constraint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 Adafruit Industries LLC
#
# SPDX-License-Identifier: MIT

"""Set IDF_CONSTRAINT_FILE for CI.

CI installs requirements-dev.txt for all ports, but on Espressif builds we must
also apply the matching ESP-IDF constraints file so pip does not upgrade shared
packages (for example click) beyond what ESP-IDF allows. This script derives the
active ESP-IDF major.minor version from version.cmake and exports the exact
constraints file path into GITHUB_ENV for later install steps.
"""

import os
import pathlib
import re

TOP = pathlib.Path(__file__).resolve().parent.parent


def main() -> None:
version_cmake = TOP / "ports" / "espressif" / "esp-idf" / "tools" / "cmake" / "version.cmake"
data = version_cmake.read_text(encoding="utf-8")

major = re.search(r"IDF_VERSION_MAJOR\s+(\d+)", data)
minor = re.search(r"IDF_VERSION_MINOR\s+(\d+)", data)
if major is None or minor is None:
raise RuntimeError(f"Unable to parse IDF version from {version_cmake}")

idf_tools_path = os.environ.get("IDF_TOOLS_PATH")
if not idf_tools_path:
raise RuntimeError("IDF_TOOLS_PATH is not set")

constraint = (
pathlib.Path(idf_tools_path) / f"espidf.constraints.v{major.group(1)}.{minor.group(1)}.txt"
)

github_env = os.environ.get("GITHUB_ENV")
if github_env:
with open(github_env, "a", encoding="utf-8") as f:
f.write(f"IDF_CONSTRAINT_FILE={constraint}\n")

print(f"Set IDF_CONSTRAINT_FILE={constraint}")


if __name__ == "__main__":
main()