42 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2021-09-03 17:14:12 -04:00
REQUIREMENTS_TXT ?= requirements.txt requirements-dev.txt
.DEFAULT_GOAL := help
.PHONY: help dev test
2021-09-03 11:53:50 -04:00
include Makefile.venv
Makefile.venv:
curl \
-o Makefile.fetched \
-L "https://github.com/sio/Makefile.venv/raw/v2020.08.14/Makefile.venv"
echo "5afbcf51a82f629cd65ff23185acde90ebe4dec889ef80bbdc12562fbd0b2611 *Makefile.fetched" \
| sha256sum --check - \
&& mv Makefile.fetched Makefile.venv
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
help: # Help for the Makefile
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
dev: venv ## Create the virtualenv with all the requirements installed
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
docs: build
cp README.rst docs/readme.rst
cp Changelog docs/changelog.rst
tox -edocs
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
clean: clean-venv ## Clean out any build artifacts to start over
2021-09-03 11:53:50 -04:00
rm -rf dist/*
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
test: dev ## Run all the tox tests
2021-09-03 11:53:50 -04:00
tox -p all
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
build: test ## Make the build artifact prior to doing an upload
2021-09-03 11:53:50 -04:00
$(VENV)/python3 setup.py sdist bdist_wheel
$(VENV)/twine check dist/*
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
upload: build ## Upload a new version of the plugin
$(VENV)/twine upload dist/*
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
check: dev ## Code format check with tox and pep8
2021-09-03 11:53:50 -04:00
tox -epep8
2021-09-03 10:18:57 -04:00
2021-09-03 17:14:12 -04:00
fix: dev ## fixes code formatting with gray
2021-09-03 11:53:50 -04:00
tox -efmt