-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (36 loc) · 1.19 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
VERSION=$(shell grep '^__version__' git_fortune/version.py | cut -d '"' -f2)
.PHONY: release localdev test clean showvars help
help:
@echo "These are our make targets and what they do."
@echo "All unlisted targets are internal."
@echo ""
@echo " help: Show this helptext"
@echo " localdev: Setup local development env with a 'pip install -e'"
@echo " showvars: Show makefile variables"
@echo " test: Lint and test code"
@echo " autoformat: Format code with black + isort"
@echo " release: Build, tag, release to pypi"
@echo " clean: Remove typically unwanted files"
showvars:
@echo "VERSION=$(VERSION)"
.venv:
virtualenv --python=python3 .venv
.venv/bin/pip install -U pip setuptools twine tox
.venv/bin/pip install -e '.[development]'
localdev: .venv
release: .venv
rm -rf dist/
.venv/bin/python setup.py sdist bdist_wheel
.venv/bin/twine upload dist/*
git tag -s "$(VERSION)" -m "v$(VERSION)"
test: .venv
.venv/bin/tox
autoformat: .venv
.venv/bin/isort --recursive tests/ git_fortune/ setup.py
.venv/bin/black tests/ git_fortune/ setup.py
clean:
rm -rf .venv
rm -rf dist
rm -rf build
rm -rf *.egg-info
find . -name '*.pyc' -delete