-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (59 loc) · 2.16 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
PACKAGE_NAME = sparpy
help:
@echo "Options"
@echo "---------------------------------------------------------------"
@echo "help: This help"
@echo "requirements: Download requirements"
@echo "requirements-dev: Download requirements for development"
@echo "requirements-docs: Download requirements for docs"
@echo "run-tests: Run tests with coverage"
@echo "clean: Clean compiled files"
@echo "flake: Run Flake8"
@echo "prepush: Helper to run before to push to repo"
@echo "autopep: Reformat code using PEP8"
@echo "beautify: Alias of autopep"
@echo "publish: Publish package on Pypi repository"
@echo "---------------------------------------------------------------"
requirements:
@echo "Installing $(PACKAGE_NAME) requirements..."
pip3 install -r requirements.txt
requirements-dev: requirements
@echo "Installing $(PACKAGE_NAME) development requirements..."
pip3 install -r requirements-dev.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_NAME) --cover-erase -x
clean:
@echo "Cleaning compiled files..."
find . | grep -E "(__pycache__|\.pyc|\.pyo)$ " | xargs rm -rf
@echo "Cleaning coverage files..."
rm -f .coverage
@echo "Cleaning build files..."
rm -rf build
@echo "Cleaning egg files..."
rm -rf *.egg-info
@echo "Cleaning distribution files..."
rm -rf dist
@echo "Cleaning spark distribution files..."
rm -rf spark_dist
flake:
@echo "Running flake8 tests..."
flake8 $(PACKAGE_NAME)
flake8 tests
isort -c ${ISORT_PARAMS} ${PACKAGE_NAME}
isort -c ${ISORT_PARAMS} tests
autopep:
autopep8 --max-line-length 120 -r -j 8 -i -a --exclude ./docs/source/conf.py .
sort-imports:
isort ${ISORT_PARAMS} ${PACKAGE_NAME}
isort ${ISORT_PARAMS} tests
beautify: autopep sort-imports
prepush: flake run-tests
build:
python3 setup.py bdist_wheel
publish: clean build
@echo "Publishing new version on Pypi..."
twine upload dist/*