[PATCH 2/3] bindings: python: tests: rename procname to system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

We'll be extending the functionality of that C extension with other
OS-level helpers so change its name to 'system'.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
---
 bindings/python/MANIFEST.in                            |  2 +-
 bindings/python/build_tests.py                         | 10 +++++-----
 bindings/python/tests/Makefile.am                      |  2 +-
 bindings/python/tests/__main__.py                      |  4 ++--
 bindings/python/tests/{procname => system}/Makefile.am |  0
 bindings/python/tests/{procname => system}/__init__.py |  0
 bindings/python/tests/{procname => system}/_ext.pyi    |  0
 bindings/python/tests/{procname => system}/ext.c       |  2 +-
 configure.ac                                           |  2 +-
 9 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/bindings/python/MANIFEST.in b/bindings/python/MANIFEST.in
index f3a1ee8..dc7daee 100644
--- a/bindings/python/MANIFEST.in
+++ b/bindings/python/MANIFEST.in
@@ -13,7 +13,7 @@ recursive-include gpiod/ext *.c
 recursive-include gpiod/ext *.h
 
 recursive-include tests/gpiosim *.c
-recursive-include tests/procname *.c
+recursive-include tests/system *.c
 
 recursive-include lib *.c
 recursive-include lib *.h
diff --git a/bindings/python/build_tests.py b/bindings/python/build_tests.py
index 1760257..84cedfc 100644
--- a/bindings/python/build_tests.py
+++ b/bindings/python/build_tests.py
@@ -11,7 +11,7 @@ polluted with artefacts in build/
 Builds:
 
     tests/gpiosim/_ext.<target>.so
-    tests/procname/_ext.<target>.so
+    tests/system/_ext.<target>.so
 
 """
 
@@ -61,9 +61,9 @@ gpiosim_ext = Extension(
     ],
 )
 
-procname_ext = Extension(
-    "tests.procname._ext",
-    sources=["tests/procname/ext.c"],
+system_ext = Extension(
+    "tests.system._ext",
+    sources=["tests/system/ext.c"],
     define_macros=[("_GNU_SOURCE", "1")],
     extra_compile_args=["-Wall", "-Wextra"],
 )
@@ -71,7 +71,7 @@ procname_ext = Extension(
 dist = Distribution(
     {
         "name": "gpiod",
-        "ext_modules": [gpiosim_ext, procname_ext, gpiod_ext],
+        "ext_modules": [gpiosim_ext, system_ext, gpiod_ext],
         "version": __version__,
         "platforms": ["linux"],
     }
diff --git a/bindings/python/tests/Makefile.am b/bindings/python/tests/Makefile.am
index 3118d5f..d6e3ea3 100644
--- a/bindings/python/tests/Makefile.am
+++ b/bindings/python/tests/Makefile.am
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 # SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@xxxxxxxx>
 
-SUBDIRS = gpiosim procname
+SUBDIRS = gpiosim system
 
 EXTRA_DIST = \
 	helpers.py \
diff --git a/bindings/python/tests/__main__.py b/bindings/python/tests/__main__.py
index 8b4260d..318e0df 100644
--- a/bindings/python/tests/__main__.py
+++ b/bindings/python/tests/__main__.py
@@ -4,7 +4,7 @@
 
 import unittest
 
-from . import procname
+from .system import set_process_name
 from .tests_chip import *
 from .tests_chip_info import *
 from .tests_edge_event import *
@@ -15,6 +15,6 @@ from .tests_line_request import *
 from .tests_line_settings import *
 from .tests_module import *
 
-procname.set_process_name("python-gpiod")
+set_process_name("python-gpiod")
 
 unittest.main()
diff --git a/bindings/python/tests/procname/Makefile.am b/bindings/python/tests/system/Makefile.am
similarity index 100%
rename from bindings/python/tests/procname/Makefile.am
rename to bindings/python/tests/system/Makefile.am
diff --git a/bindings/python/tests/procname/__init__.py b/bindings/python/tests/system/__init__.py
similarity index 100%
rename from bindings/python/tests/procname/__init__.py
rename to bindings/python/tests/system/__init__.py
diff --git a/bindings/python/tests/procname/_ext.pyi b/bindings/python/tests/system/_ext.pyi
similarity index 100%
rename from bindings/python/tests/procname/_ext.pyi
rename to bindings/python/tests/system/_ext.pyi
diff --git a/bindings/python/tests/procname/ext.c b/bindings/python/tests/system/ext.c
similarity index 96%
rename from bindings/python/tests/procname/ext.c
rename to bindings/python/tests/system/ext.c
index bf7d2fe..e7c1cc4 100644
--- a/bindings/python/tests/procname/ext.c
+++ b/bindings/python/tests/system/ext.c
@@ -32,7 +32,7 @@ static PyMethodDef module_methods[] = {
 
 static PyModuleDef module_def = {
 	PyModuleDef_HEAD_INIT,
-	.m_name = "procname._ext",
+	.m_name = "system._ext",
 	.m_methods = module_methods,
 };
 
diff --git a/configure.ac b/configure.ac
index 97fc83f..78a6670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -371,7 +371,7 @@ AC_CONFIG_FILES([Makefile
 		 bindings/python/examples/Makefile
 		 bindings/python/tests/Makefile
 		 bindings/python/tests/gpiosim/Makefile
-		 bindings/python/tests/procname/Makefile
+		 bindings/python/tests/system/Makefile
 		 bindings/rust/libgpiod-sys/src/Makefile
 		 bindings/rust/libgpiod-sys/Makefile
 		 bindings/rust/libgpiod/src/Makefile

-- 
2.45.2





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux