Skip to content

v0.6.0

Pre-release
Pre-release

Choose a tag to compare

@zerlok zerlok released this 07 Mar 23:25

v0.6.0

New Features

  • Click integration (astlab[click])

  • A new optional extra adds PythonVersionParamType, a click.ParamType for parsing Python version CLI options:

  import click
  from astlab.click import PythonVersionParamType

  @click.option("--python", type=PythonVersionParamType(), default=None)
  def generate(python):
      ...
  • The metavar displays all supported versions (e.g. 3.9|3.10|3.11|3.12|3.13|3.14) and invalid input produces a clear error message.

  • PythonVersion improvements

  • PythonVersion.get_current() — returns the PythonVersion matching the running interpreter
  • PythonVersion.get_all_supported(*, ignore_outdated_runtime=False) — iterates over all supported versions, optionally including those newer than the current runtime
  • PythonVersion.parse() now accepts None (resolves to current runtime version) and respects the ignore_outdated_runtime flag

Bug Fixes

  • Fixed typing.Union and typing.Optional not being correctly loaded, inspected, and annotated — they are now consistently represented as UnionTypeInfo
  • Fixed Optional annotation to emit Optional[X] on Python < 3.10 (instead of X | None)
  • Fixed get_metavar signature in PythonVersionParamType for Python 3.9 compatibility (click 8.3+ changed the signature on 3.10+)
  • Fixed mypy errors on Python 3.9 and 3.10 in version.py and click tests

Installation

  # Core library
  pip install astlab

  # With click integration
  pip install astlab[click]