-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
Copy pathMakefile
91 lines (65 loc) · 2.04 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
.PHONY: _prep create_environment requirements format lint docs docs-serve test \
test-fastest test-debug-fastest _clean_manual_test manual-test manual-test-debug
## GLOBALS
PROJECT_NAME = cookiecutter-data-science
PYTHON_VERSION = 3.10
PYTHON_INTERPRETER = python
### UTILITIES
_prep:
rm -f **/*/.DS_store
### DEV COMMANDS
## Set up python interpreter environment
create_environment:
conda create --name $(PROJECT_NAME) python=$(PYTHON_VERSION) -y
@echo ">>> conda env created. Activate with:\nconda activate $(PROJECT_NAME)"
## Install Python Dependencies
requirements:
$(PYTHON_INTERPRETER) -m pip install -r dev-requirements.txt
## Format the code using isort and black
format:
isort --profile black ccds hooks tests docs/scripts
black ccds hooks tests docs/scripts
lint:
flake8 ccds hooks tests docs/scripts
isort --check --profile black ccds hooks tests docs/scripts
black --check ccds hooks tests docs/scripts
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
dist: clean ## builds source and wheel package
python -m build
ls -l dist
### DOCS
docs:
cd docs && mkdocs build
docs-serve:
cd docs && mkdocs serve
### TESTS
test: _prep
pytest -vvv --durations=0
test-fastest: _prep
pytest -vvv -FFF
test-debug-last:
pytest --lf --pdb
_clean_manual_test:
rm -rf manual_test
manual-test: _prep _clean_manual_test
mkdir -p manual_test
cd manual_test && python -m ccds ..
manual-test-debug: _prep _clean_manual_test
mkdir -p manual_test
cd manual_test && python -m pdb ../ccds/__main__.py ..