Incant

Latest version: v23.2.0

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

23.2.0

- `Incanter.(a)invoke()` has been renamed to {meth}`Incanter.(a)compose_and_call() <incant.Incanter.compose_and_call>` for clarity.
`Incanter.(a)invoke()` is still present as an alias for backwards compatibility.
- `Incanter.prepare()` has been renamed to {meth}`Incanter.compose() <incant.Incanter.compose>` for clarity.
`Incanter.prepare()` is still present as an alias for backwards compatibility.
- Introduce {meth}`Incanter.adapt <incant.Incanter.adapt>`.
- Dependency factories of constants (`lambda: 1`) are now folded to just the constants in the generated source code, avoiding unnecessary function calls.
- {meth}`Incanter.register_by_type() <incant.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.

23.1.0

- Fix dependencies satisfying themselves.
- Switch to [PDM](https://pdm.fming.dev/latest/).
- Fix parameter dependencies using the new union syntax.
- The documentation is now generated by Sphinx and available at [incant.threeofwands.com](https://incant.threeofwands.com).

22.2.2

- Fix an optimization for explicitly sync functions.
- Fix an issue incanting unnecessary positional arguments.
- Support `__future__` annotations (PEP 563) on Python 3.10+.

22.2.1

- Fix an issue when wrapping a sync function with an async one.

22.2.0

- Python 3.11 support.
- Fix `unbound local error` while generating code.
([4](https://github.com/Tinche/incant/issues/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.

22.1.0

- _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.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.