-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (35 loc) · 1.06 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
# Makefile to manage Python dependencies using pip-compile and pip
all: check
# The input requirements.in file
REQUIREMENTS_IN = requirements.in
# The generated requirements.txt file
REQUIREMENTS_TXT = requirements.txt
.PHONY: compile install push format check publish clean
format:
ruff format .
check: format install clean
compile: $(REQUIREMENTS_TXT)
install: compile
pip install -r $(REQUIREMENTS_TXT)
pip-compile requirements-dev.in -o requirements-dev.txt
pip install -r requirements-dev.txt
pip install -e .
$(REQUIREMENTS_TXT): $(REQUIREMENTS_IN)
pip-compile $(REQUIREMENTS_IN) -o $(REQUIREMENTS_TXT)
push: check
@if [ -z "$(message)" ]; then \
echo "Please specify a commit message: make commit message='Your message here'"; \
exit 1; \
fi
git add .
git commit -m "$(message)"
git push
clean:
rm -rf build dist .egg requests.egg-info *.egg-info
publish: clean
python setup.py sdist bdist_wheel
python -m twine upload dist/*
bump-version:
git add .
git commit -m "Bump version"
bump2version patch # use 'minor' or 'major' for bigger changes