Skip to content

Added idf-component-manager to exclude_list#63

Open
jakub-kocka wants to merge 7 commits intomainfrom
fix/component_manager
Open

Added idf-component-manager to exclude_list#63
jakub-kocka wants to merge 7 commits intomainfrom
fix/component_manager

Conversation

@jakub-kocka
Copy link
Copy Markdown
Collaborator

@jakub-kocka jakub-kocka commented Mar 23, 2026

idf-component-manager v3.0.0 does not support Python <= 3.10 https://pypi.org/project/idf-component-manager/3.0.0/

Description

Because of the failing wheels built due to the idf-component-manager, the package was added to exclude_list.

idf-component-manager v3.0.0 does not support Python <= 3.10 - https://pypi.org/project/idf-component-manager/3.0.0/


Also fixed the BadZipFile / "Bad magic number" errors - PEP 427 (https://github.com/espressif/idf-python-wheels/actions/runs/23427493077/job/68191831315)


As part of this PR, the esptool dependencies are added into the requirements assembly - the packages that will be built

Related

Testing


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@jakub-kocka jakub-kocka self-assigned this Mar 23, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

Warnings
⚠️ Please consider squashing your 7 commits (simplifying branch history).

👋 Hello jakub-kocka, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 1fda564

@jakub-kocka jakub-kocka force-pushed the fix/component_manager branch 6 times, most recently from 66f0663 to 1f4bbeb Compare March 27, 2026 08:40
@jakub-kocka jakub-kocka force-pushed the fix/component_manager branch from 1f4bbeb to 9b91cdf Compare March 30, 2026 07:49
…tAdapter

exclude_list rows with platform and python but no package version were turned
into an AND of inverted markers, which incorrectly dropped the dependency on
other OSes for the same Python (e.g. Linux 3.14 when excluding Windows/macOS
3.14). Emit De Morgan form (sys_platform != p or <inverted python>) per
platform instead.

Added pydantic_core for win32/darwin on Python 3.14 to avoid broken maturin
sdists; remove the temporary skip from build_wheels_from_file. Factor
python_version marker building into _python_version_marker_fragment_no_package_version
and add unit tests. Update the architecture skill note accordingly.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the wheel build/test pipeline to avoid known incompatible dependencies, improve resilience to corrupt wheel artifacts, and stabilize dependency resolution during wheel builds.

Changes:

  • Extend exclude/marker handling (notably platform ∩ python exclusion without a version) and add new exclude entries.
  • Detect and discard corrupt/non-zip “.whl” artifacts during repair and install verification steps.
  • Add esptool dependencies into the assembled requirements and introduce a --force-interpreter-binary build mode for dependent wheels.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
exclude_list.yaml Adds new exclusions (pydantic_core on Win/macOS + py3.14; idf-component-manager 3.0.0 on older Pythons).
yaml_list_adapter.py Adds intersection-style exclude marker generation for platform+python (no version) and refactors python marker fragment building.
test_build_wheels.py Adds unit tests covering the new platform∩python intersection exclude behavior.
test_wheels_install.py Adds preflight zip validation + pip error classification to discard corrupt wheel artifacts.
repair_wheels.py Adds zip validation before repair and validates repaired output; deletes invalid artifacts.
build_wheels.py Adds tomllib/tomli parsing and appends esptool pyproject.toml dependencies to assembled requirements.
build_requirements.txt Adds tomli for Python < 3.11 to support TOML parsing fallback.
build_wheels_from_file.py Adds --force-interpreter-binary support and per-requirement --no-binary injection (non-Windows).
_helper_functions.py Makes print_color safer on non-UTF8 Windows consoles by sanitizing output text.
.github/workflows/unit-tests.yml Switches unit-test dependency install to -r build_requirements.txt.
.github/workflows/build-wheels-python-dependent.yml Enables --force-interpreter-binary, sets PYO3_USE_ABI3_FORWARD_COMPATIBILITY, and adds an ARMv7 artifact permission fix.
.github/workflows/build-wheels-platforms.yml Adds an ARMv7 artifact permission fix before upload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# https://pypi.org/project/idf-component-manager/3.0.0/
- package_name: 'idf-component-manager'
version: '==3.0.0'
python: ['<3.10']
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The exclude rule for idf-component-manager says it is unsupported on Python <= 3.10, but the marker python: ['<3.10'] will not match Python 3.10. Use a specifier that covers 3.10 as well (e.g. <3.11 or <=3.10, depending on intent).

Suggested change
python: ['<3.10']
python: ['<=3.10']

Copilot uses AI. Check for mistakes.
- package_name: 'mcp'
python: ['==3.8', '==3.9']

# idf-component-manager v3.0.0is not supported by Python <= 3.10
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

Typo in the comment: v3.0.0is is missing a space.

Suggested change
# idf-component-manager v3.0.0is not supported by Python <= 3.10
# idf-component-manager v3.0.0 is not supported by Python <= 3.10

Copilot uses AI. Check for mistakes.
Comment on lines +162 to +168
# Download esptool requirements from pyproject.toml file
res = requests.get(ESPTOOL_PYPROJECT_URL, headers=AUTH_HEADER, timeout=10)
if check_response(res, "Failed to download esptool pyproject.toml file"):
pyproject_content = tomllib.loads(res.text)
esptool_deps = pyproject_content.get("project", {}).get("dependencies", [])
requirements_txt += [dep for dep in esptool_deps if dep not in requirements_txt]
print("Added esptool requirements")
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

_download_branch_requirements() downloads esptool's pyproject.toml on every branch iteration, which repeats the same network request N times (and can increase latency / hit GitHub rate limits). Consider fetching and parsing esptool dependencies once (outside the per-branch loop) and merging them into the overall requirements set once.

Copilot uses AI. Check for mistakes.
Comment on lines 158 to +162
Markers (platform and python) are ANDed between and multiple values of the marker are ORed between.
For exclude=True **without** a package ``version``, platform + python mean “exclude on this OS **and**
this Python” (intersection): the keep-marker is ``(sys_platform != p or <inverted python>)`` per
platform, ANDed across listed platforms (De Morgan). Rows **with** a package version keep the
split-requirement behaviour documented below.
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

Docstring says “multiple values of the marker are ORed between”, but for python lists the code joins fragments with and (see _python_version_marker_fragment_no_package_version() returning " and ".join(parts)). Please align the docstring with the actual semantics (or adjust the implementation if OR is intended).

Copilot uses AI. Check for mistakes.
Comment on lines +129 to +137
expected = Requirement('pydantic_core; (sys_platform != "win32" or (python_version != "3.14"))')
self.assertEqual(result, {expected})

def test_exclude_platform_and_python_intersection_two_os(self):
yaml_list = [{"package_name": "pydantic_core", "platform": ["win32", "darwin"], "python": "==3.14"}]
result = self.adapter._yaml_to_requirement(yaml_list, exclude=True)
expected = Requirement(
'pydantic_core; (sys_platform != "win32" or (python_version != "3.14")) and '
'(sys_platform != "darwin" or (python_version != "3.14"))'
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The new expected marker strings use double quotes, while the rest of this test module uses single quotes in marker literals (e.g., sys_platform == 'win32'). For consistency (and to avoid brittle string-format differences), consider using the same quoting style as the other Requirement expectations in this file.

Suggested change
expected = Requirement('pydantic_core; (sys_platform != "win32" or (python_version != "3.14"))')
self.assertEqual(result, {expected})
def test_exclude_platform_and_python_intersection_two_os(self):
yaml_list = [{"package_name": "pydantic_core", "platform": ["win32", "darwin"], "python": "==3.14"}]
result = self.adapter._yaml_to_requirement(yaml_list, exclude=True)
expected = Requirement(
'pydantic_core; (sys_platform != "win32" or (python_version != "3.14")) and '
'(sys_platform != "darwin" or (python_version != "3.14"))'
expected = Requirement("pydantic_core; (sys_platform != 'win32' or (python_version != '3.14'))")
self.assertEqual(result, {expected})
def test_exclude_platform_and_python_intersection_two_os(self):
yaml_list = [{"package_name": "pydantic_core", "platform": ["win32", "darwin"], "python": "==3.14"}]
result = self.adapter._yaml_to_requirement(yaml_list, exclude=True)
expected = Requirement(
"pydantic_core; (sys_platform != 'win32' or (python_version != '3.14')) and "
"(sys_platform != 'darwin' or (python_version != '3.14'))"

Copilot uses AI. Check for mistakes.
@jakub-kocka jakub-kocka force-pushed the fix/component_manager branch from 620715a to 1fda564 Compare April 1, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants