From 04c27e95761e6c22941a5574be0ec59a59641539 Mon Sep 17 00:00:00 2001 From: Alex Waite Date: Wed, 2 Nov 2022 13:31:55 +0100 Subject: [PATCH 1/2] DOC: remove copy-paste oops --- onyo/lib/onyo.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/onyo/lib/onyo.py b/onyo/lib/onyo.py index 78e5a523..d138c314 100644 --- a/onyo/lib/onyo.py +++ b/onyo/lib/onyo.py @@ -820,8 +820,6 @@ def generate_faux_serials(self, length: int = 6, num: int = 1) -> set[str]: raise ValueError('The length of faux serial numbers must be >= 4.') if num < 1: - # 62^4 is ~14.7 million combinations. Which is the lowest acceptable - # risk of collisions between independent checkouts of a repo. raise ValueError('The length of faux serial numbers must be >= 1.') alphanum = string.ascii_letters + string.digits From e64f3627abf0bda080d9aeff23261903c396c4f6 Mon Sep 17 00:00:00 2001 From: Alex Waite Date: Wed, 2 Nov 2022 13:32:16 +0100 Subject: [PATCH 2/2] DOC: prepare changelog for next release --- docs/source/changelog.rst | 110 +++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 18612ca7..60399428 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -4,7 +4,115 @@ Changelog Next **** -Changes listed have been merged into Onyo and will be part of the next release. +Changes listed here have been merged into Onyo and will be part of the next release. + +The highlights are: + +Command Changes +--------------- +- ``onyo mv --rename`` is retired. ``onyo set`` is the only command that can + change keys/pseudo-keys. +- add ``onyo mv --quiet`` +- rename ``onyo mv --force`` to ``onyo mv --yes`` to match other commands +- ``onyo new`` faux serials default length is decreased from 8 to 6 +- asset read/write always preserves key order and comments (aka: roundtrip mode) + +API +--- +- a new ``Repo`` class to represent a repository as an object +- ``Repo(init=True)`` initializes a new repository +- the following properties are added to ``Repo``: + + - ``assets``: assets in the repo + - ``dirs``: directories in the repo + - ``files``: files in the repo + - ``files_changes``: files in the "changed" state in git + - ``files_staged``: files in the "staged" state in git + - ``files_untracked``: files "untracked" by git + - ``root``: repository root + - ``opdir``: operating directory + +- the following public methods are added to ``Repo``: + + - ``Repo.add()``: stage a file's changed contents + - ``Repo.commit()``: commit all staged changes + - ``Repo.generate_faux_serials()``: generate unique, fake serials + - ``Repo.get_config()``: get a config value + - ``Repo.set_config()``: set a config name and value, in either ``.onyo/config`` + or any other valid git-config location + - ``Repo.fsck()``: fsck the repository, individual tests can be selected + - ``Repo.mkdir()``: create a directory (and any parents), add ``.anchor`` files, + and stage them + - ``Repo.mv()``: move/rename a directory/file and stage it + - ``Repo.rm()``: delete a directory/file and stage it + +- remove ``onyo/utils.py`` +- most tests are rewritten/updated to be self-contained + +Bugs +---- +- ``onyo history`` honors ``onyo -C`` +- ``onyo history`` errors bubble up the correct exit code +- "protected paths" (such as ``.anchor``, ``.git``, ``.onyo``) are checked + for anywhere in the path name. +- calling ``onyo`` with an insufficient number of arguments no longer exits 0 +- arguments named 'config' no longer result in ignoring subsequent arguments +- simultaneous use of ``onyo -C`` and ``onyo --debug`` no longer crashes Onyo +- faux serials are generated in a more random way +- ``onyo mkdir`` no longer errors with overlapping target directories +- ``onyo mv file-1 subdir/file-1`` (aka: explicit move) no longer errors + +Validation +---------- +Validation is entirely removed. It will be reintroduced, in an improved form, in +a later release. + +Docs +---- +Linting is documented. + +Tests +----- +- add tests for the ``onyo edit`` command +- add tests for the ``onyo history`` command +- add tests for the ``onyo mv`` command +- add tests for the ``onyo new`` command +- add tests for the ``onyo`` command +- add tests for the ``Repo`` class: + + - initialization + - instantiation + - ``assets`` + - ``dirs`` + - ``files`` + - ``files_changes`` + - ``files_staged`` + - ``files_untracked`` + - ``root`` + - ``opdir`` + - ``add()`` + - ``commit()`` + - ``generate_faux_serials()`` + - ``get_config()`` + - ``set_config()`` + - ``fsck()`` + - ``mkdir()`` + - ``mv()`` + - ``rm()`` + +- `Pyre `_ is used for type checking +- ``repo`` fixture to assist with test setup and isolation + +Installation +------------ +The Python version required by Onyo is bumped from 3.7 to 3.9. + +Both GitPython and PyYAML are dropped as dependencies. + +Authors +------- +- Tobias Kadelka (`@TobiasKadelka `__) +- Alex Waite (`@aqw `__) --------------------------------------------------------------------------------