Skip to content

Commit 0682363

Browse files
authored
pytrap: fix build system and workflow
1 parent 4c0c6b7 commit 0682363

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

.github/workflows/c-cpp.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ jobs:
2626
- name: install
2727
run: sudo make install
2828
- name: install pytrap
29-
run: (cd pytrap && make coverage; sudo python3 setup.py install;)
29+
run: (cd pytrap && make test; sudo pip install . ;)
30+
- name: tests pycommon
31+
run: (cd pycommon && pip install .[test] && python3 -m pytest;)
3032
- name: make check
3133
run: make check
3234
- name: make distcheck

pytrap/Makefile.am

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ TESTS = test.sh
2727

2828
.PHONY: coverage
2929
coverage:
30-
CFLAGS=-coverage python3 -m pip install .[test] --no-deps --disable-pip-version-check --no-cache-dir
31-
CFLAGS=-coverage python3 -m pytest --cov=pycommon || echo "Skipped python3 tests"
30+
CFLAGS=-coverage python3 -m pip install .[test] --disable-pip-version-check --no-cache-dir
31+
CFLAGS=-coverage python3 -m pytest --cov=pytrap || echo "Skipped python3 tests"
3232
@lcov --capture --directory . --output-file coverage.info 2>/dev/null && \
3333
genhtml coverage.info --output-directory out 2>/dev/null || echo "Skipped coverage analysis"
3434

35+
.PHONY: test
36+
test:
37+
python3 -m pip install .[test] --no-cache-dir
38+
python3 -m pytest
39+
3540
.PHONY: doc
3641
doc:
3742
python3 -m pip install .[docs] --no-cache-dir

pytrap/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ license = { text = "BSD" }
1717
requires-python = ">=3.8"
1818
classifiers = [
1919
"Development Status :: 4 - Beta",
20+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
2021
"Operating System :: POSIX :: Linux",
2122
"Programming Language :: C",
2223
"Programming Language :: Python :: 3",
@@ -63,7 +64,8 @@ sources = [
6364
"src/iplist.c",
6465
"src/fields.c"
6566
]
66-
libraries = ["trap", "unirec"]
67+
libraries = ["trap", "unirec","gcov"]
68+
extra-compile-args = ["-O2"]
6769

6870

6971
[tool.pytest.ini_options]

pytrap/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fi
4646

4747
python3 -c 'import pytrap' 2>/dev/null || exit 77
4848

49-
python3 $srcdir/setup.py test || exit $?
49+
python3 -m pytest $srcdir/test || exit $?
5050

5151
path_to_logger="$srcdir"/../../modules/logger/logger
5252

0 commit comments

Comments
 (0)