Cyclopts

Latest version: v2.6.0

Safety actively analyzes 622940 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

2.6.0

Features
* Add `App.name_transform` by BrianPugh in https://github.com/BrianPugh/cyclopts/pull/147
* Add `Parameter.name_transform` by BrianPugh in https://github.com/BrianPugh/cyclopts/pull/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**: https://github.com/BrianPugh/cyclopts/compare/v2.5.1...v2.6.0

2.5.1

Bug Fixes
* Fix displaying default if `required=True` and no default is present. by BrianPugh in https://github.com/BrianPugh/cyclopts/pull/146


**Full Changelog**: https://github.com/BrianPugh/cyclopts/compare/v2.5.0...v2.5.1

2.5.0

What's Changed
* Added support for Postponed Evaluation of types annotations (PEP-563) by OrHayat in https://github.com/BrianPugh/cyclopts/pull/138
* Move special-flag parsing logic from parse_args into parse_known_args by BrianPugh in https://github.com/BrianPugh/cyclopts/pull/130

**Full Changelog**: https://github.com/BrianPugh/cyclopts/compare/v2.4.2...v2.5.0

2.4.2

Bug Fixes
* Unfreeze help_flags and version_flags; create/delete commands on set/get by BrianPugh in https://github.com/BrianPugh/cyclopts/pull/127. Addresses #126


**Full Changelog**: https://github.com/BrianPugh/cyclopts/compare/v2.4.1...v2.4.2

2.4.1

Bug Fixes
* fixed showing choices of list,tuples and set type annotations by OrHayat in https://github.com/BrianPugh/cyclopts/pull/123
* Handle bare tuple annotation; more robust union logic. by BrianPugh in https://github.com/BrianPugh/cyclopts/pull/125

New Contributors
* OrHayat made their first contribution in https://github.com/BrianPugh/cyclopts/pull/123

**Full Changelog**: https://github.com/BrianPugh/cyclopts/compare/v2.4.0...v2.4.1

2.4.0

Features
* Added `async` function support by nesb1 in https://github.com/BrianPugh/cyclopts/pull/112
* Introduces a new exception: `UnknownOptionError` (see "Breaking Changes" below).

Breaking Changes
The following outlines incredibly-minor breaking changes:
* Introduces a new exception: `UnknownOptionError`.
* Change negative-flag-assignment-exception from `ValidationError` to generic `CycloptsError` (`ValidationError` inherits from `CycloptsError`).
* e.g. `--no-flag=True` now raises `CycloptsError` instead of `ValidationError`.
* This may only impact people who were specifically catching a `ValidationError` for this in a meta-app. This is an esoteric scenario that I imagine it doesn't exist in the wild.
* Change exception for unknown option token from `ValidationError` to `UnknownOptionError`.
* I also imagine this is a rare currently-in-the-wild scenario; anyone attempting to catch this exception in a meta-app is probably catching a `CycloptsError` instead of a `ValidationError`.

Bug Fixes
* Fixed incorrectly python_variable->cli_option translated names. Addresses 110.
* Fixes indexing errors when validators/converters raise exceptions without messages.

New Contributors
* nesb1 made their first contribution in https://github.com/BrianPugh/cyclopts/pull/112

**Full Changelog**: https://github.com/BrianPugh/cyclopts/compare/v2.3.2...v2.4.0

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.