forked from tartley/colorama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (45 loc) · 1.66 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
63
64
# 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.8
python=$(virtualenv)/bin/python
twine=$(virtualenv)/bin/twine
version=$(shell $(python) setup.py --version)
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 pip install --upgrade setuptools wheel
$(python) setup.py sdist bdist_wheel
.PHONY: build
test-release: build ## Test a built release
./test-release
.PHONY: test-release
release: ## Upload a built release
$(twine) upload dist/colorama-$(version)*{.whl,.tar.gz}
.PHONY: release