Makefile 3.9 KB

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