All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Support for Python
3.13
- Support for Python version
3.8
.
- Support for Python
3.11
and3.12
- Support for
no_user_input
inAcknowledge.display()
andEcho.display()
.
- Raise
ValueError
when dynamic value returns the wrong type. BasicQuestion
validatesvalue_if_not_asked
using theValidator
if provided.Choice
validatesvalue_if_not_asked
for dynamic options that depend on the currentAnswers
.
- Support for Python version
3.7
. tests/
directory no longer included in distributions.
- Use hatch for build backend.
- Update project metadata for ownership change.
- Use OpenID Connect as a trusted publisher for uploading releases.
- Ability for
Choice
to display a custom message instead of the value being selected. This includes a new type alias (Options
) which supports both theMapping[str, str]
andList[str]
forms. (#389)
- The
OptionList
type forChoice
in favor ofOptions
(#389)
- All exceptions raised by
columbo
listed in the docstrings. Improved phrasing to make messaging consistent.
- Expand acceptable versions of
typing-extensions
to include v4
- Python version
3.10
tested during CI - Python version
3.10
added to package classifiers should_ask
keyword argument forEcho
andAcknowledge
interactions (#356)
BasicQuestion.ask()
will only evaluate dynamic values for the prompt message and default value once instead of repeatedly when the response was invalid.
-
Prevent infinite loop when the default value for a
BasicQuestion
does not satisfy theValidator
andno_user_input
was set toTrue
. Now raises aValueError
when this situation is detected.The intent was that the default value would always satisfy the
Validator
, but that was not enforced or explicitly documented.
- Support for Python version
3.6
.
value_if_not_asked
kwarg forQuestion
interactions to set a value if the question is not asked (#169)
dataclasses
was not listed as a dependency for versions of Python < 3.7
- Support for
Validator
s that returnOptional[str]
- Improved validation for converting question names to command line arguments (#82)
- Support for
Validator
s that returnOptional[str]
(#39)
First public release. No code changes from v0.8.0.
- All
Interaction
s gained acopy()
method to allow for creating slightly altered instances of an existingInteraction
. parse_args()
andformat_cli_help()
accept an optionalparser_name
to be displayed in errors and help text.
- Stop producing universal wheels.
StaticOrDynamicValue
enforces that the result of the callable must be the same type as the static type.
DynamicValue
is no longer exposed as a type alias.
format_cli_help()
function to produce CLI help text.
- Type hints on public API. Be more restrictive when functions should not be making mutations. Be less restrictive when functions don't rely on specific implementations.
CliException
inherits fromColumboException
.- Raise
DuplicateQuestionNameException
if a list of interactions contains multiple questions with the same name. The same exception is also raised when an existing answers dictionary already contains a name used by a given questions.
parse_args()
function now accepts an initial dictionary ofanswers
.
- Expose additional type hints used in signatures of public API.
exit_on_error
added toparse_args()
as an optional argument. WhenFalse
, the function will raise an exception instead of exiting the application if the arguments can't be parsed.
- Rewrote Columbo example script text.
- Made example script stand alone.
- Test against each supported python version in CI.
- Add support for python 3.8.
- Use
prompt-toolkit
for user interaction instead ofclick
. - Mark
user_io
sub-module as private. - Expose exception types raised by library.
- Add
Args
class thatuser_io
relies on. - Explicit type is required for
singledispatch
on python 3.6. - Specify minimum supported python version.
- Ability to run the module as an application.
- Dynamic loading of questions from a file.
- return type of
Validator
return type updated frombool
toOptional[str]
is_valid
function updated tovalidate
, return type updated frombool
toOptional[str]
BasicQuestion
constructor now respects thevalidator
argument- If
validator
callable provided, question will be asked until validator returnsTrue
- If
get_answers()
takes optionalanswers
dict, appending new answers to this as opposed to new dictionary
get_answers()
takes list of interactions and builds dict of answers, handling user I/O
Initial Release