-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (44 loc) · 1.28 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
#* Variables
PYTHON := python3
OS := $(shell uname -o)
#################################
# Poetry install/uninstall
#################################
#* Poetry
.PHONY: poetry-download
poetry-download:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | $(PYTHON) -
.PHONY: poetry-remove
poetry-remove:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | $(PYTHON) - --uninstall
.PHONY: poetry-install
poetry-install:
poetry install -n
.PHONY: poetry-export
poetry-export:
poetry export --without-hashes > requirements.core.txt
.PHONY: poetry-export-dev
poetry-export-dev:
poetry export --without-hashes --dev > requirements.txt
.PHONY: tools-install
tools-install:
poetry run pre-commit install
poetry run nbdime config-git --enable
# Prepare project when you first time load it
prepare-project:
poetry install
poetry run pre-commit install
ifeq ($(OS),GNU/Linux)
chmod +x ./git_hook/git-hook.sh
./git_hook/git-hook.sh
else
git_hook\git-hook.bat
endif
#* Installation
.PHONY: install
install: poetry-install tools-install
#* Cleaning
.PHONY: pycache-remove
pycache-remove:
find . | grep -E "(__pycache__|\.pyc|\.pyo$$)" | xargs rm -rf
find . | grep -E "(.ipynb_checkpoints$$)" | xargs rm -rf