Skip to content

[Core] Add anyio dependency for lock handling - #33307

Merged
Paul Van Eck (pvaneck) merged 2 commits into
Azure:mainfrom
pvaneck:anyio
Nov 30, 2023
Merged

Paul Van Eck (pvaneck) merged 2 commits into
Azure:mainfrom
pvaneck:anyio

Conversation

@pvaneck

@pvaneck Paul Van Eck (pvaneck) commented Nov 27, 2023 •

Copy link
Copy Markdown
Member
  • This introduces anyio as a dependency to azure-core, and we leverage its Lock class in AsyncBearerTokenCredentialPolicy to allow it to work with both asyncio and trio concurrency mechanisms.
  • requests was also bumped to allow the mindependency check to pass with the minimum version of anyio.

Closes: #32968

@azure-sdk

Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

- This introduces anyio as a dependency to azure-core and we leverage
  its `Lock` class in `AsyncBearerTokenCredentialPolicy` to allow it to
  work with both asyncio and trio concurrency mechanisms.
- Requests was also bumped to allow the mindependency check to pass with
  the minimum version of `anyio`.

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
@pvaneck

Copy link
Copy Markdown
Member Author

/check-enforcer override

@pvaneck
Paul Van Eck (pvaneck) merged commit 52d1984 into Azure:main Nov 30, 2023
@akx

Copy link
Copy Markdown
Contributor

😩

This forces installation of multiple additional transitive dependencies for any and all users of azure-core.

anyio-4.2.0 exceptiongroup-1.2.0 sniffio-1.3.0

It might be better to explore whether the same thing could be done without forcing the dependency; after all, there are plenty of other places in azure-core that only support asyncio still.

@xiangyan99

Copy link
Copy Markdown
Member

there are plenty of other places in azure-core that only support asyncio still.

Thanks for your feedback.

In terms of "there are plenty of other places in azure-core that only support asyncio still."

if you don't mind, could you share more details?

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.

AsyncBearerTokenCredentialPolicy depends on asyncio

6 participants