From 9c7ad15ec547a34222151026acc0df2989f702a5 Mon Sep 17 00:00:00 2001 From: rtibblesbot Date: Mon, 13 Apr 2026 12:39:07 -0700 Subject: [PATCH 1/2] feat: add library enum constants for Kolibri and Community libraries Adds spec/constants-library.json with KOLIBRI and COMMUNITY enum values. Generated le_utils/constants/library.py and js/Library.js via generate_from_specs.py. test: simplify LIBRARYLIST test assertion Co-Authored-By: Claude Sonnet 4.6 --- js/Library.js | 8 ++++++++ le_utils/constants/library.py | 18 ++++++++++++++++++ spec/constants-library.json | 4 ++++ tests/test_library.py | 21 +++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 js/Library.js create mode 100644 le_utils/constants/library.py create mode 100644 spec/constants-library.json create mode 100644 tests/test_library.py diff --git a/js/Library.js b/js/Library.js new file mode 100644 index 0000000..f27eefc --- /dev/null +++ b/js/Library.js @@ -0,0 +1,8 @@ +// -*- coding: utf-8 -*- +// Generated by scripts/generate_from_specs.py +// Library + +export default { + COMMUNITY: "COMMUNITY", + KOLIBRI: "KOLIBRI", +}; diff --git a/le_utils/constants/library.py b/le_utils/constants/library.py new file mode 100644 index 0000000..f584113 --- /dev/null +++ b/le_utils/constants/library.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Generated by scripts/generate_from_specs.py +from __future__ import unicode_literals + +# Library + +COMMUNITY = "COMMUNITY" +KOLIBRI = "KOLIBRI" + +choices = ( + (COMMUNITY, "Community"), + (KOLIBRI, "Kolibri"), +) + +LIBRARYLIST = [ + COMMUNITY, + KOLIBRI, +] diff --git a/spec/constants-library.json b/spec/constants-library.json new file mode 100644 index 0000000..a407225 --- /dev/null +++ b/spec/constants-library.json @@ -0,0 +1,4 @@ +[ + "COMMUNITY", + "KOLIBRI" +] diff --git a/tests/test_library.py b/tests/test_library.py new file mode 100644 index 0000000..e773021 --- /dev/null +++ b/tests/test_library.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from le_utils.constants import library + + +def test_library_constants_exist(): + assert library.KOLIBRI == "KOLIBRI" + assert library.COMMUNITY == "COMMUNITY" + + +def test_library_choices(): + choices_dict = dict(library.choices) + assert library.KOLIBRI in choices_dict + assert library.COMMUNITY in choices_dict + assert choices_dict[library.KOLIBRI] == "Kolibri" + assert choices_dict[library.COMMUNITY] == "Community" + + +def test_LIBRARYLIST_exists(): + assert library.LIBRARYLIST, "LIBRARYLIST did not generate properly" From 0c3197a40a06b2fc429f93a0638adacc9677d7ca Mon Sep 17 00:00:00 2001 From: rtibblesbot Date: Mon, 13 Apr 2026 12:55:37 -0700 Subject: [PATCH 2/2] chore: add CHANGELOG entry for v0.2.17 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b881aa5..8010a1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Release History =============== +0.2.17 Apr 13, 2026 +------------------- + - Added library enum constants (KOLIBRI, COMMUNITY) for identifying channel library membership + + 0.1.33 Oct 5, 2021 ------------------- - Added new labelslookup.json constants