Skip to content

Releases: Tinche/incant

v23.2.0

30 Oct 17:51
Compare
Choose a tag to compare
  • Incanter.(a)invoke() has been renamed to Incanter.(a)compose_and_call() for clarity.
    Incanter.(a)invoke() is still present as an alias for backwards compatibility.
  • Incanter.prepare() has been renamed to Incanter.compose() for clarity.
    Incanter.prepare() is still present as an alias for backwards compatibility.
  • Introduce Incanter.adapt.
  • Dependency factories of constants (lambda: 1) are now folded to just the constants in the generated source code, avoiding unnecessary function calls.
  • Incanter.register_by_type() now also triggers on type equality (in addition to subclasses).
    This makes it usable with types such as Callable.
  • Python 3.12 support.

v23.1.0

28 Oct 23:53
Compare
Choose a tag to compare
  • Fix dependencies satisfying themselves.
  • Switch to PDM.
  • Fix parameter dependencies using the new union syntax.
  • The documentation is now generated by Sphinx and available at incant.threeofwands.com.

v22.2.2

28 Oct 23:54
Compare
Choose a tag to compare
  • Fix an optimization for explicitly sync functions.
  • Fix an issue incanting unnecessary positional arguments.
  • Support __future__ annotations (PEP 563) on Python 3.10+.

v22.2.1

28 Oct 23:54
Compare
Choose a tag to compare
  • Fix an issue when wrapping a sync function with an async one.

v22.2.0

28 Oct 23:55
Compare
Choose a tag to compare
  • Python 3.11 support.
  • Fix unbound local error while generating code.
    (#4)
  • Avoid using local variables in generated code when possible.
  • When incant.prepare cannot do anything for a function, return the original function for efficiency.

v22.1.0

28 Oct 23:55
Compare
Choose a tag to compare
  • Breaking change: due to limitations in autodetecting context managers (both sync and async), context manager dependencies must be explicitly registered by passing is_context_manager="sync" (or async) to the registration functions.
  • Injection can be customized on a per-parameter basis by annotating a parameter with Annotated[type, incant.Override(...)].
  • Implement support for forced dependencies.
  • Sync context managers may now be dependencies.
  • incanter.a/incant() now handles unfulfilled parameters with defaults properly.
  • Switched to CalVer.