Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. SPHINX2RST=sphinx2rst
  12. RST2HTML=rst2html.py
  13. DEVNULL=/dev/null
  14. TESTDIR=t
  15. SPHINX_DIR=docs/
  16. SPHINX_BUILDDIR="${SPHINX_DIR}/_build"
  17. README=README.rst
  18. README_SRC="docs/templates/readme.txt"
  19. CONTRIBUTING=CONTRIBUTING.rst
  20. CONTRIBUTING_SRC="docs/contributing.rst"
  21. SPHINX_HTMLDIR="${SPHINX_BUILDDIR}/html"
  22. DOCUMENTATION=Documentation
  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 " pep257check - Run pep257 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: clean-docs Documentation
  64. clean-docs:
  65. -rm -rf "$(SPHINX_BUILDDIR)" "$(DOCUMENTATION)"
  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. $(FLAKE8) "$(PROJ)" "$(TESTDIR)"
  73. pep257check:
  74. $(PYDOCSTYLE) "$(PROJ)"
  75. flakediag:
  76. -$(MAKE) flakecheck
  77. flakes: flakediag pep257check
  78. clean-readme:
  79. -rm -f $(README)
  80. readmecheck-unicode:
  81. $(ICONV) -f ascii -t ascii $(README) >/dev/null
  82. readmecheck-rst:
  83. -$(RST2HTML) $(README) >$(DEVNULL)
  84. readmecheck: readmecheck-unicode readmecheck-rst
  85. $(README):
  86. $(SPHINX2RST) "$(README_SRC)" --ascii > $@
  87. readme: clean-readme $(README) readmecheck
  88. clean-contrib:
  89. -rm -f "$(CONTRIBUTING)"
  90. $(CONTRIBUTING):
  91. $(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@
  92. contrib: clean-contrib $(CONTRIBUTING)
  93. clean-pyc:
  94. -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
  95. -find . -type d -name "__pycache__" | xargs rm -r
  96. removepyc: clean-pyc
  97. clean-build:
  98. rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/
  99. clean-git:
  100. $(GIT) clean -xdn
  101. clean-git-force:
  102. $(GIT) clean -xdf
  103. test-all: clean-pyc
  104. $(TOX)
  105. test:
  106. $(PYTHON) setup.py test
  107. cov:
  108. $(PYTEST) -x --cov="$(PROJ)" --cov-report=html
  109. build:
  110. $(PYTHON) setup.py sdist bdist_wheel
  111. distcheck: lint test clean
  112. dist: readme contrib clean-dist build
  113. $(WORKER_GRAPH):
  114. $(PYTHON) -m celery graph bootsteps | dot -Tpng -o $@
  115. clean-graph:
  116. -rm -f $(WORKER_GRAPH)
  117. graph: clean-graph $(WORKER_GRAPH)
  118. authorcheck:
  119. git shortlog -se | cut -f2 | extra/release/attribution.py