-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (55 loc) · 2 KB
/
Makefile
File metadata and controls
74 lines (55 loc) · 2 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
# This target is executed whenever we just type `make`
.DEFAULT_GOAL = help
FILE=VERSION
VERSION=`cat $(FILE)`
COMMIT_MSG_HOOK = '\#!/bin/bash\nMSG_FILE=$$1\ncz check --allow-abort --commit-msg-file $$MSG_FILE'
DOCKER_IMAGE_NAME=so_analytics
USERNAME=salvob41
ENV_FILE=.env
install-pip-tools:
pip install -U pip
pip install --upgrade pip-tools
requirements-dev.txt: requirements-dev.in install-pip-tools
pip-compile --upgrade --resolver backtracking --output-file=$@ requirements-dev.in
requirements.txt: requirements.in install-pip-tools
pip-compile --upgrade --resolver backtracking --output-file=$@ requirements.in
install-dev: requirements-dev.txt
pip install -r requirements-dev.txt
install: requirements.txt
pip install -r requirements.txt
setup-dev-env: install-dev
pre-commit install
echo $(COMMIT_MSG_HOOK) > .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
setup-dev-env-autoupdate: setup-dev-env
pre-commit autoupdate
clean:
find . -type d -name __pycache__ -prune -exec rm -rf {} \;
find . -type d -name .hypothesis -prune -exec rm -rf {} \;
find . -type d -name .ipynb_checkpoints -prune -exec rm -rf {} \;
find . -type d -name .pytest_cache -prune -exec rm -rf {} \;
find . -type d -name .mypy_cache -prune -exec rm -rf {} \;
ndef = $(if $(value $(1)),,$(error $(1) not set, provide $(1), e.g. make $(1)=<value> <target>))
echo-version:
$(call ndef,VERSION)
@echo $(VERSION)
fetch-tags:
git fetch --tags
changelog: setup-dev-env
cz changelog --unreleased-version $(VERSION)
# this will update the version, changelog, tag and commit
bump: fetch-tags setup-dev-env
cz bump
bump-minor: fetch-tags setup-dev-env
cz bump --increment MINOR
bump-major: fetch-tags setup-dev-env
cz bump --increment MAJOR
bump-patch: fetch-tags setup-dev-env
cz bump --increment PATCH
docker-build:
docker build -t $(USERNAME)/$(DOCKER_IMAGE_NAME):$(VERSION) .
set-env-variables:
set -o allexport && source .env && set +o allexport
local-run: set-env-variables
$(call ndef,ENV_FILE)
uvicorn main:app --reload