Skip to content

Commit

Permalink
Return a real async function from auto_inject_async (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
FasterSpeeding authored Jun 24, 2024
1 parent d57970e commit 636f51b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.3.1] - 2024-06-24
* [alluka.abc.Client.auto_inject_async][] now returns a real asynchronous function
to improve compatibility with some third party libraries which use
`asyncio.iscoroutinefunction` or `inspect.iscoroutinefunction` to validate
callbacks.

## [0.3.0] - 2024-05-09
### Added
- [alluka.local][] is now directly exported on [alluka][].
Expand Down Expand Up @@ -129,7 +135,8 @@ part of Tanjun.
- The public `CallackDescriptor` and `TypeDescriptor` classes as callbacks
are now processed within the client and any necessary caching is kept internal.

[Unreleased]: https://github.com/FasterSpeeding/Alluka/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/FasterSpeeding/Alluka/compare/v0.3.1...HEAD
[0.3.1]: https://github.com/FasterSpeeding/Alluka/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/FasterSpeeding/Alluka/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/FasterSpeeding/Alluka/compare/v0.1.5...v0.2.0
[0.1.5]: https://github.com/FasterSpeeding/Alluka/compare/v0.1.4...v0.1.5
Expand Down
4 changes: 2 additions & 2 deletions alluka/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ async def callback(dep: Injected[Type]) -> None:
"""

@functools.wraps(callback)
def wrapped_callback(*args: _P.args, **kwargs: _P.kwargs) -> _CoroT[_T]:
return self.call_with_async_di(callback, *args, **kwargs)
async def wrapped_callback(*args: _P.args, **kwargs: _P.kwargs) -> _T:
return await self.call_with_async_di(callback, *args, **kwargs)

return wrapped_callback

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "alluka"
version = "0.3.0"
version = "0.3.1"
readme = "README.md"
requires-python = ">=3.9.0,<3.13"
license = {file = "LICENSE"}
Expand Down

0 comments on commit 636f51b

Please sign in to comment.