-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (52 loc) · 1.29 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Preparation
TMP = $(CURDIR)/tmp
VERSION = $(shell grep ^Version te.spec | sed 's/.* //')
PACKAGE = te-$(VERSION)
FILES = LICENSE README.md \
Makefile requirements.txt setup.py te.spec \
files playbooks scripts src tests
# Formating
format:
black src
black tests
black setup.py
isort src
isort tests
isort setup.py
# Testing
tox:
tox
test: venv
. .env/bin/activate; .env/bin/pytest -vvv tests/unit
# Python development in venv
venv: .env/touchfile
.env/touchfile: requirements.txt test-requirements.txt
test -d .env || virtualenv .env
. .env/bin/activate; pip3 install -Ur requirements.txt
. .env/bin/activate; pip3 install -Ur test-requirements.txt
touch .env/touchfile
install:
. .env/bin/activate; pip3 install -U . --no-deps
# Docs
docs:
cd docs && make html
tmp:
mkdir -p $(TMP)
# Package build
source: clean tmp
mkdir -p $(TMP)/SOURCES
mkdir -p $(TMP)/$(PACKAGE)
cp -a $(FILES) $(TMP)/$(PACKAGE)
tarball: source
cd $(TMP) && tar cfz SOURCES/$(PACKAGE).tar.gz $(PACKAGE)
@echo ./tmp/SOURCES/$(PACKAGE).tar.gz
rpm: tarball
rpmbuild --define '_topdir $(TMP)' -bb te.spec
srpm: tarball
rpmbuild --define '_topdir $(TMP)' -bs te.spec
rpms: rpm srpm
# Cleanup
clean:
rm -rf build dist .cache .tox .mypy_cache .pytest_cache $(TMP) docs/_build
clean-all: clean
rm -rf .env