Skip to content

[Core] Add anyio dependency for lock handling#33307

Merged
pvaneck merged 2 commits intoAzure:mainfrom
pvaneck:anyio
Nov 30, 2023
Merged

[Core] Add anyio dependency for lock handling#33307
pvaneck merged 2 commits intoAzure:mainfrom
pvaneck:anyio

Conversation

@pvaneck
Copy link
Member

@pvaneck pvaneck commented Nov 27, 2023

  • 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

@pvaneck pvaneck force-pushed the anyio branch 2 times, most recently from 6400320 to c2b637c Compare November 28, 2023 00:08
@azure-sdk
Copy link
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
Member Author

pvaneck commented Nov 30, 2023

/check-enforcer override

@pvaneck pvaneck merged commit 52d1984 into Azure:main Nov 30, 2023
@pvaneck pvaneck deleted the anyio branch November 30, 2023 02:08
@akx
Copy link
Contributor

akx commented Dec 21, 2023

😩

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.

@akx akx mentioned this pull request Dec 21, 2023
6 tasks
@xiangyan99
Copy link
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