Skip to contentSkip to conversation

package/python-portalocker: new package

PATCH New Vincent Cruz 1 participant 1 message Apr 22

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/python-portalocker: new package

Cross-platform file locking library.

https://github.com/wolph/portalocker

---
Tested with Buildroot gitlab CI:
https://gitlab.com/v_cz/buildroot/-/pipelines/2471767381

 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 package/python-portalocker/Config.in          |  6 +++
 .../python-portalocker.hash                   |  5 ++
 .../python-portalocker/python-portalocker.mk  | 15 ++++++
 .../package/sample_python_portalocker.py      | 51 +++++++++++++++++++
 .../tests/package/test_python_portalocker.py  | 24 +++++++++
 7 files changed, 103 insertions(+)
 create mode 100644 package/python-portalocker/Config.in
 create mode 100644 package/python-portalocker/python-portalocker.hash
 create mode 100644 package/python-portalocker/python-portalocker.mk
 create mode 100644 support/testing/tests/package/sample_python_portalocker.py
 create mode 100644 support/testing/tests/package/test_python_portalocker.py
DEVELOPERS +1 -0
index eba91f10a6..2534140617 100644
@@ -3363,6 +3363,7 @@ N:	Victor Huesca <[email protected]>
 F:	support/testing/tests/core/test_root_password.py
 
 N:	Vincent Cruz <[email protected]>
+F:	package/python-portalocker/
 F:	package/python-transitions/
 
 N:	Vincent Jardin <[email protected]>
package/Config.in +1 -0
index d0f148699b..504c84eb43 100644
@@ -1281,6 +1281,7 @@ menu "External python modules"
 	source "package/python-platformdirs/Config.in"
 	source "package/python-pluggy/Config.in"
 	source "package/python-ply/Config.in"
+	source "package/python-portalocker/Config.in"
 	source "package/python-portend/Config.in"
 	source "package/python-posix-ipc/Config.in"
 	source "package/python-priority/Config.in"
package/python-portalocker/Config.in new file +6 -0
new file mode 100644
index 0000000000..6225a659d2
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PYTHON_PORTALOCKER
+	bool "python-portalocker"
+	help
+	  Cross-platform file locking library.
+
+	  https://github.com/wolph/portalocker
package/python-portalocker/python-portalocker.hash new file +5 -0
new file mode 100644
index 0000000000..c6be94b8e3
@@ -0,0 +1,5 @@
+# From https://pypi.org/pypi/portalocker/3.2.0/json
+sha256  1f3002956a54a8c3730586c5c77bf18fae4149e07eaf1c29fc3faf4d5a3f89ac  portalocker-3.2.0.tar.gz
+# Locally computed
+sha256  a50570fa3b3102a42d7babb0569238b0b3c0aedce0063c8e4d65060dfd3f7293  portalocker-3.2.0/LICENSE
+sha256  1a6cc9434cfd4a373630949c8807ab6c30f4783ad2024151eea755f0766ecc03  portalocker-3.2.0/PKG-INFO
package/python-portalocker/python-portalocker.mk new file +15 -0
new file mode 100644
index 0000000000..6e1076334b
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-portalocker
+#
+################################################################################
+
+PYTHON_PORTALOCKER_VERSION = 3.2.0
+PYTHON_PORTALOCKER_SOURCE = portalocker-$(PYTHON_PORTALOCKER_VERSION).tar.gz
+PYTHON_PORTALOCKER_SITE = https://files.pythonhosted.org/packages/source/p/portalocker
+PYTHON_PORTALOCKER_SETUP_TYPE = setuptools
+PYTHON_PORTALOCKER_LICENSE = BSD-3-Clause
+PYTHON_PORTALOCKER_LICENSE_FILES = LICENSE
+PYTHON_PORTALOCKER_DEPENDENCIES = host-python-setuptools-scm
+
+$(eval $(python-package))
support/testing/tests/package/sample_python_portalocker.py new file +51 -0

51 lines not on this page · raw message

support/testing/tests/package/test_python_portalocker.py new file +24 -0
new file mode 100644
index 0000000000..58f27c0f79
@@ -0,0 +1,24 @@
+import os
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPortalocker(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_PORTALOCKER=y
+        """
+    sample_scripts = ["tests/package/sample_python_portalocker.py"]
+
+    def test_run(self):
+        self.login()
+        self.check_sample_scripts_exist()
+
+        cmd = self.interpreter + " " + os.path.basename(self.sample_scripts[0])
+        output, exit_code = self.emulator.run(cmd, timeout=15)
+        self.assertEqual(exit_code, 0)
+        self.assertEqual(output, [
+            'False [Errno 11] Resource temporarily unavailable',
+            'True ok',
+        ])
Signature · 6 lines
2.51.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot