Releases: FasterSpeeding/Alluka
Releases · FasterSpeeding/Alluka
v0.4.0
v0.3.3
v0.3.2
v0.3.1
v0.3.0
0.3.0 - 2024-05-09
Added
alluka.local
is now directly exported onalluka
.alluka.Context
implementation ofalluka.abc.Context
which is a basic DI context implementation with no callback dependency result caching.alluka.CachingContext
which extendsalluka.Context
to add callback dependency result caching.alluka.OverridingContext
shallow DI context implementation for adding context specific type dependencies to an existing context.alluka.Client.set_make_context
method for setting the callback used by the client to make DI contexts.
Changed
- Callback dependency results are no-longer cached by default. To return this behaviour set
alluka.CachingContext
as the context maker.
Deprecated
alluka.BasicContext
has been replaced byalluka.CachingContext
.
Fixed
- Injected callback results are now properly cached when
alluka.CachingContext
is set as the context.
v0.2.0
0.2.0 - 2024-04-29
Added
- Transparent auto injection methods on
Client
atClient.auto_inject
andClient.auto_inject_async
. These wrap functions to make calls to them automatically inject dependencies and are transparent replacements for the self injecting system.
More information on these can be found here. - A system for setting the injection client for a local scope (as defined by
contextvars
) and making dependency injection calls based on said context.
More information on this can be found here. alluka.abc.Client.make_context
method for creating a client bound context.
Changed
get_type_dependency
andget_cached_value
both now raise aKeyError
when no value is found and no default was provided.alluka.abc.Client.call_with_di
andalluka.abc.Client.call_with_async_di
now provide default implementations which useClient.make_context
.alluka.abc.Context.call_with_di
andalluka.abc.Context.call_with_async_di
now provide default implementations which useContext.injection_client
.
Deprecated
Client.as_self_injecting
in favour ofClient.auto_inject
.Client.as_async_self_injecting
in favour ofClient.auto_inject_async
.alluka.SelfInjecting
in favour ofClient.auto_inject
.alluka.AsyncSelfInjecting
in favour ofClient.auto_inject_async
.
Removed
alluka.abc.UNDEFINED
andalluka.abc.Undefined
.
v0.1.5
v0.1.4
v0.1.3
0.1.3 - 2022-11-12
Added
alluka.abc.Client
is now set as a type dependency by default.
Changed
- Renamed
AsyncOnlyError
toSyncOnlyError
(AsyncOnlyError
has been kept as a deprecated alias). - Relaxed typing around DI for async callbacks to allow for returning a union of
Coroutine[Any, Any, T] | T
.
Fixed
- Don't error on async callbacks which return a coroutine after being awaited during DI when assertions are enabled.
Removed
- The project metadata dunder attributes from
alluka
.
importlib.metadata
should be used to get this metadata instead.
v0.1.2
0.1.2 - 2022-07-06
Changed
- The optional
introspect_annotations
parameter foralluka.Client.__init__
is now keyword only. tanjun.abc.Client
is now a realabc.ABC
.
Deprecated
alluka.abc.Undefined
andalluka.abc.UNDEFINED
for removal inv0.2.0
as these will no-longer be used.get_type_dependency
andget_cached_result
returningUNDEFINED
as the default when no default is passed will be replaced by aKeyError
raise inv0.2.0
.