-
-
Notifications
You must be signed in to change notification settings - Fork 253
/
Makefile
62 lines (43 loc) · 1.54 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
57
58
59
60
61
62
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE.txt file.
# This makefile is just a cheatsheet to remind me of some commonly used
# commands. I generally am executing these commands on Ubuntu, or on WindowsXP
# with Cygwin binaries at the start of the PATH.
NAME=colorama
help: ## Display help for documented make targets.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-7s\033[0m %s\n", $$1, $$2}'
# bootstrap environment
virtualenv=~/.virtualenvs/colorama
pip=$(virtualenv)/bin/pip
syspython=python3
python=$(virtualenv)/bin/python
twine=$(virtualenv)/bin/twine
clean: ## Remove build artifacts, .pyc files, virtualenv
-rm -rf build dist MANIFEST colorama.egg-info $(virtualenv)
-find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
.PHONY: clean
$(virtualenv):
$(syspython) -m venv --clear $(virtualenv)
$(pip) install --upgrade pip
venv: $(virtualenv) ## Create or clear a virtualenv
.PHONY: venv
bootstrap: venv ## Populate the virtualenv
$(pip) install -r requirements.txt -r requirements-dev.txt
.PHONY: bootstrap
# development
tags: ## Create tags file
ctags -R ${NAME}
.PHONY: tags
test: ## Run tests
$(python) -m unittest discover -p *_test.py
.PHONY: test
# build packages
build: ## Build a release (sdist and wheel)
$(python) -m build
.PHONY: build
test-release: build ## Test a built release
./test-release
.PHONY: test-release
release: ## Upload a built release
$(twine) upload --repository=colorama dist/colorama-*
.PHONY: release