Releases: Lancetnik/FastDepends
Releases · Lancetnik/FastDepends
2.4.2
What's Changed
- build(deps): bump dawidd6/action-download-artifact from 3.1.1 to 3.1.2 by @dependabot in #74
- fix (#75): correct main empty body processing by @Lancetnik in #76
Full Changelog: 2.4.1...2.4.2
2.4.1
What's Changed
- chore: remove optional dependencies, fix typos by @Lancetnik in #73
Full Changelog: 2.4.0...2.4.1
2.4.0
What's Changed
- Add
fast_depends.shema.get_schema
method to generate wrapped function payload (close #6) - Improve
ForwardRef
resolution - Update copyrights
- Update Readme and docs to close #59
- build(deps-dev): bump ruff from 0.1.11 to 0.1.13 by https://github.com/dependabot in #60
- release: 2.4.0 by @Lancetnik in #61
Full Changelog: 2.3.1...0.2.4
0.2.4b0
What's Changed
- Add
fast_depends.shema.get_schema
method to generate wrapped function payload (close #6) - Improve ForwardRef resolution
- Update copyrights
- Update Readme and docs to close #59
- build(deps-dev): bump ruff from 0.1.11 to 0.1.13 by @dependabot in #60
- release: 2.4.0 by @Lancetnik in #61
Waiting for FastStream update to release stable version
Full Changelog: 2.3.1...0.2.4b0
2.3.1
Correct model.flat_params
calculation
Full Changelog: 2.3.0...2.3.1
2.3.0
What's Changed
- Multiple
Annotated
arguments support:from typing import Annotated from annotated_types import Ge from pydantic.functional_validators import AfterValidator @inject() def f(a: Annotated[int, Ge(10), AfterValidator(lambda x: x + 10)]) -> int: return a assert f(10) == 20
- Support correct Generator annotation
@inject def simple_func(a: str) -> Iterator[int]: for _ in range(2): yield a for i in simple_func("1"): assert i == 1
- solve async dependencies without subdependencies in parallel tasks
- solve
CustomField
with asyncuse_field
in parallel - build(deps-dev): bump ruff from 0.1.9 to 0.1.11 by @dependabot in #56
- get rid of protected objects by @VitailOG in #57
- feat: parallel dependencies resolving by @Lancetnik in #58
New Contributors
Full Changelog: 2.2.8...2.3.0
2.2.8
Restore fast_depends._compat.CreateBaseModel
to save FastStream<0.3.7 compatibility
Full Changelog: 2.2.7...2.2.8
2.2.7
What's Changed
- bugfix: correct yield overriding by @Lancetnik in #50
from fast_depends import inject, Depends, dependency_provider def dep1(): yield 1 def dep2(): yield 2 @inject() def func(d = Depends(dep1)): return d assert func() == 1 with dependency_provider.scope(dep1, dep2): assert func() == 2
- build(deps): bump actions/download-artifact from 3 to 4 by @dependabot in #44
- build(deps-dev): bump black from 23.11.0 to 23.12.0 by @dependabot in #48
- build(deps-dev): bump isort from 5.13.0 to 5.13.2 by @dependabot in #47
- build(deps): bump dawidd6/action-download-artifact from 2.28.0 to 3.0.0 by @dependabot in #45
- build(deps-dev): bump ruff from 0.1.7 to 0.1.8 by @dependabot in #46
- build(deps): bump actions/upload-artifact from 3 to 4 by @dependabot in #43
Full Changelog: 2.2.6...2.2.7
2.2.6
What's Changed
Provides you with the ability to setup pydantic config using @inject
@inject(pydantic_config={"str_max_length": 8})
def limited_str(a: str):
...
limited_str("*" * 9) # raises ValidationError
Also, added context manager method to override dependencies:
from fast_depends import Depends, dependency_provider, inject
def base_dep():
return 1
def override_dep():
return 2
@inject
def func(d=Depends(base_dep)):
return d
with dependency_provider.scope(base_dep, override_dep):
assert func() == 2
assert func() == 1
- feat (#38): add pydantic config option by @Lancetnik in #42
Full Changelog: 2.2.5...2.2.6
2.2.5
What's Changed
New CustomField
syntax to support classes injection:
class Header(CustomField):
def use(
self,
/, # <- new thing
**kwargs
):
kwargs = super().use(**kwargs)
kwargs[self.param_name] = kwargs["headers"][self.param_name]
return kwargs
- docs: fix typo by @Lancetnik in #36
- fix: support custom fields for classes injection by @Lancetnik in #39
- chore: drop python3.7 support
Full Changelog: 2.2.4...2.2.5