django-ddp/Makefile

57 lines
1.5 KiB
Makefile
Raw Permalink 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
2015-12-21 10:53:23 +00:00
all: .travis.yml.ok docs dist
2015-10-13 13:28:39 +00:00
test:
tox --skip-missing-interpreters -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 -rf "${SDIST}" "${WHEEL}" tests/build/ tests/meteor_todos/.meteor/local/
clean-pyc:
find . -type f -name \*.pyc -print0 | xargs -0 rm -f
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 --skip-missing-interpreters --notest --installpkg ${SDIST}
${WHEEL}: dist.intermediate
@echo "Testing ${WHEEL}..."
tox --skip-missing-interpreters --notest --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"
2015-12-21 10:53:23 +00:00
.travis.yml.ok: .travis.yml
@travis --version > "$@" || { echo 'Install travis command line client?'; exit 1; }
2015-12-21 11:03:19 +00:00
sha1sum "$<" >> "$@"
2015-12-21 10:53:23 +00:00
travis lint --exit-code | tee -a "$@"