All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v1.2.9 - 2019-10-15
- Reuse session provider instance within session. (Pull #41)
v1.2.8 - 2019-09-12
- Contributing guidelines.
- Recommend users to pin dependency to
==1.*
.
v1.2.7 - 2019-06-19
- Passing providers as strings to
@useprovider
is now lazy: providers will be resolved at runtime.
- Passing an unknown provider name to
@useprovider
now results in aProviderDoesNotExist
exception raised when calling the consumer.
v1.2.6 - 2019-05-08
- Session-scoped async generator providers were not correctly handled: they returned the async generator instead of setting and cleaning it up. This has been fixed!
v1.2.5 - 2019-03-30
- Fix regression on instance method consumers.
v1.2.4 - 2019-03-30
- Add support for class-based consumers (must implement
.__call__()
).
v1.2.3 - 2019-03-29
- Add support for keyword-only parameters in consumers.
v1.2.2 - 2019-03-24
- Previously,
ImportError
exceptions were silenced when discovering default providers (e.g. inproviderconf.py
). This lead to unexpected behavior when the providers module exists but raises anImportError
itself. We now correctly check whether the providers module exists before importing it normally.
v1.2.1 - 2019-03-15
- The order of arguments passed to a consumer is now preserved. It was previously reversed.
v1.2.0 - 2019-03-15
- Providers can now be overridden regardless of their declaration order with respect to consumers that use them. Previously, a provider could only be overridden before it was used in a consumer, which was of limited use.
v1.1.1 - 2019-03-14
- A bug led
partial
consumer functions wrapping a coroutine function to not be called properly when awaiting the aiodine consumer. This has been fixed.
v1.1.0 - 2019-03-09
- Context providers: provide context-local variables to consumers.
v1.0.1 - 2019-03-03
- Guarantee that finalization code of generator providers gets executed even if an exception occurs in the consumer.
v1.0.0 - 2019-03-03
- Use providers whose return value is not important via the
@useprovider
decorator. - Auto-used providers — activated without having to declare them in consumer parameters.
- Providers declared as keyword-only parameters in consumers are now properly injected.
- Require that Python 3.6+ is installed at the package level.
v0.2.0 - 2019-03-02
- Session-scoped generator providers, both sync and async.
- Documentation for the factory provider pattern.
- Session enter/exit utils:
store.enter_session()
,store.exit_session()
,async with store.session()
. Allows to manually trigger the setup/cleanup of session-scoped providers.
v0.1.3 - 2019-03-01
- Parameters are now correctly resolved regardless of the positioning of provider parameters relative to non-provider parameters.
v0.1.2 - 2019-02-28
- Fix an issue that occured when a consumer was an instance of
functools.partial
.
v0.1.1 - 2019-02-28
- Scope aliases: allows a store's
@provider
decorator to accept a scope equivalent to (but different from) one offunction
orsession
. For example:app -> session
. - The
providers_module
is now configurable onStore
. - The (non-aliased)
default_scope
is now configurable onStore
.
Store.empty
is now a callable instead of a property.
v0.1.0 - 2019-02-28
Initial release.
- Sync/async providers.
- Providers are named after their function, unless
name
is given.
- Providers are named after their function, unless
- Sync/async consumers.
function
andsession
scopes.- Session-scoped generator providers.
- Lazy async providers (function-scoped only).
- Provider discovery:
@aiodine.provider
,providerconf.py
,discover_providers()
. - Nested providers: providers can consume other providers.
- Use the
aiodine
module directly or create a separateStore
.