fix(deps): make uamqp optional on ARM macOS#1
Open
marcodalessandro wants to merge 11 commits intomainfrom
Open
fix(deps): make uamqp optional on ARM macOS#1marcodalessandro wants to merge 11 commits intomainfrom
marcodalessandro wants to merge 11 commits intomainfrom
Conversation
uamqp fails to build on Apple Silicon due to stricter clang type checking. Exclude it from install_requires on ARM macOS via PEP 508 marker while keeping it for Windows, Linux, and Intel Mac. Add [amqp] extra for opt-in. Gracefully handle missing uamqp at runtime so all non-C2D functionality works without it.
- Replace bare except ImportError with explicit HAS_UAMQP check - Use IntEnum for fallback TransportType for better API compatibility - Remove unused imports in test_no_uamqp.py - Strengthen test_delete_device assertion with exact call args
six is a Python 2 compatibility library that is not reliably available as a transitive dependency on all Python versions, causing CI failures.
The existing test file imported TransportType directly from uamqp, which fails on ARM macOS where uamqp is not installed. Import from the registry manager module which has a fallback enum.
- Deduplicate ImportError message using shared _UAMQP_MISSING_ERROR constant
- Fix mutable default argument properties={} in send_c2d_message
- Improve fallback IntEnum test to exercise actual runtime fallback via reload
Revert six.moves.urllib back to maintain Python 2 compatibility declared in setup.py metadata. Add six as explicit install_requires since it is used directly. Trim CI matrix to match classifiers (3.9-3.10).
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test PR to trigger CI workflow