diff --git a/.bumpversion.cfg b/.bumpversion.cfg index f4b2655..207377f 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -10,7 +10,7 @@ serialize = search = VERSION "{current_version}" replace = VERSION "{new_version}" -[bumpversion:file:src/python/setup.py] +[bumpversion:file:python/setup.py] search = version="{current_version}" replace = version="{new_version}" diff --git a/.gitignore b/.gitignore index c0bf83b..a1acb91 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ /pkg/arch/v*.tar.gz /pkg/arch/ustreamer-*.pkg.tar.xz /pkg/arch/ustreamer-*.pkg.tar.zst -/src/python/build/ /build/ +/python/build/ /config.mk /vgcore.* /ustreamer diff --git a/Makefile b/Makefile index 22419c7..6eee854 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ PREFIX ?= /usr/local MANPREFIX ?= $(PREFIX)/share/man CC ?= gcc +PY ?= python3 CFLAGS ?= -O3 -MD LDFLAGS ?= @@ -90,7 +91,7 @@ install: $(USTR) $(DUMP) gzip -f $(DESTDIR)$(MANPREFIX)/man1/$(USTR).1 gzip -f $(DESTDIR)$(MANPREFIX)/man1/$(DUMP).1 ifneq ($(call optbool,$(WITH_PYTHON)),) - cd src/python && python3 setup.py install --prefix=$(PREFIX) --root=$(if $(DESTDIR),$(DESTDIR),/) + cd python && $(PY) setup.py install --prefix=$(PREFIX) --root=$(if $(DESTDIR),$(DESTDIR),/) endif @@ -132,8 +133,9 @@ $(BUILD)/%.o: %.c python: ifneq ($(call optbool,$(WITH_PYTHON)),) - cd src/python && python3 setup.py build - ln -sf src/python/build/lib.*/*.so . + $(info == PY_BUILD ustreamer-*.so) + @ cd python && $(PY) setup.py --quiet build + @ ln -sf python/build/lib.*/*.so . else @ true endif @@ -180,7 +182,7 @@ clean-all: linters clean -it $(LINTERS_IMAGE) bash -c "cd src && rm -rf linters/{.tox,.mypy_cache}" clean: rm -rf pkg/arch/pkg pkg/arch/src pkg/arch/v*.tar.gz pkg/arch/ustreamer-*.pkg.tar.{xz,zst} - rm -rf $(USTR) $(DUMP) $(BUILD) src/python/build vgcore.* *.sock *.so + rm -rf $(USTR) $(DUMP) $(BUILD) python/build vgcore.* *.sock *.so .PHONY: python linters diff --git a/linters/tox.ini b/linters/tox.ini index f39b3df..cb7954a 100644 --- a/linters/tox.ini +++ b/linters/tox.ini @@ -24,26 +24,26 @@ commands = cppcheck \ [testenv:flake8] whitelist_externals = bash -commands = bash -c 'flake8 --config=linters/flake8.ini tools/*.py' src/python/*.py +commands = bash -c 'flake8 --config=linters/flake8.ini tools/*.py' python/*.py deps = flake8 flake8-quotes [testenv:pylint] whitelist_externals = bash -commands = bash -c 'pylint --rcfile=linters/pylint.ini --output-format=colorized --reports=no tools/*.py src/python/*.py' +commands = bash -c 'pylint --rcfile=linters/pylint.ini --output-format=colorized --reports=no tools/*.py python/*.py' deps = pylint [testenv:mypy] whitelist_externals = bash -commands = bash -c 'mypy --config-file=linters/mypy.ini tools/*.py src/python/*.py' +commands = bash -c 'mypy --config-file=linters/mypy.ini tools/*.py python/*.py' deps = mypy [testenv:vulture] whitelist_externals = bash -commands = bash -c 'vulture tools/*.py src/python/*.py' +commands = bash -c 'vulture tools/*.py python/*.py' deps = vulture diff --git a/src/python/setup.py b/python/setup.py similarity index 100% rename from src/python/setup.py rename to python/setup.py diff --git a/src/python/ustreamer.c b/python/ustreamer.c similarity index 98% rename from src/python/ustreamer.c rename to python/ustreamer.c index da473dd..f9e1433 100644 --- a/src/python/ustreamer.c +++ b/python/ustreamer.c @@ -13,8 +13,8 @@ #include -#include "../libs/tools.h" // Just a header without C-sources -#include "../libs/memsinksh.h" // No sources again +#include "../src/libs/tools.h" // Just a header without C-sources +#include "../src/libs/memsinksh.h" // No sources again typedef struct {