Makefile 3.9 KB

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