forked from aiven/aiven-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 1.2 KB
/
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
short_ver = 2.0.2
long_ver = $(shell git describe --long 2>/dev/null || echo $(short_ver)-0-unknown-g`git describe --always`)
generated = aiven/client/version.py
PYTHON ?= python
all: $(generated)
aiven/client/version.py: .git/index
$(PYTHON) version.py $@
test: flake8 pylint pytest
flake8:
$(PYTHON) -m flake8 --max-line-length=125 aiven/ tests/
pylint:
$(PYTHON) -m pylint aiven/ --rcfile pylintrc tests/
pytest:
$(PYTHON) -m pytest -vv tests/
coverage: $(generated)
$(PYTHON) -m coverage run --source aiven -m pytest $(PYTEST_ARG) tests/
$(PYTHON) -m coverage report --show-missing
clean:
$(RM) -r rpms
build-dep-fedora:
sudo dnf install -y pylint python-devel python-flake8 python3-requests python2-requests
rpm: $(generated)
git archive --prefix=aiven-client/ HEAD -o rpm-src-aiven-client.tar
# add generated files to the tar, they're not in git repository
tar -r -f rpm-src-aiven-client.tar --transform=s,aiven/,aiven-client/aiven/, $(generated)
rpmbuild -bb aiven-client.spec \
--define '_sourcedir $(CURDIR)' \
--define '_rpmdir $(PWD)/rpms' \
--define 'major_version $(short_ver)' \
--define 'minor_version $(subst -,.,$(subst $(short_ver)-,,$(long_ver)))'
$(RM) rpm-src-aiven-client.tar