| 1 |
PROJ=kombu |
| 2 |
PGPIDENT="Celery Security Team" |
| 3 |
PYTHON=python |
| 4 |
PYTEST=py.test |
| 5 |
GIT=git |
| 6 |
TOX=tox |
| 7 |
ICONV=iconv |
| 8 |
PYDOCSTYLE=pydocstyle |
| 9 |
FLAKE8=flake8 |
| 10 |
FLAKEPLUS=flakeplus |
| 11 |
SPHINX2RST=sphinx2rst |
| 12 |
|
| 13 |
TESTDIR=t |
| 14 |
SPHINX_DIR=docs/ |
| 15 |
SPHINX_BUILDDIR="${SPHINX_DIR}/_build" |
| 16 |
README=README.rst |
| 17 |
README_SRC="docs/templates/readme.txt" |
| 18 |
CONTRIBUTING=CONTRIBUTING.rst |
| 19 |
CONTRIBUTING_SRC="docs/contributing.rst" |
| 20 |
SPHINX_HTMLDIR="${SPHINX_BUILDDIR}/html" |
| 21 |
DOCUMENTATION=Documentation |
| 22 |
FLAKEPLUSTARGET=2.7 |
| 23 |
|
| 24 |
all: help |
| 25 |
|
| 26 |
help: |
| 27 |
@echo "docs - Build documentation." |
| 28 |
@echo "test-all - Run tests for all supported python versions." |
| 29 |
@echo "distcheck ---------- - Check distribution for problems." |
| 30 |
@echo " test - Run unittests using current python." |
| 31 |
@echo " lint ------------ - Check codebase for problems." |
| 32 |
@echo " apicheck - Check API reference coverage." |
| 33 |
@echo " configcheck - Check configuration reference coverage." |
| 34 |
@echo " readmecheck - Check README.rst encoding." |
| 35 |
@echo " contribcheck - Check CONTRIBUTING.rst encoding" |
| 36 |
@echo " flakes -------- - Check code for syntax and style errors." |
| 37 |
@echo " flakecheck - Run flake8 on the source code." |
| 38 |
@echo " flakepluscheck - Run flakeplus on the source code." |
| 39 |
@echo " pep257check - Run pep257 on the source code." |
| 40 |
@echo "readme - Regenerate README.rst file." |
| 41 |
@echo "contrib - Regenerate CONTRIBUTING.rst file" |
| 42 |
@echo "clean-dist --------- - Clean all distribution build artifacts." |
| 43 |
@echo " clean-git-force - Remove all uncommitted files." |
| 44 |
@echo " clean ------------ - Non-destructive clean" |
| 45 |
@echo " clean-pyc - Remove .pyc/__pycache__ files" |
| 46 |
@echo " clean-docs - Remove documentation build artifacts." |
| 47 |
@echo " clean-build - Remove setup artifacts." |
| 48 |
@echo "bump - Bump patch version number." |
| 49 |
@echo "bump-minor - Bump minor version number." |
| 50 |
@echo "bump-major - Bump major version number." |
| 51 |
@echo "release - Make PyPI release." |
| 52 |
|
| 53 |
clean: clean-docs clean-pyc clean-build |
| 54 |
|
| 55 |
clean-dist: clean clean-git-force |
| 56 |
|
| 57 |
bump: |
| 58 |
bumpversion patch |
| 59 |
|
| 60 |
bump-minor: |
| 61 |
bumpversion minor |
| 62 |
|
| 63 |
bump-major: |
| 64 |
bumpversion major |
| 65 |
|
| 66 |
release: |
| 67 |
python setup.py register sdist bdist_wheel upload --sign --identity="$(PGPIDENT)" |
| 68 |
|
| 69 |
build-docs: |
| 70 |
(cd "$(SPHINX_DIR)"; $(MAKE) html) |
| 71 |
|
| 72 |
Documentation: |
| 73 |
ln -sf "$(SPHINX_HTMLDIR)" $@ |
| 74 |
|
| 75 |
docs: build-docs Documentation |
| 76 |
|
| 77 |
clean-docs: |
| 78 |
-rm -rf "$(SPHINX_BUILDDIR)" |
| 79 |
|
| 80 |
lint: flakecheck apicheck configcheck readmecheck |
| 81 |
|
| 82 |
apicheck: |
| 83 |
(cd "$(SPHINX_DIR)"; $(MAKE) apicheck) |
| 84 |
|
| 85 |
configcheck: |
| 86 |
(cd "$(SPHINX_DIR)"; $(MAKE) configcheck) |
| 87 |
|
| 88 |
flakecheck: |
| 89 |
$(FLAKE8) "$(PROJ)" "$(TESTDIR)" |
| 90 |
|
| 91 |
flakediag: |
| 92 |
-$(MAKE) flakecheck |
| 93 |
|
| 94 |
flakepluscheck: |
| 95 |
$(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)" "$(TESTDIR)" |
| 96 |
|
| 97 |
flakeplusdiag: |
| 98 |
-$(MAKE) flakepluscheck |
| 99 |
|
| 100 |
pep257check: |
| 101 |
$(PYDOCSTYLE) "$(PROJ)" |
| 102 |
|
| 103 |
flakes: flakediag flakeplusdiag pep257check |
| 104 |
|
| 105 |
clean-readme: |
| 106 |
-rm -f $(README) |
| 107 |
|
| 108 |
readmecheck: |
| 109 |
$(ICONV) -f ascii -t ascii $(README) >/dev/null |
| 110 |
|
| 111 |
$(README): |
| 112 |
$(SPHINX2RST) "$(README_SRC)" --ascii > $@ |
| 113 |
|
| 114 |
readme: clean-readme $(README) readmecheck |
| 115 |
|
| 116 |
clean-contrib: |
| 117 |
-rm -f "$(CONTRIBUTING)" |
| 118 |
|
| 119 |
$(CONTRIBUTING): |
| 120 |
$(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@ |
| 121 |
|
| 122 |
contrib: clean-contrib $(CONTRIBUTING) |
| 123 |
|
| 124 |
clean-pyc: |
| 125 |
-find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm |
| 126 |
-find . -type d -name "__pycache__" | xargs rm -r |
| 127 |
|
| 128 |
removepyc: clean-pyc |
| 129 |
|
| 130 |
clean-build: |
| 131 |
rm -rf build/ dist/ .eggs/ *.egg-info/ .coverage cover/ |
| 132 |
|
| 133 |
clean-git: |
| 134 |
$(GIT) clean -xdn |
| 135 |
|
| 136 |
clean-git-force: |
| 137 |
$(GIT) clean -xdf |
| 138 |
|
| 139 |
test-all: clean-pyc |
| 140 |
$(TOX) |
| 141 |
|
| 142 |
test: |
| 143 |
$(PYTHON) setup.py test |
| 144 |
|
| 145 |
cov: |
| 146 |
$(PYTEST) -x --cov=kombu --cov-report=html |
| 147 |
|
| 148 |
build: |
| 149 |
$(PYTHON) setup.py sdist bdist_wheel |
| 150 |
|
| 151 |
distcheck: lint test clean |
| 152 |
|
| 153 |
dist: readme contrib clean-dist build |