Makefile 4.0 KB

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