Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Commit 8b6782c

Browse files
committed
Extract Changelog from API documentation and update it
1 parent 41571ff commit 8b6782c

3 files changed

Lines changed: 119 additions & 77 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/changelog.rst

docs/changelog.rst

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
Changelog
2+
----------
3+
4+
v0.8.0
5+
++++++
6+
7+
Highlights
8+
~~~~~~~~~~
9+
10+
* ``ask_`` functions now take a variable number of tokens as first argument.
11+
This allows to color the prompt when requiring input from the user, for instance::
12+
13+
res = cli_ui.ask_yes_no(
14+
"Deploy to",
15+
cli_ui.bold, "production", cli_ui.reset, "?",
16+
default=False
17+
)
18+
19+
* **Breaking change**: Because of this new feature, the list of choices used by
20+
``ask_choice`` is now a named keyword argument::
21+
22+
# Old (<= 0.7)
23+
ask_choice("select a fruit", ["apple", "banana"])
24+
# New (>= 0.8)
25+
ask_choice("select a fruit", choices=["apple", "banana"])
26+
27+
28+
Other Changes
29+
~~~~~~~~~~~~~~
30+
31+
* Annotate everything with ``mypy``.
32+
* Use ``black`` for automatic code formatting.
33+
34+
v0.7.4
35+
++++++
36+
37+
* Remove buggy ``entry_points`` from ``setup.py``.
38+
39+
v0.7.3
40+
++++++
41+
42+
* Switch to ``dmenv``. This makes it possible to use ``cli-ui`` with ``colorama >= 4.0``.
43+
44+
v0.7.2
45+
++++++
46+
47+
* Switch to `poetry <https://poetry.eustace.io>`_ .
48+
49+
v0.7.1
50+
++++++
51+
52+
* Fix crash in ``ask_password`` when password was empty.
53+
* Let the ``KeyboardInterrput`` exception propagate back to the caller instead of catching
54+
it ourselves and returning ``None``. Reported by Théo Delrieu.
55+
56+
v0.7.0
57+
++++++
58+
59+
* Add ``ask_password`` and ``read_pasword``. Patch by @drazisil
60+
61+
v0.6.1
62+
++++++
63+
64+
* Fix metadata (owner moved from TankerApp to TankerHQ)
65+
66+
v0.6.0
67+
++++++
68+
69+
* Export ``Color`` class.
70+
71+
v0.5.0
72+
++++++
73+
74+
* Export a ``Symbol`` class, to use when you do not want to force
75+
color as with ``UnicodeSequence``
76+
77+
v0.4.0
78+
++++++
79+
80+
* Expose the previously private ``UnicodeSequence`` class.
81+
82+
v0.3.0
83+
++++++
84+
85+
* Add ``info_section``
86+
87+
* Cosmetic changes about prefixes for ``debug``, ``warn`` and ``error``
88+
messages. (See `#6 <https://github.com/TankerHQ/python-cli-ui/pull/6>`_
89+
for the details)
90+
91+
92+
v0.2.0
93+
++++++
94+
95+
* Add ``cli_ui.setup`` to configure things like verbosity and when to
96+
use colored output (#3)
97+
98+
* Add a ``message_recorder`` in ``cli_ui.tests.conf`` that can
99+
be used as a ``pytest`` fixture in other projects.
100+
101+
v0.1.0
102+
+++++++
103+
104+
First public release.

docs/index.rst

Lines changed: 14 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Python CLI UI
22
=============
33

4+
.. toctree::
5+
:hidden:
6+
7+
changelog
8+
9+
410
.. module:: cli_ui
511

612
Tools for nice user interfaces in the terminal.
@@ -272,10 +278,11 @@ Asking for user input
272278

273279
.. autofunction:: ask_choice
274280

281+
275282
::
276283

277284
>>> choices = ["apple", "banana", "orange"]
278-
>>> fruit = cli_ui.ask_choice("Select a fruit", choices)
285+
>>> fruit = cli_ui.ask_choice("Select a fruit", choices=choices)
279286
:: Select a fruit
280287
1 apple
281288
2 banana
@@ -284,6 +291,11 @@ Asking for user input
284291
>>> fruit
285292
'banana'
286293

294+
.. versionchanged:: 0.8
295+
296+
``choices`` is now a named keyword argument
297+
298+
287299
.. autofunction:: ask_yes_no
288300

289301
::
@@ -301,6 +313,7 @@ Asking for user input
301313

302314
>>> fav_food = cli_ui.ask_password("Guilty pleasure?")
303315
:: Guilty pleasure?
316+
****
304317

305318
>>> fav_food
306319
'chocolate'
@@ -364,79 +377,3 @@ Testing with pytest
364377
def test_foo(message_recorder):
365378
foo()
366379
assert message_recorder.find("Fooing")
367-
368-
369-
Changelog
370-
----------
371-
372-
v0.7.4
373-
++++++
374-
375-
* Remove buggy ``entry_points`` from ``setup.py``.
376-
377-
v0.7.3
378-
++++++
379-
380-
* Switch to ``dmenv``. This makes it possible to use ``cli-ui`` with ``colorama >= 4.0``.
381-
382-
v0.7.2
383-
++++++
384-
385-
* Switch to `poetry <https://poetry.eustace.io>`_ .
386-
387-
v0.7.1
388-
++++++
389-
390-
* Fix crash in ``ask_password`` when password was empty.
391-
* Let the ``KeyboardInterrput`` exception propagate back to the caller instead of catching
392-
it ourselves and returning ``None``. Reported by Théo Delrieu.
393-
394-
v0.7.0
395-
++++++
396-
397-
* Add ``ask_password`` and ``read_pasword``. Patch by @drazisil
398-
399-
v0.6.1
400-
++++++
401-
402-
* Fix metadata (owner moved from TankerApp to TankerHQ)
403-
404-
v0.6.0
405-
++++++
406-
407-
* Export ``Color`` class.
408-
409-
v0.5.0
410-
++++++
411-
412-
* Export a ``Symbol`` class, to use when you do not want to force
413-
color as with ``UnicodeSequence``
414-
415-
v0.4.0
416-
++++++
417-
418-
* Expose the previously private ``UnicodeSequence`` class.
419-
420-
v0.3.0
421-
++++++
422-
423-
* Add ``info_section``
424-
425-
* Cosmetic changes about prefixes for ``debug``, ``warn`` and ``error``
426-
messages. (See `#6 <https://github.com/TankerHQ/python-cli-ui/pull/6>`_
427-
for the details)
428-
429-
430-
v0.2.0
431-
++++++
432-
433-
* Add ``cli_ui.setup`` to configure things like verbosity and when to
434-
use colored output (#3)
435-
436-
* Add a ``message_recorder`` in ``cli_ui.tests.conf`` that can
437-
be used as a ``pytest`` fixture in other projects.
438-
439-
v0.1.0
440-
+++++++
441-
442-
First public release.

0 commit comments

Comments
 (0)