summaryrefslogtreecommitdiff
path: root/wrappers/python/Makefile
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-03-22 11:52:28 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-03-22 13:30:41 +0100
commit9bab3c87825b4284b3e6f2be3fa9e89da7723116 (patch)
tree6049f03402f23168c5000e9843a979935cd0996d /wrappers/python/Makefile
parentf94e6471268c12b7b5c7fd1c8b8800dac3848d6c (diff)
All: Refactor makefile & building
Diffstat (limited to 'wrappers/python/Makefile')
-rw-r--r--wrappers/python/Makefile26
1 files changed, 10 insertions, 16 deletions
diff --git a/wrappers/python/Makefile b/wrappers/python/Makefile
index d5e9071..9d51c15 100644
--- a/wrappers/python/Makefile
+++ b/wrappers/python/Makefile
@@ -1,24 +1,18 @@
-.PHONY: pack test clean
+.DEFAULT_GOAL := pack
+.PHONY: install-lib pack test clean
-EXPORTS_PATH ?= ../../exports
-include $(EXPORTS_PATH)/common.mk
+VERSION := $(shell grep -o 'const Version = "[^"]*' ../../internal/version/version.go | cut -d '"' -f 2)
-ifdef PLAT_NAME
-override SETUP_ARGS += --plat-name=$(PLAT_NAME)
-endif
+install-lib:
+ rm -rf eduvpn_common/lib/*
+ install "../../lib/libeduvpn_common-${VERSION}.so" -Dt "eduvpn_common/lib"
# Build for current platform only
-pack:
- mkdir -p ./eduvpn_common/lib
- ./setup.py bdist_wheel $(SETUP_ARGS) --exports-lib-path="$(EXPORTS_LIB_PATH)"
+pack: install-lib
+ python3 -m build --sdist --wheel .
-test: .try-build-lib
- install "$(EXPORTS_LIB_SUBFOLDER_PATH)/$(LIB_FILE)" -Dt "eduvpn_common/lib"
+test: install-lib
python3 -m unittest tests
- rm eduvpn_common/lib/*
clean:
- rm -rf build/ dist/ *.egg-info/ lib/*
-ifeq ($(CLEAN_ALL),1)
- rm -rf venv/
-endif
+ rm -rf build/ dist/ *.egg-info/ eduvpn_common/lib/* venv