23.15.0
Added
- A
ResourceWarning
is now raised when a container or a registry are garbage-collected with pending cleanups.
Changed
-
Cleanups for services are internally context managers now. For your convenience, if you pass an (async) generator function for a factory, the registry will automatically wrap it for you into an (async) context manager. #92
-
Pyramid:
svcs.pyramid.get()
now takes a Pyramid request as the first argument.svcs.pyramid.get_pings()
also doesn't look at thread locals anymore. If you still want to use thread locals, you can usesvcs.pyramid.from_svcs(None)
to obtain the currently active container. -
Flask:
replace_(value|factory)()
is now calledoverwrite_(value|factory())
to be consistent with the docs lingo. They also completely reset the instantiation cache now (practically speaking: they close the container).
Removed
svcs.Container.forget_about()
. It doesn't make any sense in a world of recursive dependencies. Just reset the container usingsvcs.Container.(a)close()
.