@@ -1151,6 +1151,7 @@ menu "External python modules"
source "package/python-janus/Config.in"
source "package/python-jaraco-classes/Config.in"
source "package/python-jaraco-functools/Config.in"
+ source "package/python-jc/Config.in"
source "package/python-jedi/Config.in"
source "package/python-jeepney/Config.in"
source "package/python-jinja2/Config.in"
new file mode 100644
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_PYTHON_JC
+ bool "python-jc"
+ select BR2_PACKAGE_PYTHON3_PYEXPAT
+ select BR2_PACKAGE_PYTHON_XMLTODICT
+ help
+ Converts the output of popular command-line tools and file-
+ types to JSON.
+
+ Optionally requires python-pygments for syntax highlighting,
+ python-ruamel-yaml for yaml parsing and output.
+
+ https://github.com/kellyjonbrazil/jc
new file mode 100644
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/jc/json
+md5 dffc3f8e92e4c535f5653641abfa5397 jc-1.25.0.tar.gz
+sha256 eba4aaaf5128f18a16121c0bcfc1b794fc80b665ee97f6a25da9c156559da54e jc-1.25.0.tar.gz
+# Locally computed sha256 checksums
+sha256 6493f2db400f4166ca0956cf192a41aa092bd1396ff463e7fdaf51f257c10497 LICENSE.md
new file mode 100644
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-jc
+#
+################################################################################
+
+PYTHON_JC_VERSION = 1.25.0
+PYTHON_JC_SOURCE = jc-$(PYTHON_JC_VERSION).tar.gz
+PYTHON_JC_SITE = https://files.pythonhosted.org/packages/b7/42/be8a1d0410bfddc1a30c06d77d06a1856c49fb18ec5545474a6f17dc3399
+PYTHON_JC_SETUP_TYPE = setuptools
+PYTHON_JC_LICENSE = MIT
+PYTHON_JC_LICENSE_FILES = LICENSE.md
+
+$(eval $(python-package))
new file mode 100644
@@ -0,0 +1,22 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonJc(TestPythonPackageBase):
+ __test__ = True
+ # We deliberately run the test without the optional dependencies,
+ # as this configuration is less tested upstream.
+ config = TestPythonPackageBase.config + \
+ """
+ BR2_PACKAGE_PYTHON3=y
+ BR2_PACKAGE_PYTHON_JC=y
+ """
+ timeout = 60
+
+ def test_run(self):
+ self.login()
+ cmd = "jc -h > /dev/null 2>&1"
+ self.assertRunOk(cmd, timeout=self.timeout)
+ cmd = "jc id | grep -q root"
+ self.assertRunOk(cmd, timeout=self.timeout)
+ cmd = "jc env | grep -q PATH"
+ self.assertRunOk(cmd, self.timeout)
This version still requires xmltodict and pyexpat for the cli tool to work correctly but this should become optional in a future release. [1] The other dependencies are already optional and this only mentioned in the package's help text. [2] [1] https://github.com/kellyjonbrazil/jc/issues/537 [2] https://github.com/kellyjonbrazil/jc/issues/108 Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu> --- package/Config.in | 1 + package/python-jc/Config.in | 12 ++++++++++ package/python-jc/python-jc.hash | 5 +++++ package/python-jc/python-jc.mk | 14 ++++++++++++ .../testing/tests/package/test_python_jc.py | 22 +++++++++++++++++++ 5 files changed, 54 insertions(+) create mode 100644 package/python-jc/Config.in create mode 100644 package/python-jc/python-jc.hash create mode 100644 package/python-jc/python-jc.mk create mode 100644 support/testing/tests/package/test_python_jc.py