Changelog¶
All notable changes to CoTyper are documented here. The format follows Keep a Changelog, and the project uses semantic versioning.
Each release's section is also used as its GitLab release notes.
Unreleased¶
0.15.1 - 2026-09-30¶
Fixed¶
- The source distribution only contains the package, tests, docs, examples and top-level metadata files
(an allowlist in
[tool.hatch.build.targets.sdist]). The 0.15.0 sdist was 6 MB (earlier ones up to 30 MB) because it was built in a local checkout and picked up untracked files such as.claude/worktrees/. It is now about 100 kB, and CI fails if it grows past 500 kB. The wheel is unchanged.
0.15.0 - 2026-09-30¶
Changed¶
- Breaking: importing CoTyper no longer configures logging. Previously, setting
LOG_LEVEL/LOG_BACKENDor placing acotyper_log.tomlin the working directory made the import configure the root logger, install Rich's traceback hook and replace loguru's sinks. Now CoTyper only logs to thecotyperlogger (with aNullHandler). Callcotyper.configure_logging()to opt in to the previous setup. richis a regular dependency, since CoTyper always imported it. Therichextra still exists but adds nothing.- Releases are published when a
v<version>tag is pushed, instead of on every push tomaster. - CI tests every supported Python version (3.10 to 3.14) and the oldest allowed dependency versions.
App.struct_commandandApp.commandpass their other keyword arguments straight totyper.Typer.commandinstead of copying its signature. Options added in future Typer versions work without a CoTyper release.- Internal:
cotyper.compose.decompilewas split intoschema,type_dispatch,help_textandrebuild. Imports fromcotyper.compose.decompilekeep working.
Added¶
- Dataclasses (stdlib and pydantic) and
TypedDicts can be used as command parameters. They're unfolded into options like pydantic models, and the command receives instances of the original types. - Dict fields accept any scalar key type that a JSON key can convert to:
bool,Enum,Literal,date,Decimal,UUID,Path, ... Unsupported key types (containers, models) raiseUnsupportedTypeErrorwhen the command is defined, instead of Typer's "Type not yet supported". async defcommands (withstruct_commandandcommand) are run withasyncio.run. Before, the command silently did nothing: it exited with status 0 and the coroutine was never awaited.add_print_config_option="print_config"onstruct_commandadds a--print-configflag. It prints the effective configuration (defaults, config file, environment, command line) as JSON that--config-filecan load again, and exits.default_config_files=[...]onstruct_command/command: the first existing file is used when the config-file option isn't given. Withenv_prefix, the config-file option can also come from an environment variable.App(env_prefix="MYAPP_"): everystruct_commandoption can be set through an environment variable such asMYAPP_CONFIG_USER_NAME. Order of precedence: defaults < config file < environment < command line.App.register_type_processor()registers custom field types for one app only. The module-levelregister_type_processorstill exists, but it affects every app.- A
py.typedmarker, so type checkers use CoTyper's annotations. cotyper.__version__.- Exceptions
CotyperError,UnsupportedTypeErrorandDefinitionErrorfor problems found while building a CLI. They subclass theTypeError/ValueErrorthat was raised before, so existingexceptclauses keep working. - The extension points
register_type_processor,TypeProcessingResult,configure_loggingandLogConfigcan be imported fromcotyper, and the API reference documents them. - Package metadata: a PEP 639 license expression, classifiers (including
Typing :: Typed), keywords and Issues/Changelog URLs. configure_logging()with thelogurubackend now forwards CoTyper's own log records to loguru.
Deprecated¶
- The
wraps_commandargument ofstruct_command/commandandApp.register_command_wrapping(). They never had an effect: the value was stored but never read. They now emit aDeprecationWarning.
Removed¶
cotyper.log.log_function_call, an unused decorator.
Fixed¶
- A config-file value that is neither an existing file nor an inline JSON object now fails with
config file '...' does not exist, instead of being parsed as JSON and failing withExpecting value. - Importing CoTyper failed on Python 3.10:
tomllibdoesn't exist there, and an annotation usedtype[T | ...]. - Model descriptions at the top of help panels:
- They no longer leak into same-named panels of plain Typer apps in the same process.
- A command no longer shows another command's model description when two commands share a parameter prefix.
- A parameter's description in the command's
Args:docstring is no longer lost to a description registered earlier by another command.
pydantic-coreis no longer pinned to an exact version, which conflicted with other packages' requirements.
0.14.0 - 2026-09-29¶
Added¶
add_config_file_optionalso loads.tomland.yaml/.ymlconfig files (chosen by the file suffix). YAML needs the newyamlextra:pip install "cotyper[yaml]".
0.13.1.post1 - 2026-09-29¶
Earlier versions are not described in this file. See the tags and GitLab releases.