Skip to content

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_BACKEND or placing a cotyper_log.toml in 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 the cotyper logger (with a NullHandler). Call cotyper.configure_logging() to opt in to the previous setup.
  • rich is a regular dependency, since CoTyper always imported it. The rich extra still exists but adds nothing.
  • Releases are published when a v<version> tag is pushed, instead of on every push to master.
  • CI tests every supported Python version (3.10 to 3.14) and the oldest allowed dependency versions.
  • App.struct_command and App.command pass their other keyword arguments straight to typer.Typer.command instead of copying its signature. Options added in future Typer versions work without a CoTyper release.
  • Internal: cotyper.compose.decompile was split into schema, type_dispatch, help_text and rebuild. Imports from cotyper.compose.decompile keep 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) raise UnsupportedTypeError when the command is defined, instead of Typer's "Type not yet supported".
  • async def commands (with struct_command and command) are run with asyncio.run. Before, the command silently did nothing: it exited with status 0 and the coroutine was never awaited.
  • add_print_config_option="print_config" on struct_command adds a --print-config flag. It prints the effective configuration (defaults, config file, environment, command line) as JSON that --config-file can load again, and exits.
  • default_config_files=[...] on struct_command/command: the first existing file is used when the config-file option isn't given. With env_prefix, the config-file option can also come from an environment variable.
  • App(env_prefix="MYAPP_"): every struct_command option can be set through an environment variable such as MYAPP_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-level register_type_processor still exists, but it affects every app.
  • A py.typed marker, so type checkers use CoTyper's annotations.
  • cotyper.__version__.
  • Exceptions CotyperError, UnsupportedTypeError and DefinitionError for problems found while building a CLI. They subclass the TypeError/ValueError that was raised before, so existing except clauses keep working.
  • The extension points register_type_processor, TypeProcessingResult, configure_logging and LogConfig can be imported from cotyper, 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 the loguru backend now forwards CoTyper's own log records to loguru.

Deprecated

  • The wraps_command argument of struct_command/command and App.register_command_wrapping(). They never had an effect: the value was stored but never read. They now emit a DeprecationWarning.

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 with Expecting value.
  • Importing CoTyper failed on Python 3.10: tomllib doesn't exist there, and an annotation used type[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-core is no longer pinned to an exact version, which conflicted with other packages' requirements.

0.14.0 - 2026-09-29

Added

  • add_config_file_option also loads .toml and .yaml/.yml config files (chosen by the file suffix). YAML needs the new yaml extra: 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.