Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies
@ 2022-12-12  9:50 yegorslists--- via buildroot
  2022-12-12  9:50 ` [Buildroot] [PATCH 2/2] support/testing: add test for python-munch yegorslists--- via buildroot
  2022-12-29  9:38 ` [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: yegorslists--- via buildroot @ 2022-12-12  9:50 UTC (permalink / raw)
  To: buildroot; +Cc: Asaf Kahlon

From: Yegor Yefremov <yegorslists@googlemail.com>

munch requires python-setuptools and python-six packages at
runtime.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/python-munch/Config.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/python-munch/Config.in b/package/python-munch/Config.in
index 9db2623674..ceb9fbaf32 100644
--- a/package/python-munch/Config.in
+++ b/package/python-munch/Config.in
@@ -1,5 +1,7 @@
 config BR2_PACKAGE_PYTHON_MUNCH
 	bool "python-munch"
+	select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime
+	select BR2_PACKAGE_PYTHON_SIX # runtime
 	help
 	  Munch is a dictionary that supports attribute-style access,
 	  a la JavaScript.
-- 
2.17.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 2/2] support/testing: add test for python-munch
  2022-12-12  9:50 [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies yegorslists--- via buildroot
@ 2022-12-12  9:50 ` yegorslists--- via buildroot
  2022-12-29  9:38 ` [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: yegorslists--- via buildroot @ 2022-12-12  9:50 UTC (permalink / raw)
  To: buildroot; +Cc: Asaf Kahlon

From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 DEVELOPERS                                    |  2 ++
 .../tests/package/sample_python_munch.py      | 20 +++++++++++++++++++
 .../tests/package/test_python_munch.py        | 12 +++++++++++
 3 files changed, 34 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_munch.py
 create mode 100644 support/testing/tests/package/test_python_munch.py

diff --git a/DEVELOPERS b/DEVELOPERS
index f0dcc42de7..5432b19730 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3121,10 +3121,12 @@ F:	package/x11r7/xapp_xinput-calibrator/
 F:	package/zlog/
 F:	support/testing/tests/package/sample_python_dicttoxml2.py
 F:	support/testing/tests/package/sample_python_dtschema.py
+F:	support/testing/tests/package/sample_python_munch.py
 F:	support/testing/tests/package/test_libftdi1.py
 F:	support/testing/tests/package/test_python_can.py
 F:	support/testing/tests/package/test_python_dicttoxml2.py
 F:	support/testing/tests/package/test_python_dtschema.py
+F:	support/testing/tests/package/test_python_munch.py
 F:	utils/scanpypi
 
 N:	Yunhao Tian <t123yh.xyz@gmail.com>
diff --git a/support/testing/tests/package/sample_python_munch.py b/support/testing/tests/package/sample_python_munch.py
new file mode 100644
index 0000000000..b45bec7b7e
--- /dev/null
+++ b/support/testing/tests/package/sample_python_munch.py
@@ -0,0 +1,20 @@
+from munch import Munch
+
+b = Munch()
+b.hello = 'world'
+assert b.hello == 'world'
+b['hello'] += "!"
+assert b.hello == 'world!'
+b.foo = Munch(lol=True)
+assert b.foo.lol is True
+assert b.foo is b['foo']
+
+assert sorted(b.keys()) == ['foo', 'hello']
+
+b.update({'ponies': 'are pretty!'}, hello=42)
+assert b == Munch({'ponies': 'are pretty!', 'foo': Munch({'lol': True}), 'hello': 42})
+
+assert sorted([(k, b[k]) for k in b]) == [('foo', Munch({'lol': True})), ('hello', 42), ('ponies', 'are pretty!')]
+
+format_munch = Munch(knights='lolcats', ni='can haz')
+assert "The {knights} who say {ni}!".format(**format_munch) == 'The lolcats who say can haz!'
diff --git a/support/testing/tests/package/test_python_munch.py b/support/testing/tests/package/test_python_munch.py
new file mode 100644
index 0000000000..6853bbaac7
--- /dev/null
+++ b/support/testing/tests/package/test_python_munch.py
@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Munch(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_MUNCH=y
+        """
+    sample_scripts = ["tests/package/sample_python_munch.py"]
+    timeout = 40
-- 
2.17.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies
  2022-12-12  9:50 [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies yegorslists--- via buildroot
  2022-12-12  9:50 ` [Buildroot] [PATCH 2/2] support/testing: add test for python-munch yegorslists--- via buildroot
@ 2022-12-29  9:38 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-12-29  9:38 UTC (permalink / raw)
  To: yegorslists--- via buildroot; +Cc: Asaf Kahlon

On Mon, 12 Dec 2022 10:50:49 +0100
yegorslists--- via buildroot <buildroot@buildroot.org> wrote:

> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> munch requires python-setuptools and python-six packages at
> runtime.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  package/python-munch/Config.in | 2 ++
>  1 file changed, 2 insertions(+)

Both applied, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-29  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12  9:50 [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies yegorslists--- via buildroot
2022-12-12  9:50 ` [Buildroot] [PATCH 2/2] support/testing: add test for python-munch yegorslists--- via buildroot
2022-12-29  9:38 ` [Buildroot] [PATCH 1/2] package/python-munch: select missing runtime dependencies Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox