forked from alfred82santa/python-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 2.02 KB
/
Copy pathMakefile
File metadata and controls
68 lines (54 loc) · 2.02 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
PACKAGE_NAME = pylibrary-template
PACKAGE_COVERAGE = pylibrary-template
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 "beautify: Reformat code "
echo "-----------------------------------------------------------------------"
requirements:
@echo "Installing ${PACKAGE_NAME} requirements..."
pip3 install -r requirements.txt
requirements-test: requirements
@echo "Installing ${PACKAGE_NAME} tests requirements..."
pip3 install -r requirements-test.txt
requirements-docs: requirements
@echo "Installing ${PACKAGE_NAME} docs requirements..."
pip3 install -r requirements-docs.txt
run-tests:
@echo "Running tests..."
nosetests --with-coverage -d --cover-package=${PACKAGE_COVERAGE} --cover-erase
publish: clean build
@echo "Publishing new version on Pypi..."
twine upload dist/*
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
force-build: clean build
flake:
@echo "Running flake8 tests..."
flake8 ${PACKAGE_COVERAGE}
flake8 tests
prepush: flake run-tests
pull-request: flake run-tests
beautify:
autopep8 --max-line-length 120 -r -j 8 -i .