Releases: BrianPugh/cyclopts
v2.8.0
What's Changed
- Introduced new attribute,
App.version_format
. The verstion string was previously printed as-is, but is now formatted with the specified format, falling back tohelp_format
if not specified. By @BrianPugh in #188
Full Changelog: v2.7.1...v2.8.0
v2.7.1
Bug Fixes
- Have meta apps inherit their parenting config. by @BrianPugh in #184
Misc
- deferred
import docstring_parser
by @BrianPugh in #182
Full Changelog: v2.7.0...v2.7.1
v2.7.0
Features
- New
App.config
field, that allows the loading of defaults from files.cyclopts.config.Json
- Load defaults from a json file.cyclopts.config.Yaml
- Load defaults from a yaml file.cyclopts.config.Toml
- Load defaults from a toml file.cyclopts.config.Env
- Load defaults from environment variables.
- New
Parameter.env_var_split
attribute. Defaults tocyclopts.env_var_split
, which behaviors similarly to Click's multiple values from environment values.
Full Changelog: v2.6.2...v2.7.0
v2.6.2
Features
- New
App.help_format="rich"
option.
Bug Fixes
- Consistent help formatting (that respects
help_format
) across the different sections of the generated help-page. by @BrianPugh in #166 help_format
is now keyword only. by @BrianPugh in #164- Improve type inference when using decorators with pyright by @breathe in #172
New Contributors
Full Changelog: v2.6.1...v2.6.2
v2.6.1 - Faster Importing
Significantly improve cyclopts
import speed by lazy loading dependencies.
What's Changed
- defer
asyncio
andimportlib
import by @OrHayat in #154 - defer optional
pydantic
import, speeding up initial import by @BrianPugh in #155 - defer
rich
import. Also defer difflib by @BrianPugh in #156
Full Changelog: v2.6.0...v2.6.1
v2.6.0
Features
- Add
App.name_transform
by @BrianPugh in #147 - Add
Parameter.name_transform
by @BrianPugh in #149
This release adds two new fields: App.name_transform
and Parameter.name_transform
. The function's responsibility is to convert python identifiers to their CLI counterparts and has signature:
def name_transform(s: str) -> str:
...
These name transforms can be set at a global level for your app:
app = App(
name_transform=lambda name: name, # don't modify the name at all. This applies to command names.
default_parameter=Parameter(name_transform=lambda name: name), # This applies to parameter names.
)
They can also be set in individual subapps (subapps inherit name_transform
from their parent), or in individual Annotated[...., Parameter(name_transform=my_custom_transform)]
definitions.
Full Changelog: v2.5.1...v2.6.0
v2.5.1
Bug Fixes
- Fix displaying default if
required=True
and no default is present. by @BrianPugh in #146
Full Changelog: v2.5.0...v2.5.1
v2.5.0
What's Changed
- Added support for Postponed Evaluation of types annotations (PEP-563) by @OrHayat in #138
- Move special-flag parsing logic from parse_args into parse_known_args by @BrianPugh in #130
Full Changelog: v2.4.2...v2.5.0
v2.4.2
Bug Fixes
- Unfreeze help_flags and version_flags; create/delete commands on set/get by @BrianPugh in #127. Addresses #126
Full Changelog: v2.4.1...v2.4.2
v2.4.1
Bug Fixes
- fixed showing choices of list,tuples and set type annotations by @OrHayat in #123
- Handle bare tuple annotation; more robust union logic. by @BrianPugh in #125
New Contributors
Full Changelog: v2.4.0...v2.4.1