-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
55 lines (40 loc) · 1.57 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
VENV = .venv
PYTHON = $(VENV)/bin/python3
PIP = $(VENV)/bin/pip
# DIRECTORY = $(sort $(dir $(wildcard */)))
# MAIN_DIR = $(shell find . -maxdepth 1 -mindepth 1 -type d -not -iname '.git*')
.PHONY: clean fmt
.DEFAULT_GOAL = help
help:
@echo "---------------HELP-----------------"
@echo "To dev the project type make dev"
@echo "To build the project type make build"
@echo "To install the project type make install"
@echo "To format the project type make fmt"
@echo "To clean the project type make clean"
@echo "------------------------------------"
clean:
@find . -maxdepth 3 -mindepth 1 -type d \( -iname '*pycache*' -or -iname 'build' -or -iname 'dist' \) -exec bash -c 'echo "rm -rf {}"' \; | sh
@rm -rf $(VENV) .vscode rds_snap.egg-info
$(VENV)/bin/activate: requirements_dev.txt requirements.txt
python3 -m venv $(VENV)
$(PIP) install pip --upgrade
$(PIP) install -r requirements_dev.txt -r requirements.txt
build: $(VENV)/bin/activate
$(PYTHON) setup.py build
# $(PYTHON) -m build --sdist --wheel --outdir dist/ .
dist: $(VENV)/bin/activate
$(PYTHON) setup.py sdist bdist_wheel
dev: $(VENV)/bin/activate vscode fmt
$(PYTHON) setup.py install
install:
python3 -m pip install -r requirements_dev.txt -r requirements.txt
python3 setup.py install
.vscode/settings.json: $(VENV)/bin/activate
@mkdir -p .vscode
@echo "{\"python.pythonPath\": \"$(VENV)/bin/python\", \"python.terminal.activateEnvInCurrentTerminal\": true}" > .vscode/settings.json
vscode: .vscode/settings.json
fmt: $(VENV)/bin/activate
$(PYTHON) -m black .
publish: dist
$(PYTHON) -m twine upload dist/*