forked from gmggroup/omf-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (59 loc) · 1.7 KB
/
Makefile
File metadata and controls
72 lines (59 loc) · 1.7 KB
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
ORG=gmggroup
APP=omf
.PHONY: install docs lint test-docs tests docker-build docker-tests docker-lint docker-docs publish
install:
python setup.py install
docs:
cd docs && make html
lint:
pylint $(APP)
test-docs:
nosetests --logging-level=INFO docs
tests:
pytest tests/
format:
black .
docker-build:
docker build -t $(ORG)/$(APP):latest -f Dockerfile .
docker-tests: docker-build
mkdir -p cover
docker run --rm \
--name=$(APP)-tests \
-v $(shell pwd)/$(APP):/usr/src/app/$(APP) \
-v $(shell pwd)/tests:/usr/src/app/tests \
-v $(shell pwd)/cover:/usr/src/app/cover \
$(ORG)/$(APP):latest \
bash -c "pytest --cov=$(APP) --cov-report term --cov-report html:cover/ tests/ && cp .coverage cover/"
mv -f cover/.coverage ./
docker-lint: docker-build
docker run --rm \
--name=$(APP)-tests \
-v $(shell pwd)/$(APP):/usr/src/app/$(APP) \
-v $(shell pwd)/tests:/usr/src/app/tests \
-v $(shell pwd)/.pylintrc:/usr/src/app/.pylintrc \
$(ORG)/$(APP):latest \
pylint --rcfile=.pylintrc $(APP) tests
docker-format: docker-build
docker run --rm \
--name=$(APP)-tests \
-v $(shell pwd)/$(APP):/usr/src/app/$(APP) \
-v $(shell pwd)/tests:/usr/src/app/tests \
$(ORG)/$(APP):latest \
black --check /usr/src/app
docker-docs: docker-build
docker run --rm \
--name=$(APP)-tests \
-v $(shell pwd)/$(APP):/usr/src/app/$(APP) \
-v $(shell pwd)/docs:/usr/src/app/docs \
$(ORG)/$(APP):latest \
nosetests --logging-level=INFO docs
publish: docker-build
mkdir -p dist
docker run --rm \
--name=$(APP)-publish \
-v $(shell pwd)/$(APP):/usr/src/app/$(APP) \
-v $(shell pwd)/dist:/usr/src/app/dist \
$(ORG)/$(APP) \
python setup.py sdist bdist_wheel
pip install twine
twine upload dist/*