-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (41 loc) · 940 Bytes
/
Copy pathMakefile
File metadata and controls
50 lines (41 loc) · 940 Bytes
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
.PHONY: install test lint clean run
# Variables
PYTHON = python
PIP = pip
FLASK = flask
TEST = pytest
LINT = flake8
# Installation
install:
$(PIP) install -r requirements.txt
# Testing
test:
$(TEST) tests/
# Linting
lint:
$(LINT) .
# Clean up
clean:
find . -type d -name "__pycache__" -exec rm -r {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.pyd" -delete
find . -type f -name ".coverage" -delete
find . -type d -name "*.egg-info" -exec rm -r {} +
find . -type d -name "*.egg" -exec rm -r {} +
find . -type d -name ".pytest_cache" -exec rm -r {} +
find . -type d -name ".eggs" -exec rm -r {} +
# Run development server
run:
$(PYTHON) app.py
# Train model
train:
$(PYTHON) train.py
# Generate test coverage report
coverage:
coverage run -m pytest tests/
coverage report
coverage html
# Create distribution package
dist:
$(PYTHON) setup.py sdist bdist_wheel