Skip to content

Conversation

@brianignacio5
Copy link
Collaborator

Description

This pull request updates the PyTest package installation process for ESP-IDF unit tests to improve compatibility and reliability. The main changes include dynamically determining the ESP-IDF version to select the appropriate pip constraints file, handling tool paths more robustly, and updating the pip installation command to use constraints if available.

Improvements to PyTest package installation:

  • Dynamically retrieves the ESP-IDF version from CMake using the new getEspIdfFromCMake utility, and extracts the major and minor version for use in constraints file selection. [1] [2]
  • Determines the tools path by checking configuration parameters, environment variables, or defaults, ensuring the correct location for ESP-IDF tools is used.
  • Checks for the existence of a version-specific pip constraints file and conditionally adds it to the pip install command to ensure package compatibility.
  • Updates the pip install command to include the constraints argument if the constraints file is found, improving reliability of package installation.

General code improvements:

  • Imports the new getEspIdfFromCMake utility and applies minor formatting changes for readability in function calls. [1] [2]

Fixes #1680

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Steps to test this pull request

Provide a list of steps to test changes in this PR and required output

  1. Run the command "ESP-IDF Unit Test: Install ESP-IDF PyTest requirements"
  2. Execute action. The Pytest should install pytest but comply with ESP-IDF constraints.
  3. Observe results.
  • Expected behaviour:
    The Pytest should install pytest but comply with ESP-IDF constraints.

  • Expected output:
    The Pytest should install pytest but comply with ESP-IDF constraints.

How has this been tested?

Manual testing above.

Test Configuration:

  • ESP-IDF Version: 5.5.1
  • OS (Windows,Linux and macOS): macOS

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

@brianignacio5 brianignacio5 self-assigned this Oct 13, 2025
@brianignacio5 brianignacio5 changed the title add constraint in pytest install step VSC-1770 add constraint in pytest install step Oct 13, 2025
@github-actions
Copy link

github-actions bot commented Oct 13, 2025

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

Copy link
Collaborator

@radurentea radurentea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brianignacio5 brianignacio5 added the bugfix Fixing some issue and bug in this PR label Oct 16, 2025
@brianignacio5 brianignacio5 added this to the v1.11.0 milestone Oct 16, 2025
Copy link
Collaborator

@Fabricio-ESP Fabricio-ESP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed Working.

@brianignacio5 brianignacio5 merged commit 09aa904 into master Oct 17, 2025
6 checks passed
@brianignacio5 brianignacio5 deleted the bugfix/pytest-install-constraints branch October 17, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixing some issue and bug in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running unit tests creates conflict in installed esptool package version (VSC-1770)

4 participants