Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. $(FLAKE8) "$(PROJ)"
  57. flakediag:
  58. -$(MAKE) flakecheck
  59. flakepluscheck:
  60. $(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)"
  61. flakeplusdiag:
  62. -$(MAKE) flakepluscheck
  63. flakes: flakediag flakeplusdiag
  64. clean-readme:
  65. -rm -f $(README)
  66. readmecheck:
  67. $(ICONV) -f ascii -t ascii $(README) >/dev/null
  68. $(README):
  69. $(SPHINX2RST) "$(README_SRC)" --ascii > $@
  70. readme: clean-readme $(README) readmecheck
  71. clean-contrib:
  72. -rm -f "$(CONTRIBUTING)"
  73. $(CONTRIBUTING):
  74. $(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@
  75. contrib: clean-contrib $(CONTRIBUTING)
  76. clean-pyc:
  77. -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
  78. -find . -type d -name "__pycache__" | xargs rm -r
  79. removepyc: clean-pyc
  80. clean-build:
  81. rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/
  82. clean-git:
  83. $(GIT) clean -xdn
  84. clean-git-force:
  85. $(GIT) clean -xdf
  86. test-all: clean-pyc
  87. $(TOX)
  88. test:
  89. $(PYTHON) setup.py test
  90. cov:
  91. $(NOSETESTS) -xv --with-coverage --cover-html --cover-branch
  92. build:
  93. $(PYTHON) setup.py sdist bdist_wheel
  94. distcheck: lint test clean
  95. dist: readme contrib clean-dist build
  96. $(WORKER_GRAPH):
  97. $(PYTHON) -m celery graph bootsteps | dot -Tpng -o $@
  98. clean-graph:
  99. -rm -f $(WORKER_GRAPH)
  100. graph: clean-graph $(WORKER_GRAPH)
  101. authorcheck:
  102. git shortlog -se | cut -f2 | extra/release/attribution.py