Releases: your-tools/python-cli-ui
Releases · your-tools/python-cli-ui
v0.8.0
Highlights
-
Breaking change: Rename main package from
ui
tocli_ui
. This name is less likely to
cause clash with existing code. -
Breaking change Instead of hard-coding ANSI sequences names and values, use
colorama
instead.
All existing names have been kept, but some of the values changed slighlty. -
ask_
functions now take a variable number of tokens as first argument.
This allows to color the prompt when requiring input from the user, for instance:
res = cli_ui.ask_yes_no(
"Deploy to",
cli_ui.bold, "production", cli_ui.reset, "?",
default=False
)
- Breaking change: Because of this new feature, the list of choices used by
ask_choice
is now a named keyword argument::
# Old (<= 0.7)
ask_choice("select a fruit", ["apple", "banana"])
# New (>= 0.8)
ask_choice("select a fruit", choices=["apple", "banana"])
Other Changes
- Annotate everything with
mypy
. - Use
black
for automatic code formatting. - If you nedd the
record_message()
pytest fixture in your own tests, you can now
import it withfrom cli_ui.tests import message_recorder
.
v0.7.4
- Remove buggy
entry_points
fromsetup.py
.
v0.7.3
- Switch to
dmenv
. This makes it possible to usepython-cli-ui
withcolorama >= 4.0
.
v0.7.2
v0.7.1
- Fix crash in
ask_password
when password was empty. - Let the
KeyboardInterrput
exception propagate back to the caller instead of catching
it ourselves and returningNone
. Reported by @theodelrieu
v0.7.0
v0.6.0
- Export
Color
class.
That way you can define your own colors if you need to.
v0.5.0
- Export a
Symbol
class, to use when you do not want to force color as withUnicodeSequence
(Thanks, @arnaudgelas)
v0.4.0
- Expose the previously private
UnicodeSequence
class.