Changelog
User-facing changes to pyiv, in Keep a Changelog
order. Install with pip install pyiv. Unreleased main is
pip install git+https://github.com/rl337/pyiv.git.
Unreleased
Added
binder.bind(...).to(...).for_package_present(distribution)/for_package_absent(distribution)— select a binding when an optional distribution is installed (any version) or missing. Sugar forfor_package_version(distribution, "*")/"!"(PACKAGE_PRESENT/PACKAGE_ABSENT). Pair them for an explicit both-sides choice, or usefor_package_presentplus an unconditional fallback. Documented with doctests and guide examples alongside other version-conditioned bindings.
1.1.0 - 2026-10-18
Added
Use-case stdlib injectable surfaces catalog (
docs/inspiration/stdlib-injectable-surfaces.md).pyiv.files—MountFilesystem,ZipFilesystem,TarFilesystem,MappingFilesystem;RealFilesystem(root=…)chroot; compatibility re-export viapyiv.filesystem.pyiv.time— consolidates Clock / DateTimeService (legacy modules re-export).pyiv.process—Environment,ProcessRunner,Argv(+ memory doubles).pyiv.log—Logger/LoggerFactory/LogSetup/LogOptions, CLI helpers, Commandadd_logging_args/configure_logging_from_args.pyiv.entropyandpyiv.hashinginjectable Real/Synthetic surfaces.HttpClientOptionsfrozen options bag for HTTP clients (Settings-friendly without a pydantic dependency).Agent skill / rule for public types (
public-types): knobs as frozen dataclasses; services as Protocol/ABC; no soft pydantic imports.Customer-facing agent skills under
agent-skills/(use-pyiv,pyiv-testing,pyiv.mdc) plus guide :doc:guide/agent-skillswith GitHub raw links onmain. Maintainer requirement: keep them in sync when public APIs/doubles change.
Changed
Named/Matchedare frozen dataclasses (eq/hash still ignoreNamed.default).RecordedRequest,StreamReply, and consoleTerminalEventhierarchy are frozen dataclasses.Homepage / testing guide describe use-case stdlib doubles (files, time, log, process, …).
1.0.0 - 2026-10-16
Added
:mod:
pyiv.http— injectableHttpClient/AsyncHttpClientwith typedHttpResponse, streaming, andHttpError/HttpTimeoutError/HttpStatusError. StdlibUrllibHttpClient/AsyncUrllibHttpClientplusMemoryHttpClienttest doubles.Guide page “Migrating from 0.x to 1.x”.
pyiv-commonRequestsHttpClientimplementingHttpClient(RequestsClientremains an alias).Version-conditioned bindings on the fluent Binder:
for_version,for_package_version, andfor_python_version.:mod:
pyiv.version—VersionSource/VersionParserprotocols, named parser registry (PEP440default),InvalidVersion/InvalidSpecifier, injectablePythonVersionProvider(SysPythonVersionProvider/FixedPythonVersionProvider),PackageVersionSource,MapVersionSource, and candidate records.:mod:
pyiv.pep440— public PEP 440 engine andPep440VersionParser(raises subclasses ofInvalidVersion).Guide page “Version-conditioned bindings” for env-stable selection, custom domains, and fallback rules.
Removed
pyiv.network(NetworkClient,HTTPClient,HTTPSClient) andChainType.NETWORK_CLIENT. Use :mod:pyiv.httpinstead (see the 0.x→1.x migration guide).
0.4.3 - 2026-10-13
Added
Injector.catalog_keys(value_type)lists map-multibind catalog ids without constructing plugins (CLI / docs over DI-owned catalogs).Injector.named_keys(binding_type)listsNamedqualifiers bound for a type without constructing.Config.contribute_map/contribute_map_entrieswithon_conflict="replace"|"error"|"keep"for explicit catalog merges.ReflectionConfig.register_module(..., as_multibind=..., key_attr=...)opt-in path that accumulates discoveries into map/set/list multibinds instead of last-wins unqualifiedregister.Guide page “Catalogs without registries” (facade pattern, host contrib, reflection into catalogs).
Project logo in the documentation sidebar (RTD left nav header).
Documentation site favicon.
0.4.2 - 2026-09-27
Added
Constructor injection via
Annotated[T, Named(...)]/Annotated[T, Matched(...)], includingOptional[T](Noneonly when there is no candidate; ambiguity still errors) andAnnotated[Provider[T], Named|Matched]for lazy qualified lookup.InjectorProvideraccepts aKeyas well as a bare type.
Notes
Annotated Named/Matched applies to constructor (and callable factory) parameters only.
inject_members/ field injection still resolve bare types; useinject(Key(...))for qualified field wiring.Matchedremains inject-only (not valid onregister_key/bind_key).
0.4.1 - 2026-09-27
Added
Namedaccepts a string or list/tuple of tags (normalized to a set);Named("json") == Named(["json"]).Named(..., default=True)marks the preferred binding for bareinject(Type)and forMatchedtie-breaks (at most one per type).Matched(required=..., prefer=...)inject-only qualifier: required tags must match, then maximize prefer overlap, thendefault=True.Bare
inject(Type)falls back to Named bindings when no unqualified registration exists (default, sole candidate, or ambiguous error).
Changed
Duplicate identical
Namedtag sets for the same type raise at registration (no silent last-wins).install/ merge with replace still overwrites the same tag set.Ambiguous Named/
Matchedresolution raisesCreationErrorwithambiguous=True;Optional[T]does not treat that as a missing binding.
0.4.0 - 2026-09-25
Added
pyiv-commonextra package (pip install pyiv-commonorpip install pyiv[common]):YAMLSerDe(PyYAML) andRequestsClient(requests). Corepyivstays stdlib-only.Module composition:
Config.install/Binder.install(last install wins).PrivateConfigwithexpose(), andInjector.create_child()for hierarchical injectors.MapMultibinder/Config.map_multibinderforDict[K, V]injection.override(base).with_(overrides)for test/prod binding overlays.Stage.DEVELOPMENT/Stage.PRODUCTIONwith eager singleton warmup.require_explicit_bindings()to disable JIT construction.CreationErrorwith dependency path and circular-dependency detection.Untargeted
binder.bind(Concrete)self-bindings;bind_keyregisters qualified keys; injectInjectorby type annotation.
Changed
YAMLSerDemoved from core topyiv-common.from pyiv.serde import YAMLSerDestill works if the extra is installed.Missing bindings and injection failures raise
CreationError(with path) instead of bareValueError/TypeErrorat the injector boundary.Constructor deps that are concrete types are just-in-time constructed when explicit bindings are not required (transitive JIT).
Public class docstrings now state why each type exists and include runnable usage examples (doctest-backed) across core DI and test doubles.
0.3.0 - 2026-09-07
First public PyPI release.
Added
pip install pyiv(Python 3.8–3.13).Changelog on the docs site and in package metadata.
py.typedso type checkers treat pyiv as typed.
Changed
README, docs, and GitHub Releases use
pip install pyivinstead of a git URL.
0.2.24 - 2026-08-29
Added
User guide: binding, scopes, keys and collections, testing with doubles.
Homepage version badge from the package version.
Fixed
Sphinx autodoc no longer breaks on Markdown-style lists in docstrings.
Package overview matches homepage features (injection, scopes, keys, test doubles), not factory-first copy.
0.2.22 - 2026-08-28
Changed
Package metadata: author Richard Lee, documentation https://rl337.org/pyiv/.
GitHub Releases and
RELEASE.mdinstall from git until PyPI exists.
0.2.21 - 2026-08-28
Added
Product docs at https://rl337.org/pyiv/ (git install, grouped API nav).
Doctests in CI for examples in
pyivmodule docstrings.
Fixed
register_keykeeps the implementation class.Multibinder.addregisters the binding.
0.2.20 - 2026-08-28
Fixed
Singleton resolution no longer recurses into itself.
CI fails when pytest exits 2 (collection errors), not only on test failures.
Earlier 0.2.x
Pre-PyPI history. Not every auto-bump is listed.
Added
Guice-style Provider, Scope, Key, Binder, MembersInjector, Optional, and Multibinder.
Clock, Filesystem, Console (including TTY/PTY), and DateTimeService test doubles.
Reflection, SerDe, network clients, and Command.
Per-injector and process-wide singletons.