Fixed python load paths so that vppcfg will work installed as python library and standalone from the source directory, fixing load pathes for resources such as yaml files along the way. Added a make target for pylint called 'make check-style', fixed a number of minor pylint issues along the way. Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
39 lines
770 B
Makefile
39 lines
770 B
Makefile
VERSION=0.0.1
|
|
VPPCFG:=vppcfg
|
|
PYTHON?=python3
|
|
PIP?=pip
|
|
PIP_DEPENDS=build yamale netaddr pylint
|
|
PIP_DEPENDS+=argparse pyyaml ipaddress black
|
|
WIPE=dist $(VPPCFG).egg-info .pybuild debian/vppcfg debian/vppcfg.*.log
|
|
WIPE+=debian/vppcfg.*.debhelper debian/.debhelper debian/files
|
|
WIPE+=debian/vppcfg.substvars
|
|
WHL_INSTALL=dist/$(VPPCFG)-$(VERSION)-py3-none-any.whl
|
|
|
|
.PHONY: build
|
|
build:
|
|
$(PYTHON) -m build
|
|
|
|
.PHONY: install-deps
|
|
install-deps:
|
|
sudo $(PIP) install $(PIP_DEPENDS)
|
|
|
|
.PHONY: install
|
|
install:
|
|
sudo $(PIP) install $(WHL_INSTALL)
|
|
|
|
.PHONY: pkg-deb
|
|
pkg-deb:
|
|
dpkg-buildpackage -uc -us -b
|
|
|
|
.PHONY: check-style
|
|
check-style:
|
|
PYTHONPATH=./$(VPPCFG) pylint ./$(VPPCFG)
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
sudo $(PIP) uninstall $(VPPCFG)
|
|
|
|
.PHONY: wipe
|
|
wipe:
|
|
$(RM) -rf $(WIPE)
|