Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .PHONY: clean-pyc clean-build docs clean
  2. TEST_FLAGS=--verbosity=2
  3. COVER_FLAGS=--source=rest_framework_bulk
  4. help:
  5. @echo "install - install all requirements including for testing"
  6. @echo "install-quite - same as install but pipes all output to /dev/null"
  7. @echo "clean - remove all artifacts"
  8. @echo "clean-build - remove build artifacts"
  9. @echo "clean-pyc - remove Python file artifacts"
  10. @echo "clean-test - remove test and coverage artifacts"
  11. @echo "clean-test-all - remove all test-related artifacts including tox"
  12. @echo "lint - check style with flake8"
  13. @echo "test - run tests quickly with the default Python"
  14. @echo "test-coverage - run tests with coverage report"
  15. @echo "test-all - run tests on every Python version with tox"
  16. @echo "check - run all necessary steps to check validity of project"
  17. @echo "release - package and upload a release"
  18. @echo "dist - package"
  19. install:
  20. pip install -r requirements-dev.txt
  21. install-quite:
  22. pip install -r requirements-dev.txt > /dev/null
  23. clean: clean-build clean-pyc clean-test-all
  24. clean-build:
  25. @rm -rf build/
  26. @rm -rf dist/
  27. @rm -rf *.egg-info
  28. clean-pyc:
  29. -@find . -name '*.pyc' -follow -print0 | xargs -0 rm -f
  30. -@find . -name '*.pyo' -follow -print0 | xargs -0 rm -f
  31. -@find . -name '__pycache__' -type d -follow -print0 | xargs -0 rm -rf
  32. clean-test:
  33. rm -rf .coverage coverage*
  34. rm -rf tests/.coverage test/coverage*
  35. rm -rf htmlcov/
  36. clean-test-all: clean-test
  37. rm -rf .tox/
  38. lint:
  39. flake8 rest_framework_bulk
  40. test:
  41. python tests/manage.py test ${TEST_FLAGS}
  42. test-coverage: clean-test
  43. -coverage run ${COVER_FLAGS} tests/manage.py test ${TEST_FLAGS}
  44. @exit_code=$?
  45. @-coverage report
  46. @-coverage html
  47. @exit ${exit_code}
  48. test-all:
  49. tox
  50. check: clean-build clean-pyc clean-test lint test
  51. release: clean
  52. python setup.py sdist upload
  53. dist: clean
  54. python setup.py sdist
  55. ls -l dist