-
Notifications
You must be signed in to change notification settings - Fork 77
/
Makefile
66 lines (53 loc) · 1.99 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
PACKAGE_NAME = webwhatsapi
PACKAGE_COVERAGE = webwhatsapi
help:
@echo "Options"
@echo "-----------------------------------------------------------------------"
@echo "help: This help"
@echo "requirements: Download requirements"
@echo "requirements-test: Download requirements for tests"
@echo "requirements-docs: Download requirements for docs"
@echo "run-tests: Run tests with coverage"
@echo "publish: Publish new version on Pypi"
@echo "clean: Clean compiled files"
@echo "flake: Run Flake8"
@echo "prepush: Helper to run before to push to repo"
@echo "pull-request: Helper to run before to merge a pull request"
@echo "autopep: Reformat code using PEP8"
@echo "-----------------------------------------------------------------------"
requirements:
@echo "Installing ${PACKAGE_NAME} requirements..."
pip install -r requirements.txt
requirements-test: requirements
@echo "Installing ${PACKAGE_NAME} tests requirements..."
pip install -r requirements-test.txt
requirements-docs: requirements
@echo "Installing ${PACKAGE_NAME} docs requirements..."
pip install -r requirements-docs.txt
run-tests:
@echo "Running tests..."
nosetests --with-coverage -d --cover-package=${PACKAGE_COVERAGE} --cover-erase
publish:
@echo "Publishing new version on Pypi..."
python setup.py bdist_wheel upload
clean:
@echo "Cleaning compiled files..."
find . | grep -E "(__pycache__|\.pyc|\.pyo)$ " | xargs rm -rf
@echo "Cleaning distribution files..."
rm -rf dist
@echo "Cleaning build files..."
rm -rf build
@echo "Cleaning egg info files..."
rm -rf ${PACKAGE_NAME}.egg-info
@echo "Cleaning coverage files..."
rm -f .coverage
build:
python3 setup.py bdist_wheel
flake:
@echo "Running flake8 tests..."
flake8 ${PACKAGE_COVERAGE}
flake8 tests
autopep:
autopep8 --max-line-length 120 -r -j 8 -i .
prepush: flake run-tests
pull-request: flake run-tests