forked from canonical/prometheus-openstack-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (30 loc) · 930 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
PROJECTPATH = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
VENV := .venv
VENV_PIP := $(PROJECTPATH)/$(VENV)/bin/pip
VENV_PYTHON := $(PROJECTPATH)/$(VENV)/bin/python2.7
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: lint-python
# See .flake8 for config options.
lint-python: $(VENV)
$(FLAKE8) $(PROJECTPATH) $(EXTRA_PY)
test: test-python
test-python: $(VENV)
$(VENV_PYTHON) -m unittest discover tests
$(VENV):
virtualenv --system-site-packages -p python2.7 $(PROJECTPATH)/$(VENV)
$(VENV_PIP) install -I -r requirements.txt