generated from automl/automl_template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
100 lines (74 loc) · 2.09 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# These have been configured to only really run short tasks. Longer form tasks
# are usually completed in github actions.
NAME := RL_exercises
PACKAGE_NAME := rl_exercises
DIR := "${CURDIR}"
SOURCE_DIR := ${PACKAGE_NAME}
DIST := dist
TESTS_DIR := tests
.PHONY: help install-dev check format pre-commit clean clean-build build publish test
help:
@echo "Makefile ${NAME}"
@echo "* install-dev to install all dev requirements and install pre-commit"
@echo "* clean to clean any doc or build files"
@echo "* check to check the source code for issues"
@echo "* format to format the code with black and isort"
@echo "* pre-commit to run the pre-commit check"
@echo "* build to build a dist"
@echo "* publish to help publish the current branch to pypi"
@echo "* test to run the tests"
PYTHON ?= python
PYTEST ?= python -m pytest
PIP ?= python -m pip
MAKE ?= make
BLACK ?= black
PYDOCSTYLE ?= pydocstyle
MYPY ?= mypy
PRECOMMIT ?= pre-commit
FLAKE8 ?= flake8
install-dev:
$(PIP) install -e ".[dev]"
pre-commit install
check-black:
$(BLACK) ${SOURCE_DIR} --check || :
$(BLACK) ${TESTS_DIR} --check || :
check-pydocstyle:
$(PYDOCSTYLE) ${SOURCE_DIR} || :
check-mypy:
$(MYPY) ${SOURCE_DIR} || :
check-flake8:
$(FLAKE8) ${SOURCE_DIR} || :
$(FLAKE8) ${TESTS_DIR} || :
check: check-black check-mypy check-flake8 check-pydocstyle
pre-commit:
$(PRECOMMIT) run --all-files
format-black:
$(BLACK) ${SOURCE_DIR}
$(BLACK) ${TESTS_DIR}
format: format-black
test:
$(PYTEST) ${TESTS_DIR}
test-week-1:
$(PYTEST) ${TESTS_DIR}/week_1
test-week-2:
$(PYTEST) ${TESTS_DIR}/week_2
test-week-3:
$(PYTEST) ${TESTS_DIR}/week_3
test-week-4:
$(PYTEST) ${TESTS_DIR}/week_4
test-week-5:
$(PYTEST) ${TESTS_DIR}/week_5
test-week-6:
$(PYTEST) ${TESTS_DIR}/week_6
test-week-7:
$(PYTEST) ${TESTS_DIR}/week_7
test-week-8:
$(PYTEST) ${TESTS_DIR}/week_8
clean-build:
$(PYTHON) setup.py clean
rm -rf ${DIST}
# Build a distribution in ./dist
build:
$(PYTHON) setup.py sdist
# Clean up any builds in ./dist as well as doc, if present
clean: clean-build