-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
80 lines (49 loc) · 1.77 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
70
71
72
73
74
75
76
77
78
79
80
.PHONY: .test_requirements test cov install dist upload example clean
RM = rm -rf
PYTHON = python3
# ┏━━━━━━━━━┓
# ┃ Testing ┃
# ┗━━━━━━━━━┛
PYTEST = $(PYTHON) setup.py test
PYTEST_COV_OPTS ?= --cov=src --cov-report=term --no-cov-on-fail
test: cleanpy
$(PYTEST)
cov: cleanpy
$(PYTEST) --addopts "$(PYTEST_COV_OPTS)"
testclean: cleanpy
@$(RM) .cache .coverage
# ┏━━━━━━━━━━━━━━━━━━━┓
# ┃ Building, running ┃
# ┗━━━━━━━━━━━━━━━━━━━┛
dist: cleanpy
$(PYTHON) setup.py sdist
upload: cleanpy
$(PYTHON) setup.py sdist upload
example: cleanpy
@echo Starting example server
@CONFIG_PATH=./examples/running/config.yml python -m datacatalog.main
# ┏━━━━━━━━━━━━━━┓
# ┃ Dependencies ┃
# ┗━━━━━━━━━━━━━━┛
rundeps: cleanpy
@echo -n 'Installing... '
@pip3 install --quiet --upgrade --upgrade-strategy eager -e . && echo 'OK' || echo 'FAILED'
testdeps:
@echo -n 'Installing with test dependencies... '
@pip3 install --quiet --upgrade --upgrade-strategy eager -e .[test] && echo 'OK' || echo 'FAILED'
alldeps:
@echo -n 'Installing with all dependencies... '
@pip3 install --quiet --upgrade --upgrade-strategy eager -e .[dev,docs,test] && echo 'OK' || echo 'FAILED'
# ┏━━━━━━━━━━━━━┓
# ┃ Cleaning up ┃
# ┗━━━━━━━━━━━━━┛
cleanpy:
@echo Removing pyc and pyo files
@find . -type f -name '*.py[co]' -exec rm {} \;
clean: cleanpy
@# From running pytest:
$(RM) .coverage .cache
@# From `pip3 install -e .`:
-pip3 uninstall -y datacatalog-core && $(RM) src/datacatalog_core.egg-info
@# From `setup.py sdist`:
$(RM) dist