django-ddp/Makefile

55 lines
1.3 KiB
Makefile
Raw Normal View History

2015-10-13 13:28:39 +00:00
NAME := $(shell python setup.py --name)
VERSION := $(shell python setup.py --version)
SDIST := dist/${NAME}-${VERSION}.tar.gz
WHEEL := dist/$(subst -,_,${NAME})-${VERSION}-py2.py3-none-any.whl
2015-10-13 13:28:39 +00:00
.PHONY: all test clean clean-docs clean-dist upload-docs upload-pypi dist
.INTERMEDIATE: dist.intermediate docs
2015-10-13 13:28:39 +00:00
all: .travis.yml docs dist
2015-10-13 13:28:39 +00:00
test:
tox -vvv
2015-10-13 13:28:39 +00:00
clean: clean-docs clean-dist clean-pyc
2015-10-13 13:28:39 +00:00
clean-docs:
$(MAKE) -C docs/ clean
clean-dist:
rm -f "${SDIST}" "${WHEEL}"
clean-pyc:
find . -type f -name \*.pyc -print0 | xargs -0 rm
2015-10-13 13:28:39 +00:00
docs: $(shell find docs/ -type f -name \*.rst) docs/conf.py docs/Makefile $(shell find docs/_static/ -type f) $(shell find docs/_templates/ -type f) README.rst CHANGES.rst
2015-10-13 13:28:39 +00:00
$(MAKE) -C docs/ clean html
touch "$@"
dist: ${SDIST} ${WHEEL}
@echo 'Build successful, `${MAKE} upload` when ready to release.'
${SDIST}: dist.intermediate
@echo "Testing ${SDIST}..."
tox --installpkg ${SDIST}
${WHEEL}: dist.intermediate
@echo "Testing ${WHEEL}..."
tox --installpkg ${WHEEL}
2015-10-13 13:28:39 +00:00
dist.intermediate: $(shell find dddp -type f)
tox -e dist
2015-10-13 13:28:39 +00:00
upload: upload-pypi upload-docs
upload-pypi: ${SDIST} ${WHEEL}
twine upload "${WHEEL}" "${SDIST}"
2015-10-13 13:28:39 +00:00
upload-docs: docs/_build/
python setup.py upload_sphinx --upload-dir="$<html"
.travis.yml: tox.ini .travis.yml.sh
sh .travis.yml.sh > "$@"