Add Makefile targets to bootstrap dev env
Run 'make' with no args to see a short description
of available targets.
Create a new env from scratch with:
make bootstrap
diff --git a/Makefile b/Makefile
index 312bd5e..cf50cb7 100644
--- a/Makefile
+++ b/Makefile
@@ -10,24 +10,49 @@
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-7s\033[0m %s\n", $$1, $$2}'
-clean: ## Remove build artifacts and .pyc files
- -rm -rf build dist MANIFEST colorama.egg-info
+
+# bootstrap environment
+
+virtualenv=~/.virtualenvs/colorama
+pip=$(virtualenv)/bin/pip
+syspython=python3.8
+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
-build: clean ## Build an sdist and wheel
- python setup.py sdist bdist_wheel
-.PHONY: sdist
+$(virtualenv):
+ $(syspython) -m venv --clear $(virtualenv)
-upload: ## Upload our sdist and wheel
- twine upload dist/*
-.PHONY: release
+venv: $(virtualenv) ## Create or clear a virtualenv
+.PHONY: venv
-test: ## Run tests
- python -m unittest discover -p *_test.py
-.PHONY: test
+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: clean ## Build an sdist and wheel
+ $(python) setup.py sdist bdist_wheel
+.PHONY: sdist
+
+upload: ## Upload our sdist and wheel
+ $(twine) upload dist/*
+.PHONY: release
+