Skip to content

Releases: FasterSpeeding/Alluka

v0.4.0

24 Nov 19:15
7387eee
Compare
Choose a tag to compare

0.4.0 - 2024-11-24

Added

  • Support for local scoped injection contexts.
  • Provisional support for Python 3.14.

Removed

  • Support for Python 3.9 and 3.10.

v0.3.3

13 Oct 15:53
8e1a1e8
Compare
Choose a tag to compare

0.3.3 - 2024-10-13

Fixed

  • Correctly mark ctx and callback as positional only in the call_with methods
    and functions to avoid conflicting with passed-through keyword arguments.

v0.3.2

07 Oct 19:46
9e4394a
Compare
Choose a tag to compare

0.3.2 - 2024-10-07

Changed

  • Support Python 3.13.

v0.3.1

24 Jun 20:06
636f51b
Compare
Choose a tag to compare

0.3.1 - 2024-06-24

Changed

  • 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.

v0.3.0

09 May 22:27
6d85432
Compare
Choose a tag to compare

0.3.0 - 2024-05-09

Added

  • alluka.local is now directly exported on alluka.
  • alluka.Context implementation of alluka.abc.Context which is a basic DI context implementation with no callback dependency result caching.
  • alluka.CachingContext which extends alluka.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 by alluka.CachingContext.

Fixed

  • Injected callback results are now properly cached when alluka.CachingContext is set as the context.

v0.2.0

29 Apr 21:16
d0d4c51
Compare
Choose a tag to compare

0.2.0 - 2024-04-29

Added

  • Transparent auto injection methods on Client at Client.auto_inject and Client.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 and get_cached_value both now raise a KeyError when no value is found and no default was provided.
  • alluka.abc.Client.call_with_di and alluka.abc.Client.call_with_async_di now provide default implementations which use Client.make_context.
  • alluka.abc.Context.call_with_di and alluka.abc.Context.call_with_async_di now provide default implementations which use Context.injection_client.

Deprecated

  • Client.as_self_injecting in favour of Client.auto_inject.
  • Client.as_async_self_injecting in favour of Client.auto_inject_async.
  • alluka.SelfInjecting in favour of Client.auto_inject.
  • alluka.AsyncSelfInjecting in favour of Client.auto_inject_async.

Removed

  • alluka.abc.UNDEFINED and alluka.abc.Undefined.

v0.1.5

22 Apr 22:53
cbff607
Compare
Choose a tag to compare

0.1.5 - 2024-04-22

  • Improve error message when attempting to use alluka.inject without DI.

v0.1.4

27 Dec 22:16
38859b4
Compare
Choose a tag to compare

0.1.4 - 2023-12-27

Added

  • Python 3.12 support.

v0.1.3

12 Nov 20:02
8c18040
Compare
Choose a tag to compare

0.1.3 - 2022-11-12

Added

  • alluka.abc.Client is now set as a type dependency by default.

Changed

  • Renamed AsyncOnlyError to SyncOnlyError (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

06 Jul 18:52
9cded28
Compare
Choose a tag to compare

0.1.2 - 2022-07-06

Changed

  • The optional introspect_annotations parameter for alluka.Client.__init__ is now keyword only.
  • tanjun.abc.Client is now a real abc.ABC.

Deprecated

  • alluka.abc.Undefined and alluka.abc.UNDEFINED for removal in v0.2.0 as these will no-longer be used.
  • get_type_dependency and get_cached_result returning UNDEFINED as the default when no default is passed will be replaced by a KeyError raise in v0.2.0.