Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. PROJ=celery
  2. PYTHON=python
  3. GIT=git
  4. TOX=tox
  5. NOSETESTS=nosetests
  6. ICONV=iconv
  7. FLAKE8=flake8
  8. FLAKEPLUS=flakeplus
  9. SPHINX2RST=sphinx2rst
  10. SPHINX_DIR=docs/
  11. SPHINX_BUILDDIR="${SPHINX_DIR}/_build"
  12. README=README.rst
  13. README_SRC="docs/templates/readme.txt"
  14. CONTRIBUTING=CONTRIBUTING.rst
  15. CONTRIBUTING_SRC="docs/contributing.rst"
  16. SPHINX_HTMLDIR="${SPHINX_BUILDDIR}/html"
  17. DOCUMENTATION=Documentation
  18. FLAKEPLUSTARGET=2.7
  19. WORKER_GRAPH="docs/images/worker_graph_full.png"
  20. all: help
  21. help:
  22. @echo "docs - Build documentation."
  23. @echo "test-all - Run tests for all supported python versions."
  24. @echo "distcheck ---------- - Check distribution for problems."
  25. @echo " test - Run unittests using current python."
  26. @echo " lint ------------ - Check codebase for problems."
  27. @echo " apicheck - Check API reference coverage."
  28. @echo " configcheck - Check configuration reference coverage."
  29. @echo " readmecheck - Check README.rst encoding."
  30. @echo " contribcheck - Check CONTRIBUTING.rst encoding"
  31. @echo " flakes -------- - Check code for syntax and style errors."
  32. @echo " flakecheck - Run flake8 on the source code."
  33. @echo " flakepluscheck - Run flakeplus on the source code."
  34. @echo "readme - Regenerate README.rst file."
  35. @echo "contrib - Regenerate CONTRIBUTING.rst file"
  36. @echo "clean-dist --------- - Clean all distribution build artifacts."
  37. @echo " clean-git-force - Remove all uncomitted files."
  38. @echo " clean ------------ - Non-destructive clean"
  39. @echo " clean-pyc - Remove .pyc/__pycache__ files"
  40. @echo " clean-docs - Remove documentation build artifacts."
  41. @echo " clean-build - Remove setup artifacts."
  42. clean: clean-docs clean-pyc clean-build
  43. clean-dist: clean clean-git-force
  44. Documentation:
  45. (cd "$(SPHINX_DIR)"; $(MAKE) html)
  46. mv "$(SPHINX_HTMLDIR)" $(DOCUMENTATION)
  47. docs: Documentation
  48. clean-docs:
  49. -rm -rf "$(SPHINX_BUILDDIR)"
  50. lint: flakecheck apicheck configcheck readmecheck
  51. apicheck:
  52. (cd "$(SPHINX_DIR)"; $(MAKE) apicheck)
  53. configcheck:
  54. (cd "$(SPHINX_DIR)"; $(MAKE) configcheck)
  55. flakecheck:
  56. # the only way to enable all-1 errors is to ignore one of them.
  57. $(FLAKE8) --ignore=W503 "$(PROJ)"
  58. flakediag:
  59. -$(MAKE) flakecheck
  60. flakepluscheck:
  61. $(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)"
  62. flakeplusdiag:
  63. -$(MAKE) flakepluscheck
  64. flakes: flakediag flakeplusdiag
  65. clean-readme:
  66. -rm -f $(README)
  67. readmecheck:
  68. $(ICONV) -f ascii -t ascii $(README) >/dev/null
  69. $(README):
  70. $(SPHINX2RST) "$(README_SRC)" --ascii > $@
  71. readme: clean-readme $(README) readmecheck
  72. clean-contrib:
  73. -rm -f "$(CONTRIBUTING)"
  74. $(CONTRIBUTING):
  75. $(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@
  76. contrib: clean-contrib $(CONTRIBUTING)
  77. clean-pyc:
  78. -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
  79. -find . -type d -name "__pycache__" | xargs rm -r
  80. removepyc: clean-pyc
  81. clean-build:
  82. rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/
  83. clean-git:
  84. $(GIT) clean -xdn
  85. clean-git-force:
  86. $(GIT) clean -xdf
  87. test-all: clean-pyc
  88. $(TOX)
  89. test:
  90. $(PYTHON) setup.py test
  91. cov:
  92. $(NOSETESTS) -xv --with-coverage --cover-html --cover-branch
  93. build:
  94. $(PYTHON) setup.py sdist bdist_wheel
  95. distcheck: lint test clean
  96. dist: readme contrib clean-dist build
  97. $(WORKER_GRAPH):
  98. $(PYTHON) -m celery graph bootsteps | dot -Tpng -o $@
  99. clean-graph:
  100. -rm -f $(WORKER_GRAPH)
  101. graph: clean-graph $(WORKER_GRAPH)
  102. authorcheck:
  103. git shortlog -se | cut -f2 | extra/release/attribution.py