From 88866c32254a38ed599572f3df9a181a99a1e25b Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Wed, 5 Nov 2025 10:55:29 +0100 Subject: [PATCH 1/3] pytrap: fix build system --- .github/workflows/c-cpp.yml | 4 +++- pytrap/Makefile.am | 2 +- pytrap/pyproject.toml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 5a2ab35f..f5961164 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -26,7 +26,9 @@ jobs: - name: install run: sudo make install - name: install pytrap - run: (cd pytrap && make coverage; sudo python3 setup.py install;) + run: (cd pytrap && make coverage; sudo pip install . ;) + - name: tests pycommon + run: (cd pycommon && pip install .[test] && python3 -m pytest;) - name: make check run: make check - name: make distcheck diff --git a/pytrap/Makefile.am b/pytrap/Makefile.am index 297e9af3..bc98ec9e 100644 --- a/pytrap/Makefile.am +++ b/pytrap/Makefile.am @@ -27,7 +27,7 @@ TESTS = test.sh .PHONY: coverage coverage: - CFLAGS=-coverage python3 -m pip install .[test] --no-deps --disable-pip-version-check --no-cache-dir + CFLAGS=-coverage python3 -m pip install .[test] --disable-pip-version-check --no-cache-dir CFLAGS=-coverage python3 -m pytest --cov=pycommon || echo "Skipped python3 tests" @lcov --capture --directory . --output-file coverage.info 2>/dev/null && \ genhtml coverage.info --output-directory out 2>/dev/null || echo "Skipped coverage analysis" diff --git a/pytrap/pyproject.toml b/pytrap/pyproject.toml index bb58afe5..342df2a0 100644 --- a/pytrap/pyproject.toml +++ b/pytrap/pyproject.toml @@ -17,6 +17,7 @@ license = { text = "BSD" } requires-python = ">=3.8" classifiers = [ "Development Status :: 4 - Beta", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: POSIX :: Linux", "Programming Language :: C", "Programming Language :: Python :: 3", @@ -63,7 +64,7 @@ sources = [ "src/iplist.c", "src/fields.c" ] -libraries = ["trap", "unirec"] +libraries = ["trap", "unirec","gcov"] [tool.pytest.ini_options] From 8811b40dadb02de5030d4fa946b21eed35172517 Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Wed, 5 Nov 2025 12:52:29 +0100 Subject: [PATCH 2/3] pytrap: add compile flag --- pytrap/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pytrap/pyproject.toml b/pytrap/pyproject.toml index 342df2a0..efda107a 100644 --- a/pytrap/pyproject.toml +++ b/pytrap/pyproject.toml @@ -65,6 +65,7 @@ sources = [ "src/fields.c" ] libraries = ["trap", "unirec","gcov"] +extra-compile-args = ["-O2"] [tool.pytest.ini_options] From 69c24e59644db5beaa8fda24691004bc9d57527c Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:18:30 +0100 Subject: [PATCH 3/3] pytrap: test --- .github/workflows/c-cpp.yml | 2 +- pytrap/Makefile.am | 7 ++++++- pytrap/test.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index f5961164..a1f9c33a 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -26,7 +26,7 @@ jobs: - name: install run: sudo make install - name: install pytrap - run: (cd pytrap && make coverage; sudo pip install . ;) + run: (cd pytrap && make test; sudo pip install . ;) - name: tests pycommon run: (cd pycommon && pip install .[test] && python3 -m pytest;) - name: make check diff --git a/pytrap/Makefile.am b/pytrap/Makefile.am index bc98ec9e..9f14b202 100644 --- a/pytrap/Makefile.am +++ b/pytrap/Makefile.am @@ -28,10 +28,15 @@ TESTS = test.sh .PHONY: coverage coverage: CFLAGS=-coverage python3 -m pip install .[test] --disable-pip-version-check --no-cache-dir - CFLAGS=-coverage python3 -m pytest --cov=pycommon || echo "Skipped python3 tests" + CFLAGS=-coverage python3 -m pytest --cov=pytrap || echo "Skipped python3 tests" @lcov --capture --directory . --output-file coverage.info 2>/dev/null && \ genhtml coverage.info --output-directory out 2>/dev/null || echo "Skipped coverage analysis" +.PHONY: test +test: + python3 -m pip install .[test] --no-cache-dir + python3 -m pytest + .PHONY: doc doc: python3 -m pip install .[docs] --no-cache-dir diff --git a/pytrap/test.sh b/pytrap/test.sh index 84313142..bc475ada 100755 --- a/pytrap/test.sh +++ b/pytrap/test.sh @@ -46,7 +46,7 @@ fi python3 -c 'import pytrap' 2>/dev/null || exit 77 -python3 $srcdir/setup.py test || exit $? +python3 -m pytest $srcdir/test || exit $? path_to_logger="$srcdir"/../../modules/logger/logger