komandaro 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. komandaro-0.2.1/.gitignore +16 -0
  2. komandaro-0.2.1/CHANGELOG.md +99 -0
  3. komandaro-0.2.1/LICENSE +661 -0
  4. komandaro-0.2.1/PKG-INFO +308 -0
  5. komandaro-0.2.1/README.md +276 -0
  6. komandaro-0.2.1/babel.cfg +3 -0
  7. komandaro-0.2.1/docs/README.md +17 -0
  8. komandaro-0.2.1/docs/en/api.md +155 -0
  9. komandaro-0.2.1/docs/en/architecture.md +478 -0
  10. komandaro-0.2.1/docs/en/examples.md +288 -0
  11. komandaro-0.2.1/docs/en/how-it-works.md +224 -0
  12. komandaro-0.2.1/docs/en/releasing.md +102 -0
  13. komandaro-0.2.1/docs/en/tutorial.md +442 -0
  14. komandaro-0.2.1/docs/fr/api.md +160 -0
  15. komandaro-0.2.1/docs/fr/architecture.md +499 -0
  16. komandaro-0.2.1/docs/fr/examples.md +289 -0
  17. komandaro-0.2.1/docs/fr/how-it-works.md +246 -0
  18. komandaro-0.2.1/docs/fr/releasing.md +106 -0
  19. komandaro-0.2.1/docs/fr/tutorial.md +455 -0
  20. komandaro-0.2.1/examples/__init__.py +0 -0
  21. komandaro-0.2.1/examples/notebook/__init__.py +0 -0
  22. komandaro-0.2.1/examples/notebook/cli.py +171 -0
  23. komandaro-0.2.1/examples/notebook/locale/fr/LC_MESSAGES/notebook.po +72 -0
  24. komandaro-0.2.1/examples/notebook/locale/notebook.pot +71 -0
  25. komandaro-0.2.1/examples/notebook/notebook.py +162 -0
  26. komandaro-0.2.1/pyproject.toml +89 -0
  27. komandaro-0.2.1/src/komandaro/__init__.py +59 -0
  28. komandaro-0.2.1/src/komandaro/command.py +291 -0
  29. komandaro-0.2.1/src/komandaro/i18n.py +123 -0
  30. komandaro-0.2.1/src/komandaro/interfaces.py +117 -0
  31. komandaro-0.2.1/src/komandaro/invoker.py +183 -0
  32. komandaro-0.2.1/src/komandaro/locale/en/LC_MESSAGES/komandaro.mo +0 -0
  33. komandaro-0.2.1/src/komandaro/locale/en/LC_MESSAGES/komandaro.po +89 -0
  34. komandaro-0.2.1/src/komandaro/locale/eo/LC_MESSAGES/komandaro.mo +0 -0
  35. komandaro-0.2.1/src/komandaro/locale/eo/LC_MESSAGES/komandaro.po +89 -0
  36. komandaro-0.2.1/src/komandaro/locale/fr/LC_MESSAGES/komandaro.mo +0 -0
  37. komandaro-0.2.1/src/komandaro/locale/fr/LC_MESSAGES/komandaro.po +89 -0
  38. komandaro-0.2.1/src/komandaro/locale/komandaro.pot +88 -0
  39. komandaro-0.2.1/src/komandaro/py.typed +0 -0
  40. komandaro-0.2.1/src/komandaro/registry.py +172 -0
  41. komandaro-0.2.1/src/komandaro/schema.py +187 -0
  42. komandaro-0.2.1/tests/__init__.py +0 -0
  43. komandaro-0.2.1/tests/conftest.py +72 -0
  44. komandaro-0.2.1/tests/test_examples.py +100 -0
  45. komandaro-0.2.1/tests/test_i18n.py +74 -0
  46. komandaro-0.2.1/tests/test_invoker.py +143 -0
  47. komandaro-0.2.1/tests/test_macro.py +87 -0
  48. komandaro-0.2.1/tests/test_registry.py +108 -0
  49. komandaro-0.2.1/tests/test_schema.py +115 -0
  50. komandaro-0.2.1/tests/test_simple_command.py +140 -0
  51. komandaro-0.2.1/tests/test_version.py +15 -0
@@ -0,0 +1,16 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .coverage
11
+ coverage.xml
12
+ htmlcov/
13
+ # compiled catalogues are built, not versioned
14
+ *.mo
15
+ *.patch
16
+ *.mbox
@@ -0,0 +1,99 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [SemVer](https://semver.org).
5
+
6
+ ## [0.2.1] — 2026-09-16
7
+
8
+ Documentation release; first version published on PyPI.
9
+
10
+ ### Added
11
+ - `Release` workflow: on a `v*` tag (or manually, with a TestPyPI dry run),
12
+ checks the tag against the version, runs the tests, builds, verifies the
13
+ distributions and publishes through PyPI trusted publishing.
14
+ `docs/*/releasing.md` describe the one-time setup; `tests/test_version.py`
15
+ keeps `__version__` and `pyproject.toml` in step.
16
+ - Documentation set in English and French under `docs/`: *How it works*
17
+ (the ideas in plain words), *Tutorial* (step by step, every block
18
+ executed by the test suite), *Examples* (patterns: counter, text buffer,
19
+ memento, atomic bank transfer, audit log, custom redo, entry points),
20
+ *API reference*, plus the refreshed *Architecture*; `docs/README.md`
21
+ index and a Documentation section in the README.
22
+ - `examples/notebook/`: the tutorial application — its logic as commands
23
+ (`notebook.py`), a command line generated from the registry (`cli.py`,
24
+ interactive or one-shot, `--lang`), and a French catalogue in its own
25
+ gettext domain. Covered by `tests/test_examples.py`.
26
+ - pytest now runs every ```pycon block under `docs/` (`--doctest-glob=*.md`);
27
+ a session fixture compiles the `.po` catalogues so tests and doctests
28
+ translate without a prior `pybabel compile`.
29
+
30
+ ### Changed
31
+ - Tests are run as `python -m pytest` (documented everywhere): a bare
32
+ `pytest` may resolve to a system-wide install outside the virtual
33
+ environment. The test session pins `LANGUAGE=en` so that untranslated
34
+ expectations hold on machines with another locale; the tutorial's CLI
35
+ session passes `lang="en"` explicitly and explains why.
36
+ - `Macro.__init__` accepts `**params` validated against the subclass
37
+ `schema` (the keyword names `commands`, `name`, `description` stay
38
+ reserved), so macros can build their children from parameters.
39
+
40
+ ## [0.2.0] — 2026-09-16
41
+
42
+ Phase 2: commands describe themselves; an invoker runs them.
43
+
44
+ ### Added
45
+ - `komandaro.schema`: parameter schemas as `zope.interface` interfaces of
46
+ `zope.schema` fields; `validate()` (all issues reported at once, defaults
47
+ applied, translatable `ParameterError`/`ParameterIssue`) and `describe()`
48
+ (`ParameterInfo` records for front ends).
49
+ - Commands take keyword parameters: `Cmd(context, **params)`, validated
50
+ against `Cmd.schema` and exposed as `cmd.params`; `do_it(context, **params)`,
51
+ `undo_it(context, state, **params)`.
52
+ - Memento hook: `BaseCommand._snapshot()` / `SimpleCommandFactory(...,
53
+ snapshot=fn)`; the value is kept in `cmd.memento` and handed to `undo`.
54
+ - Stable command ids (`BaseCommand.id`, derived from the class name or set
55
+ explicitly).
56
+ - `komandaro.registry`: `Registry` (ids, groups, tags, decorator,
57
+ entry-point loading, `create()`), `Entry`, `RegistryError`.
58
+ - `komandaro.invoker`: `Invoker` (run by id or instance, undo/redo stacks,
59
+ optional history limit, `Event`/`EventKind` observers, `clear()`),
60
+ `HistoryError`.
61
+ - 8 new translatable messages, catalogues `en`/`fr`/`eo` complete.
62
+ - 27 new tests; architecture docs (EN/FR) gain sections on schemas,
63
+ registry and invoker with two new Mermaid diagrams each.
64
+
65
+ ### Changed
66
+ - New dependency: `zope.schema`.
67
+ - `Invoker`, `Registry`, `describe`, `validate` and the error classes are
68
+ exported from the package root.
69
+
70
+ ### Compatibility
71
+ - Phase-1 code keeps working: commands without a schema accept any
72
+ parameters, and `do(context)` / `undo(context, result)` functions are
73
+ called unchanged when no parameters are given.
74
+
75
+ ## [0.1.0] — 2026-09-16
76
+
77
+ Phase 1: rebirth of the 2014 `ecreall.command` prototype as **Komandaro**.
78
+
79
+ ### Added
80
+ - `SimpleCommandFactory`, `SimpleCommand`, `Macro` with an explicit
81
+ ready → executed → undone state machine on marker interfaces.
82
+ - Atomic macros: a failing sub-command triggers the undo of the ones
83
+ already executed.
84
+ - gettext internationalisation (`komandaro.i18n`): lazy `Message`, per-call
85
+ `translate()`, catalogues `en`, `fr`, `eo`.
86
+ - Test suite (pytest, doctests of the README), GitHub Actions CI on
87
+ Python 3.12 and 3.13 (ruff, mypy, pytest with coverage).
88
+ - Architecture documentation in English and French with Mermaid diagrams.
89
+ - AGPL-3.0-or-later licence.
90
+
91
+ ### Fixed (compared with `ecreall.command` 0.1dev)
92
+ - `NameError` on `name = name` in the factory's class body.
93
+ - `TypeError`: do/undo functions were bound as methods; now static methods.
94
+ - `return result` instead of `self.result` in `execute()`.
95
+ - `noLongerProvides` on a class-level interface (`ValueError`); state markers
96
+ are now set with `directlyProvides`, kinds stay on the class.
97
+ - `IUndoneCommand` did not extend `IBaseCommand`.
98
+ - Python 3 support (`@implementer` instead of `implements`).
99
+ - Doctest syntax (`...` continuation lines) and completed example.