From c1d82a84796698b9e21393e53cc3f33267b5c0bb Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Tue, 4 Nov 2025 15:56:18 +0100 Subject: [PATCH 1/5] pytrap: fix workflow --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 5a2ab35f..484e6088 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 python3 setup.py install;) + run: (cd pytrap && make coverage; sudo pip install .;) - name: make check run: make check - name: make distcheck From 96df0efb8345d997982c44e8c9047d34b05a195e Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Tue, 4 Nov 2025 16:53:25 +0100 Subject: [PATCH 2/5] pycommon: add tests to workflow --- .github/workflows/c-cpp.yml | 2 ++ pytrap/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 484e6088..e3063a79 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -27,6 +27,8 @@ jobs: run: sudo make install - name: install pytrap run: (cd pytrap && make coverage; sudo pip install .;) + - name: pycommon tests + run: (cd pycommon && pip install .[test] && 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" From ac4ba1a9a828be8651e541f3a3245b04f03825f3 Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:16:52 +0100 Subject: [PATCH 3/5] fix pyproject --- pycommon/pyproject.toml | 41 ++++++++++++++++++++++------------------- pytrap/pyproject.toml | 16 +++++++++------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/pycommon/pyproject.toml b/pycommon/pyproject.toml index 3c2b9663..04c4d4fd 100644 --- a/pycommon/pyproject.toml +++ b/pycommon/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61.0"] +requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -9,36 +9,36 @@ description = "Common Python modules and methods of the NEMEA system." readme = {text = "The module contains methods for creation and submission of incident reports in IDEA format.", content-type = "text/plain"} license = {text = "BSD"} authors = [ - {name = "Vaclav Bartos, CESNET", email = "bartos@cesnet.cz"}, + {name = "Vaclav Bartos, CESNET", email = "bartos@cesnet.cz"}, ] maintainers = [ - {name = "Tomas Cejka", email = "cejkat@cesnet.cz"}, + {name = "Tomas Cejka", email = "cejkat@cesnet.cz"}, ] requires-python = ">=3.6" dependencies = [ - "pynspect", - "idea-format", - "PyYAML", - "ply", - "jinja2", - "redis", + "pynspect", + "idea-format", + "PyYAML", + "ply", + "jinja2", + "redis", ] classifiers = [ - "Development Status :: 4 - Beta", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: POSIX", - "Programming Language :: C", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Networking :: Monitoring", + "Development Status :: 4 - Beta", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: POSIX", + "Programming Language :: C", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries", + "Topic :: System :: Networking :: Monitoring", ] [project.optional-dependencies] test = [ - "pytest", - "pytest-cov", + "pytest", + "pytest-cov", ] @@ -50,6 +50,9 @@ Homepage = "https://github.com/CESNET/Nemea-Framework" py-modules = ["report2idea", "ip_prefix_search"] packages = ["reporter_config", "reporter_config.actions"] +[tool.setuptools.extension] +include-dirs = ["/usr/include", "/usr/local/include"] +library-dirs = ["/usr/lib", "/usr/local/lib"] [tool.pytest.ini_options] testpaths = ["test"] diff --git a/pytrap/pyproject.toml b/pytrap/pyproject.toml index bb58afe5..8d6b5d98 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", @@ -33,20 +34,19 @@ dependencies = [] [project.optional-dependencies] test = [ - "pytest", - "pytest-cov", - "pytest-forked", + "pytest", + "pytest-cov", + "pytest-forked", ] docs = [ - "sphinx", - "sphinx-rtd-theme", - "sphinx-pyproject" + "sphinx", + "sphinx-rtd-theme", + "sphinx-pyproject", ] [project.urls] Homepage = "https://github.com/CESNET/Nemea-Framework" -# Configure setuptools to find packages and handle C extensions [tool.setuptools] package-dir = { "" = "src" } @@ -64,6 +64,8 @@ sources = [ "src/fields.c" ] libraries = ["trap", "unirec"] +include-dirs = ["/usr/include", "/usr/local/include"] +library-dirs = ["/usr/lib", "/usr/local/lib"] [tool.pytest.ini_options] From 69ee58a17a1b282ec74551dcc7acd9c7bb1e4d48 Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:35:05 +0100 Subject: [PATCH 4/5] add ldconfig --- .github/workflows/c-cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index e3063a79..98d124dd 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -24,7 +24,9 @@ jobs: - name: make run: make -j10 - name: install - run: sudo make install + run: | + sudo make install + sudo ldconfig - name: install pytrap run: (cd pytrap && make coverage; sudo pip install .;) - name: pycommon tests From 2b562aea23e1474834bc51f84977e26aa9841796 Mon Sep 17 00:00:00 2001 From: David Kezlinek <103315902+Dakevid@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:37:44 +0100 Subject: [PATCH 5/5] pzproject --- pycommon/pyproject.toml | 41 +++++++++++++++++++---------------------- pytrap/pyproject.toml | 15 +++++++-------- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/pycommon/pyproject.toml b/pycommon/pyproject.toml index 04c4d4fd..3c2b9663 100644 --- a/pycommon/pyproject.toml +++ b/pycommon/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61.0", "wheel"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] @@ -9,36 +9,36 @@ description = "Common Python modules and methods of the NEMEA system." readme = {text = "The module contains methods for creation and submission of incident reports in IDEA format.", content-type = "text/plain"} license = {text = "BSD"} authors = [ - {name = "Vaclav Bartos, CESNET", email = "bartos@cesnet.cz"}, + {name = "Vaclav Bartos, CESNET", email = "bartos@cesnet.cz"}, ] maintainers = [ - {name = "Tomas Cejka", email = "cejkat@cesnet.cz"}, + {name = "Tomas Cejka", email = "cejkat@cesnet.cz"}, ] requires-python = ">=3.6" dependencies = [ - "pynspect", - "idea-format", - "PyYAML", - "ply", - "jinja2", - "redis", + "pynspect", + "idea-format", + "PyYAML", + "ply", + "jinja2", + "redis", ] classifiers = [ - "Development Status :: 4 - Beta", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: POSIX", - "Programming Language :: C", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Networking :: Monitoring", + "Development Status :: 4 - Beta", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: POSIX", + "Programming Language :: C", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries", + "Topic :: System :: Networking :: Monitoring", ] [project.optional-dependencies] test = [ - "pytest", - "pytest-cov", + "pytest", + "pytest-cov", ] @@ -50,9 +50,6 @@ Homepage = "https://github.com/CESNET/Nemea-Framework" py-modules = ["report2idea", "ip_prefix_search"] packages = ["reporter_config", "reporter_config.actions"] -[tool.setuptools.extension] -include-dirs = ["/usr/include", "/usr/local/include"] -library-dirs = ["/usr/lib", "/usr/local/lib"] [tool.pytest.ini_options] testpaths = ["test"] diff --git a/pytrap/pyproject.toml b/pytrap/pyproject.toml index 8d6b5d98..4ab92477 100644 --- a/pytrap/pyproject.toml +++ b/pytrap/pyproject.toml @@ -34,19 +34,20 @@ dependencies = [] [project.optional-dependencies] test = [ - "pytest", - "pytest-cov", - "pytest-forked", + "pytest", + "pytest-cov", + "pytest-forked", ] docs = [ - "sphinx", - "sphinx-rtd-theme", - "sphinx-pyproject", + "sphinx", + "sphinx-rtd-theme", + "sphinx-pyproject" ] [project.urls] Homepage = "https://github.com/CESNET/Nemea-Framework" + [tool.setuptools] package-dir = { "" = "src" } @@ -64,8 +65,6 @@ sources = [ "src/fields.c" ] libraries = ["trap", "unirec"] -include-dirs = ["/usr/include", "/usr/local/include"] -library-dirs = ["/usr/lib", "/usr/local/lib"] [tool.pytest.ini_options]