File: Makefile

package info (click to toggle)
prometheus-openstack-exporter 0.1.4-2.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 268 kB
  • sloc: python: 766; sh: 77; makefile: 32
file content (45 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (2)
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