Repository navigation
Release 0.80.0 - #332
Merged
Merged
Release 0.80.0#332
Conversation
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the version to 0.80.0. A minor, because
is_providedno longer counts an undecorated subclass as provided.Merge this, then tag:
$ git tag 0.80.0 && git push origin 0.80.0The workflow checks the tag against
pyproject.toml, runs the linters and the tests, and publishes. Below is the text for the release notes.Only a decorated class is provided
is_providedread__provided__withhasattr, and a subclass inherits theattribute. Every subclass of a provided class counted as provided, with the
base's whole metadata:
container.scan()registered classes nobody marked, aninherited
aliasregistered the same interface twice, and an inheritedfrom_contextclaimed a registration nobody made.Only the class a decorator was applied to is provided now:
A subclass that used to resolve by inheriting its base's scope raises
LookupErrornaming the class and saying to decorate it.A module subclass keeps its base providers
ModuleMetacollected providers from the class being defined, so a subclasskept only what it declared itself:
A subclass that redefines a provider replaces it, and an earlier base wins over
a later one, the way the MRO resolves an attribute.
Reopening a container makes its resources again
Closing a container ran the finalisers but kept the instances, so the second
withhanded out an object whose resource was already closed:The instances whose finalisers ran are dropped on close. Everything else the
context holds stays, so an instance with no resource of its own is still the
same object across the two blocks.
Releasing an instance closes its resource
container.release(T)dropped the instance and left its generator open, so aconnection stayed checked out until the container closed. It now runs the
finaliser, and drops the instance even when the finaliser raises.
container.reset()releases everything before re-raising the first failure,instead of stopping at it.
A scope whose entry fails unwinds
Python skips
__exit__when__enter__raises, so a request scope that failedpart-way through entering left the resources it had already opened. It now
closes them before propagating.
Closing a context that holds async resources says so
Exiting a context with
withwhen it holds an async resource left thatresource open and said nothing. It now raises:
Generic parameters a base class renamed
A class that renamed a TypeVar on its way down the hierarchy resolved to the
variable instead of the type:
Parameters nested inside an argument, like
Repo[Box[T]], resolve too.Framework extensions
install()and reached at requesttime. Its routes were never wired, and a request into it raised
AttributeError: 'State' object has no attribute 'container'.install()is validated as it is added, with themessage a route present at install time gets. It used to reach the handler
unwired and raise
TypeError: Dependency type is not set.injected, not just the first.
pydantic_settings.install()can run twice, withoverride=True, andnames the model and the field when a provider is already registered.
Clearer failures
An extension whose package is missing says what to install:
The
pytestplugin no longer breaks every test run whenanyiorenames ahelper, and reports what it could not import instead.
Dependencies
The
wraptfloor moves to1.17.3.container.ref()builds on thepure-Python
ObjectProxy, because the C one ignores the__wrapped__override that makes a reference lazy, and
wrapt.wrappersexposes thepure-Python class from
1.17.3on.