Recent commits to derivepassphrase.git (1112627d6dd1f23dc066c1a723f5bfad01b31dab) https://git.schokokeks.org/derivepassphrase.git/tree/1112627d6dd1f23dc066c1a723f5bfad01b31dab Recent commits feed provided by GitList. Fix bad docstring reference to Python standard library https://git.schokokeks.org/derivepassphrase.git/commit/1112627d6dd1f23dc066c1a723f5bfad01b31dab software@the13thletter.info (Marco Ricci) Sat, 28 Sep 2024 09:10:01 +0200 1112627d6dd1f23dc066c1a723f5bfad01b31dab Reintegrate branch 'master' into documentation-fixes * master: Fix outstanding formatting and linting issues Switch from towncrier to scriv for changelog management Add changelog entry for hypothesis use Add hypothesis-based tests (and bugfix) for the vault derivation scheme Set up the "hypothesis" testing library https://git.schokokeks.org/derivepassphrase.git/commit/26249bcee644fc26eae214f29539cb539f32b879 software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 22:33:03 +0200 26249bcee644fc26eae214f29539cb539f32b879 Fix outstanding formatting and linting issues https://git.schokokeks.org/derivepassphrase.git/commit/e191a498aad1688bb448bc56dfbfcc0263ea9c67 software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 22:18:46 +0200 e191a498aad1688bb448bc56dfbfcc0263ea9c67 Merge topic branch 'remove-towncrier' into master * t/remove-towncrier: Switch from towncrier to scriv for changelog management https://git.schokokeks.org/derivepassphrase.git/commit/2f7af29d2ffc775bbfeab54e0d197d972a5ebe1d software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 22:15:41 +0200 2f7af29d2ffc775bbfeab54e0d197d972a5ebe1d Switch from towncrier to scriv for changelog management I have found towncrier to be rather painful when used together with Markdown entries: it feels very much like a reStructuredText-only tool retrofitted with patchy Markdown support. In particular, towncrier blindly concatenates all entries (assumed to be list items) into the output (and adds the implied issue links afterwards), manually adjusted for nicer indentation in an ad-hoc fashion. This fails horribly if the changelog entry is anything except a single, paragraph-free list item; it fails in particular for reference-style links and for multi-paragraph entries. So switch to scriv, by Ned Batchelder, which is a similar style to towncrier. That too has its issues, such as the automatically generated, non-configurable HTML4-style heading anchor, but it's somewhat more tolerant/encouraging of manual editing of the changelog entries and the changelog master file. Since we're cleaning up the changelog, use this opportunity to fix the formatting of the existing entries. https://git.schokokeks.org/derivepassphrase.git/commit/a318351b05d94fa569bbaefcc793efa17832769c software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 21:35:32 +0200 a318351b05d94fa569bbaefcc793efa17832769c Merge topic branch 'hypothesis' into master * t/hypothesis: Add changelog entry for hypothesis use Add hypothesis-based tests (and bugfix) for the vault derivation scheme Set up the "hypothesis" testing library https://git.schokokeks.org/derivepassphrase.git/commit/586ce4b282ed1878a05db14efa99bc3d65fa7c34 software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 19:13:27 +0200 586ce4b282ed1878a05db14efa99bc3d65fa7c34 Add changelog entry for hypothesis use https://git.schokokeks.org/derivepassphrase.git/commit/41424afd95e2324439828869194ce25dcd335c5a software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 19:13:10 +0200 41424afd95e2324439828869194ce25dcd335c5a Add hypothesis-based tests (and bugfix) for the vault derivation scheme There are currently three such property-based tests: a test for general adherence to constraints (with small numbers), and two tests specifically for length and repeat constraints (with larger numbers). Combining these into a single test caused the test runs to vary wildly in execution time, which is undesirable from a configuration point of view (and also causes hypothesis to complain). The hypothesis tests actually uncovered a bug in the API specification of the vault derivation scheme: during generation, we may run out of possible characters for the next letter due to repeat constraints, but only realize this now. This already generated a `ValueError`, but with a confusing error message, and the documentation seemed to suggest that all unsatisfiable constraints are already detected at construction time. So now explicitly mention that constraint unsatisfiability may be detected both in the `Vault` constructor and in `Vault.generate`, and handle lower-lever `ValueError`s in `Vault.generate` explicitly too. https://git.schokokeks.org/derivepassphrase.git/commit/b685fdd3a683a781d48c35832818f9c4e0f6790a software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 19:05:16 +0200 b685fdd3a683a781d48c35832818f9c4e0f6790a Set up the "hypothesis" testing library "hypothesis" is a Python library for property-based testing, i.e. for asserting that the output of the tested code satisfies some property by generating valid test inputs and testing these. For `derivepassphrase` in particular, this means generating different passphrase constraint settings and testing that the generated passphrases match these constraints, no matter what constraints exactly are chosen (within reason). The hypothesis library provides methods to generate test input (test function parameter values, or custom walks for state machine-like systems) and, for failing examples, shrink those to shorter/simpler ones exhibiting the same error. By its nature, hypothesis runs unit test functions multiple times with different inputs, and so takes much longer than normal unit tests. (In the default configuration, 200 examples per test are run.) It is therefore sensible to set up alternate testing profiles with more or less examples per test, and to include a mechanism in the test runner to switch to these profiles. The hypothesis documentation provides an explicit example for profile setup for pytest use, plus three sensible configurations "ci", "dev" and "debug", which I copied. The pytest command-line as called by `hatch test` is also straightforward to adapt: add `--hypothesis-profile=...` to all pytest invocations. However, the shape of the `hatch test` environment matrix no longer matches the reality of scenarios we'd like to test (because we added a new dimension: slow, thorough testing, or fast testing). So use this opportunity to also clean up the matrix. https://git.schokokeks.org/derivepassphrase.git/commit/bf906f3d8786229aba3513eef084814cd5b85b07 software@the13thletter.info (Marco Ricci) Fri, 27 Sep 2024 17:32:46 +0200 bf906f3d8786229aba3513eef084814cd5b85b07 Rename reference documentation pages as per the Python standard library convention A module `spam.ham.eggs` shall be documented in a file `spam.ham.eggs.html`, or otherwise in `spam.ham.html` or `spam.html` if its documentation is to be grouped with other sibling modules. In particular, documentation is not nested into subdirectories, and the documentation filename is guessable based on the full module path. This entails consolidating the `derivepassphrase.exporter` module and its submodules into the same documentation page. https://git.schokokeks.org/derivepassphrase.git/commit/67bc70a2ea9bbf20c5e36f3e64ecfe9bdca3bb01 software@the13thletter.info (Marco Ricci) Sun, 22 Sep 2024 19:34:40 +0200 67bc70a2ea9bbf20c5e36f3e64ecfe9bdca3bb01