Repository navigation
Fixed psutil package - #72
Conversation
Run native_import_guard.yaml probes on every test-wheels-install runner so SIGABRT and ABI mismatches fail CI before upload
Keep portable macosx tags on the extra-index Local macos-15 builds were winning over official PyPI wheels (for example psutil 7.2.2 SIGABRT)
👋 Hello jakub-kocka, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts wheel-build and wheel-repair policy to avoid CI-produced wheels “stealing” pip’s preference over official PyPI wheels (notably on macOS for psutil), and expands post-install native import probing to run consistently across platforms via a more flexible YAML-driven configuration.
Changes:
- Add
wheel_compat_policy.pyto centralize macOS/manylinux tag pruning and PyPI wheel mirroring policy, and wire it into build/repair flows. - Introduce
native_import_guard.py+ updatednative_import_guard.yamlto support platform/python/version filters, default probing for unlisted platform wheels, and skipping*-none-any.whl. - Update tests and tooling (
test_*,scripts/run_native_import_probe.py, docs) to use the new policy/modules.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| wheel_compat_policy.py | New module implementing macOS --only-binary policy, PyPI mirroring, and wheel pruning logic. |
| native_import_guard.py | New loader/resolver for YAML-driven native import probes (filters + defaults). |
| native_import_guard.yaml | Expanded configuration format (top-level options + per-package filters + psutil probe). |
| test_wheels_install.py | Switch native import probing to YAML resolver with default probing for unlisted wheels. |
| test_native_import_guard.py | New unit tests for YAML loading and statement resolution behavior. |
| test_build_wheels.py | Rewire tests to new policy module and add coverage for new behaviors. |
| build_wheels.py | Use wheel_compat_policy for pip wheel invocation and mirror success logic. |
| build_wheels_from_file.py | Use wheel_compat_policy for pip wheel invocation and mirror success logic. |
| repair_wheels.py | Apply macOS pruning + delocate-skip policy; keep manylinux pruning behavior via new module. |
| scripts/run_native_import_probe.py | Use native_import_guard loader instead of in-script YAML parsing. |
| _helper_functions.py | Remove migrated policy/guard logic and add psutil to relevant skip lists. |
| README.md | Document new native import guard semantics and macOS wheel-preference mitigation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
5abb1b4 to
8e0be3a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
test_build_wheels.py:445
- Test name
test_only_binary_args_off_linuxis misleading: it patchesplatform.system()to "Linux" and verifies behavior off macOS. Renaming helps clarify intent.
This issue also appears on line 469 of the same file.
@patch("wheel_compat_policy.platform.system", return_value="Linux")
def test_only_binary_args_off_linux(self, _sys: object) -> None:
self.assertEqual(get_macos_only_binary_args(), [])
test_build_wheels.py:471
- Test name
test_skip_delocate_off_linuxis misleading: it patchesplatform.system()to "Linux" and verifies behavior off macOS. Renaming improves readability.
@patch("wheel_compat_policy.platform.system", return_value="Linux")
def test_skip_delocate_off_linux(self, _sys: object) -> None:
self.assertFalse(should_skip_macos_delocate_for_pypi_mirror("psutil-7.2.2-cp36-abi3-macosx_10_9_x86_64.whl"))
fb36ac9 to
d4ba42c
Compare
909fc5a to
4e88805
Compare
4e88805 to
c2c5155
Compare
Sourcing linux_armv7_docker_prepare.sh turned errexit off in the workflow shell: bash clears errexit inside the command substitution of an assignment, so the "$(set +o)" snapshot restored "set +o errexit". Failures in linux_arm.sh then looked like success. That hid an apt failure on the bullseye armhf images, where python3-dev has no installable version (they carry libpython3.9-stdlib from bullseye-security, which is gone from archive.debian.org, while main only offers the matching -dev at the original point release). Setup aborted before installing Rust and the dbus dev packages, so bcrypt and dbus-python failed to build half an hour later. Wheels build against the interpreter on PATH, so the distro headers are now best-effort. macos_openssl4_intel.sh had the same errexit snapshot bug. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thank you, @dobairoland, @fhrbata, for the review. I have added a few more commits since then, but the core logic is untouched. It was a few minor patches to pass the build pipeline and the "resurrection" of EOL Debian 11 builds (ARMv7 Legacy) So since the build pipeline has passed (https://github.com/espressif/idf-python-wheels/actions/runs/34575708821) and the wheels are uploaded to our index, I am merging this. I believe the next step is to unlock the |
Description
Prefer official PyPI macOS wheels on CI:
pip wheel --only-binary :all:(Intelcryptographystill--no-binaryfor OpenSSL 4), skip delocate except that rebuild, and prune higher macosx_* siblings so a macos-15-* sdist cannot steal pip preference. This is the psutil 7.2.2 SIGABRT path (macosx_15_0 winning over PyPI macosx_10_9 / 11_0).Run
native_import_guard.yamlimport probes on every test-wheels-install runner (not only ARMv7). Unlisted platform wheels get import <top_level>; *-none-any.whl is skipped. Custom imports remain forcffi/cryptography/psutil/ etc.Split the new policy out of
_helper_functions.pyintowheel_compat_policy.pyandnative_import_guard.py. Helper stays shared primitives (platform, parsing, exclude, PyPI preflight).Related
psutil(our build wheel present on the index)Test pipeline run
Checklist
Before submitting a Pull Request, please ensure the following: