-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (55 loc) · 1.54 KB
/
Makefile
File metadata and controls
74 lines (55 loc) · 1.54 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
69
70
71
72
73
74
#* Variables
SHELL := /usr/bin/env bash
PYTHON ?= python3
#* Initialization
.PHONY: project-init
project-init: poetry-install tools-install mypy-install
.PHONY: poetry-install
poetry-install:
poetry install -n
.PHONY: poetry-lock-update
poetry-lock-update:
poetry lock --no-update
.PHONY: poetry-export
poetry-export:
poetry lock -n && poetry export --without-hashes > requirements.txt
.PHONY: poetry-export-dev
poetry-export-dev:
poetry lock -n && poetry export --with dev --without-hashes > requirements.dev.txt
#* Tools
.PHONY: tools-install
tools-install:
poetry run pre-commit install --hook-type prepare-commit-msg --hook-type pre-commit
poetry run nbdime config-git --enable
.PHONY: pre-commit-update
pre-commit-update:
poetry run pre-commit autoupdate
.PHONY: pre-commit-run-all
pre-commit-run-all:
poetry run pre-commit run --all-files
#* Notebooks
.PHONY: nbextention-toc-install
nbextention-toc-install:
poetry run jupyter contrib nbextension install --user
poetry run jupyter nbextension enable toc2/main
#* Linting
.PHONY: mypy-install
mypy-install:
poetry run mypy --install-types --non-interactive ./
.PHONY: mypy
mypy:
poetry run mypy --config-file pyproject.toml ./
#* Cleaning
.PHONY: pycache-remove
pycache-remove:
find . | grep -E "(__pycache__|\.pyc|\.pyo$$)" | xargs rm -rf
find . | grep -E "(.ipynb_checkpoints$$)" | xargs rm -rf
.PHONY: build-remove
build-remove:
rm -rf build/
.PHONY: clean-all
clean-all: pycache-remove build-remove
#* Service targets
.PHONY: grep-todos
grep-todos:
git grep -EIn "TODO|FIXME|XXX"