-
Notifications
You must be signed in to change notification settings - Fork 113
/
Makefile
47 lines (32 loc) · 921 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
PROJECTPATH = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
VENV := .venv
VENV_PIP := $(PROJECTPATH)/$(VENV)/bin/pip
VENV_PYTHON := $(PROJECTPATH)/$(VENV)/bin/python3
EXTRA_PY := $(PROJECTPATH)/prometheus-openstack-exporter
FLAKE8 := $(VENV_PYTHON) -m flake8
all: lint test build
clean: clean-python clean-venv
clean-python:
rm -rf $(PROJECTPATH)/__pycache__
clean-venv:
rm -rf $(PROJECTPATH)/$(VENV)
dch:
gbp dch --debian-tag='%(version)s' -D bionic --git-log --first-parent
deb-src:
debuild -S -sa -I.git
install-build-depends:
sudo apt install \
debhelper \
git-buildpackage
lint:
@echo "Running lint checks"
@tox -e lint
black:
@echo "Reformat files with black"
@tox -e black
test: test-python
test-python: $(VENV)
$(VENV_PYTHON) -m unittest discover tests
$(VENV):
virtualenv --system-site-packages -p python3 $(PROJECTPATH)/$(VENV)
$(VENV_PIP) install -I -r requirements.txt