Skip to content

Commit 636f51b

Browse files
Return a real async function from auto_inject_async (#400)
1 parent d57970e commit 636f51b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
## [0.3.1] - 2024-06-24
9+
* [alluka.abc.Client.auto_inject_async][] now returns a real asynchronous function
10+
to improve compatibility with some third party libraries which use
11+
`asyncio.iscoroutinefunction` or `inspect.iscoroutinefunction` to validate
12+
callbacks.
13+
814
## [0.3.0] - 2024-05-09
915
### Added
1016
- [alluka.local][] is now directly exported on [alluka][].
@@ -129,7 +135,8 @@ part of Tanjun.
129135
- The public `CallackDescriptor` and `TypeDescriptor` classes as callbacks
130136
are now processed within the client and any necessary caching is kept internal.
131137

132-
[Unreleased]: https://github.com/FasterSpeeding/Alluka/compare/v0.3.0...HEAD
138+
[Unreleased]: https://github.com/FasterSpeeding/Alluka/compare/v0.3.1...HEAD
139+
[0.3.1]: https://github.com/FasterSpeeding/Alluka/compare/v0.3.0...v0.3.1
133140
[0.3.0]: https://github.com/FasterSpeeding/Alluka/compare/v0.2.0...v0.3.0
134141
[0.2.0]: https://github.com/FasterSpeeding/Alluka/compare/v0.1.5...v0.2.0
135142
[0.1.5]: https://github.com/FasterSpeeding/Alluka/compare/v0.1.4...v0.1.5

alluka/abc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ async def callback(dep: Injected[Type]) -> None:
176176
"""
177177

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

182182
return wrapped_callback
183183

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "alluka"
7-
version = "0.3.0"
7+
version = "0.3.1"
88
readme = "README.md"
99
requires-python = ">=3.9.0,<3.13"
1010
license = {file = "LICENSE"}

0 commit comments

Comments
 (0)