-
Notifications
You must be signed in to change notification settings - Fork 22
Modernize Python version support and replace deprecated uamqp with vendored pyamqp #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ethanann-ms
wants to merge
3
commits into
main
Choose a base branch
from
ethanann/pyamqp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Vendored `pyamqp` | ||
|
|
||
| This directory contains a vendored copy of the pure-Python AMQP implementation | ||
| that ships privately as `azure.servicebus._pyamqp` in the | ||
| [`Azure/azure-sdk-for-python`](https://github.com/Azure/azure-sdk-for-python) | ||
| repository. | ||
|
|
||
| `pyamqp` is not published as a standalone PyPI package; vendoring is the | ||
| supported way to consume it from outside the SDKs that ship it. | ||
|
|
||
| ## Provenance | ||
|
|
||
| - **Upstream repo:** https://github.com/Azure/azure-sdk-for-python | ||
| - **Upstream path:** `sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/` | ||
| - **Pinned commit:** `42f59593caec801dabfe3d222ddb8561b46b5e72` (tip of `main` at time of fetch) | ||
| - **Date copied:** 2026-07-22 | ||
|
|
||
| ## Local modifications | ||
|
|
||
| The vendored tree is otherwise byte-identical to upstream at the pinned commit, | ||
| with the following exceptions: | ||
|
|
||
| 1. **`aio/` subtree removed.** This package only performs synchronous C2D | ||
| message sends; the async subtree carried a large maintenance surface and | ||
| required `asyncio` machinery unused by this SDK. | ||
| 2. **`_message_backcompat.py` removed.** It was unreferenced by any code path | ||
| we import, and it was the only file with a cross-package reference | ||
| (`from ..amqp._amqp_message import ...`, guarded by `TYPE_CHECKING`) — a | ||
| dangling import that would surface under static analysis. | ||
|
|
||
| No source edits were made to the remaining files. Internal imports were already | ||
| relative (`from .foo import bar`), so no import rewrites were required. | ||
|
|
||
| ## Why we vendor rather than depend | ||
|
|
||
| `pyamqp` lives at a private module path inside `azure-servicebus` | ||
| (`azure.servicebus._pyamqp`). Depending on a private module of another SDK is | ||
| brittle: upstream is free to reshape or rename it without notice. Vendoring | ||
| gives this package a stable, reviewable snapshot that upgrades happen on our | ||
| schedule. | ||
|
|
||
| ## Refresh procedure | ||
|
|
||
| To refresh against a newer upstream commit: | ||
|
|
||
| 1. Choose a target commit SHA on `Azure/azure-sdk-for-python` `main`. | ||
| 2. Sparse-fetch `sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/` | ||
| at that SHA. | ||
| 3. Replace this directory's contents with the fetched tree. | ||
| 4. Re-apply the two removals listed under **Local modifications** (`aio/` and | ||
| `_message_backcompat.py`). | ||
| 5. Update the **Pinned commit** and **Date copied** fields above. | ||
| 6. Run the test suite and the AMQP-over-WebSocket sample against a real | ||
| IoT Hub to confirm the refresh is safe. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # ------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for | ||
| # license information. | ||
| # ------------------------------------------------------------------------- | ||
|
|
||
| __version__ = "2.0.0a1" | ||
|
|
||
|
|
||
| from ._connection import Connection | ||
| from ._transport import SSLTransport | ||
|
|
||
| from .client import AMQPClient, ReceiveClient, SendClient | ||
|
|
||
| __all__ = [ | ||
| "Connection", | ||
| "SSLTransport", | ||
| "AMQPClient", | ||
| "ReceiveClient", | ||
| "SendClient", | ||
| ] |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.