Makefile 4.1 KB

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