==================
Features
--------
- Reworked entirely :code:`world`:
- Cleaner singletons declarations in :py:mod:`.world.singletons`
- Test utilities in :py:mod:`.world.test`. Those allow you to change locally, withing a
context manager, dependencies declarations. Hence you can replace an existing
dependency by a mock for example.
- Override utilities in :py:mod:`.world.test.override` to be used in tests.
- Debug utility :py:func:`.world.debug` which returns a tree of all the dependencies
that will/may be retrieved by Antidote.
- Add type hints to :py:obj:`.world.get` which can now be used like :code:`world.get[<class>]("x")`
- Add :py:obj:`.world.lazy` for dependencies to retrieve dependencies lazily.
- :py:func:`.implementation` is more flexible than :code:`implements` and supports changing the
implementation at runtime for example.
- :py:class:`.Service` and :py:class:`.Factory` expose a handy class method
:py:meth:`~.Service.with_kwargs` which allows you to specify some key word argument to
customize the service you're retrieving. Typically you would have only one database
service class but use this feature to have two different dependencies which each point to
different database.
- :py:class:`.Constants`, formerly :code:`LazyConstantsMeta`, supports a new of defining constants:
:py:obj:`.const`. It has two purposes, explicitly define constants and optionally specify
the actual type.
- Added :py:func:`.world.freeze` which will prevent any new dependencies to be added.
Breaking changes
----------------
- Drop support of Python 3.5.
- Singletons do check for duplicates now. Hence one cannot redefine an existing singleton
through :code:`world`.
- :code:`world.update_singletons` does not exists anymore, use :py:func:`.world.test.singleton_all` or
:py:func:`.world.test.singleton` instead.
- :code:`register` is now replaced by the class :py:class:`.Service` and provides mostly the same
features. The only corner cases are service that used factories, those should now
really use a factory, namely :py:class:`.Factory` or :py:class:`.factory`. If you cannot
inherit the super class for some reason, you may fallback to the class decorator
:py:func:`.service`.
- :code:`factory` for functions behaves the same way, however for factory classes the super
class :py:class:`.Factory` must be used. The dependency identifier has also been to changed,
the factory must now be specified like :code:`dependency factory` instead of :code:`dependency`.
- :code:`LazyConstantsMeta` has been replaced by the class :py:class:`.Constants`. One cannot
choose the lazy method anymore, but it is more flexible regarding definition of constants.
- :code:`implements` has been entirely reworked and split into :py:func:`.implementation` and
:py:class:`.Implementation`. The latter can be used for straightforward cases where only
one implementation exists. The first lets you handle all other cases with multiple
implementations which can vary during runtime or not.
- :code:`provider` has been replaced by the class decorator :py:func:`.world.provider`.
- Everything related to the container management has been removed for the public interface.
Changes
-------
- Add Python 3.9 support.
- public APIs are clearly defined as such, marked by :code:`API.public`. Overall public API
is also better defined.
- Improved Cython performance