Recent commits to derivepassphrase.git (d0a09fd0894b931b21a5908f96729dbe357d9ff5) https://git.schokokeks.org/derivepassphrase.git/tree/d0a09fd0894b931b21a5908f96729dbe357d9ff5 Recent commits feed provided by GitList. Wrap click.testing.CliRunner to directly return a ReadableResult Instead of using `click.testing.CliRunner` directly and transforming the result, wrap the runner in a new class that does the necessary transformations on the result automatically. This indirection of the CLI runner also allows the wrapper to cope with (some) incompatible changes in `click` across versions, or even eventually swap out the underlying implementation completely. As a first incompatibility to bridge, `click` 8.2.0 (currently in beta) merges many bad or incomplete fixes for long-standing issues, but with no regard to backward compatibility. Of particular relevance, `click.testing.CliRunner` no longer accepts the `mix_stderr` argument,[^1] and the meanings of the `output` and the `stdout` attribute of `click.testing.Result` have changed.[^2] These two incompatibilities are handled by the wrapper. [^1]: This breaks practically every call to the runner: `mix_stderr` defaults to `True`, thus the default behavior is to mangle the output streams. Why would you want that, in your testing machinery no less, where automatically mangling or discarding information behind the scenes is detrimental to debugging?! As a consequence, `mix_stderr` *has* to be specified if you want output streams not to be mangled, and if you want them to be mangled, you *should* specify `mix_stderr` explicitly. So basically, you always specify `mix_stderr`. And thus removing the (definition of the) `mix_stderr` argument breaks practically every call to the runner. [^2]: This is complementary to the removal of the `mix_stderr` argument: the mixed output is now always stored in the `output` attribute, and the `stdout` is the true standard output. Of course, this contradicts the previous use of `output` and `stdout`, where `output` was the true standard output, and `stdout` was a convenience alias via an extra layer of redirection. https://git.schokokeks.org/derivepassphrase.git/commit/d0a09fd0894b931b21a5908f96729dbe357d9ff5 software@the13thletter.info (Marco Ricci) Wed, 09 Apr 2025 19:16:36 +0200 d0a09fd0894b931b21a5908f96729dbe357d9ff5 Merge topic branch 'translation-de' into master * translation-de: Purge hatch-gettext build plugin, and manually compile translations Add a German translation Fix indentation handling in the translation template Fix miscellaneous issues with the CLI messages Update translations template https://git.schokokeks.org/derivepassphrase.git/commit/0d9a16bf731f7b6d0c52e488d0da32bef4910939 software@the13thletter.info (Marco Ricci) Mon, 17 Mar 2025 07:39:12 +0100 0d9a16bf731f7b6d0c52e488d0da32bef4910939 Purge hatch-gettext build plugin, and manually compile translations The hatch-gettext plugin requires Python 3.10 or higher, and consequently hinders non-wheel installation of derivepassphrase on Python 3.9 or PyPy 3.9. The project also is, upon closer inspection, alpha or beta quality: there are no tests, there appear to be no active users (no issues or non-author pull requests filed), and the code contains some dubious constructs (such as assembling all calls to external programs as command-line strings, then naively splitting them on whitespace). I do not want to commit to using this build plugin in any non-prototype setting. So remove these settings from the build system, build the translation message catalogs ourselves, and unignore the respective paths. https://git.schokokeks.org/derivepassphrase.git/commit/67c0e85e3683710ece9674a480412ba8196e1cc0 software@the13thletter.info (Marco Ricci) Sun, 16 Mar 2025 23:59:30 +0100 67c0e85e3683710ece9674a480412ba8196e1cc0 Add a German translation Co-authored-by: Isabell Hoffstadt https://git.schokokeks.org/derivepassphrase.git/commit/abe57a7e94e54d5c8139e9661b9222000b24b99e software@the13thletter.info (Marco Ricci) Sun, 16 Mar 2025 23:53:16 +0100 abe57a7e94e54d5c8139e9661b9222000b24b99e Fix indentation handling in the translation template https://git.schokokeks.org/derivepassphrase.git/commit/febfd09916cde8d5e47a26a3cad8a11176d758db software@the13thletter.info (Marco Ricci) Sun, 16 Mar 2025 23:50:53 +0100 febfd09916cde8d5e47a26a3cad8a11176d758db Fix miscellaneous issues with the CLI messages * The "interactive input" replacement value for the `WarnMsgTemplate.PASSPHRASE_NOT_NORMALIZED` message is now translatable. The previous form was quirky and too clever, and probably only worked in languages with similar grammar and sentence structure. * The `Label.DERIVEPASSPHRASE_VAULT_REPEAT_HELP_TEXT` message was wrong due to an off-by-one error. * The `Label.DERIVEPASSPHRASE_VAULT_PRINT_NOTES_BEFORE_HELP_TEXT` message should reference the service metavar, not the term "service" itself. * The default notes placeholder text when using the vault legacy editor interface is very wordy, and incited at least one test user to delete it character by character before entering the new notes. A shorter placeholder text will hopefully achieve the same effect in less keystrokes. * Several verb tense and punctuation mistakes were corrected. https://git.schokokeks.org/derivepassphrase.git/commit/b127dd363ce8ad0ad26e88c31200dc5c3736f8b4 software@the13thletter.info (Marco Ricci) Sun, 16 Mar 2025 23:13:47 +0100 b127dd363ce8ad0ad26e88c31200dc5c3736f8b4 Update translations template https://git.schokokeks.org/derivepassphrase.git/commit/6372560fd2c27a91c55769659a1748a0cc3ca5d1 software@the13thletter.info (Marco Ricci) Sun, 16 Mar 2025 13:33:37 +0100 6372560fd2c27a91c55769659a1748a0cc3ca5d1 Merge topic branch 'vault-cli-objectification' into master * vault-cli-objectification: Reimplement the `vault` CLI as methods of a context object https://git.schokokeks.org/derivepassphrase.git/commit/cd3c72db9b6457dc6757effa209693ce10dd4dbd software@the13thletter.info (Marco Ricci) Sun, 16 Mar 2025 13:23:38 +0100 cd3c72db9b6457dc6757effa209693ce10dd4dbd Reimplement the `vault` CLI as methods of a context object Introduce a "vault context" object holding the associated data for the call to the `derivepassphrase vault` CLI, and implement the actual CLI as a collection of methods on this object. The "vault context" object mostly just wraps the click context object and encodes the dispatch table for the CLI operations. The main advantage of this modelling is the much smaller size per, and lower cyclomatic complexity of, each CLI operation. As an implementation detail, the old implementation of the `get_user_config` inner function's error handling branch for `OSError` had coverage testing purely by accident, because `get_user_config` was being called unconditionally, very early in the CLI control flow. The refactored CLI however reads the user configuration only as needed for the specific operation. So this error handling branch needs a new, separate test. As a further implementation detail, the `is_param_set` inner function no longer caches its result, because it is now an object method: `functools.cache` explicitly documents that adding a cache to object methods causes a circular reference between the cache and the object via the `self` parameter. Given the actual contents of this function, there appears to be little point in working around this memory issue just to outfit an already cheap operation (a single `Mapping.get` call) with a cache. As yet another further implementation detail, checking for misleading passphrases should work even if the passed configuration snippet is not technically a `dict`, but rather a `Mapping`. Finally, due to the vault context object now wrapping the click context, it is possible (and sensible) to wrap the logging calls into methods of the vault context object so that less out-of-bounds information needs to be passed to the logger explicitly at the call site. https://git.schokokeks.org/derivepassphrase.git/commit/7261f505d57249ef54b8c66a30efb57890ba70a7 software@the13thletter.info (Marco Ricci) Sun, 16 Mar 2025 13:23:05 +0100 7261f505d57249ef54b8c66a30efb57890ba70a7 Merge topic branch 'hatch-test-matrix' into master * hatch-test-matrix: Add PyPy 3.11 to the test matrix https://git.schokokeks.org/derivepassphrase.git/commit/47e3b46d01ffffe4a24ec7e73f4c0833fa0e4ca0 software@the13thletter.info (Marco Ricci) Thu, 13 Mar 2025 13:32:54 +0100 47e3b46d01ffffe4a24ec7e73f4c0833fa0e4ca0