Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .PHONY: clean-pyc clean-build docs clean test coverage coverage-run
  2. help:
  3. @echo "clean-build - remove build artifacts"
  4. @echo "clean-pyc - remove Python file artifacts"
  5. @echo "lint - check style with flake8"
  6. @echo "test - run tests quickly with the default Python"
  7. @echo "test-all - run tests on every Python version with tox"
  8. @echo "coverage - check code coverage quickly with the default Python"
  9. @echo "docs - generate Sphinx HTML documentation, including API docs"
  10. @echo "release - package and upload a release"
  11. @echo "dist - package"
  12. clean: clean-build clean-pyc
  13. rm -fr htmlcov/
  14. rm -f test.db
  15. rm -f pwman/tests/test-baseui.pwman.db
  16. clean-build:
  17. rm -fr build/
  18. rm -fr dist/
  19. rm -fr *.egg-info
  20. clean-pyc:
  21. find . -name '*.pyc' -exec rm -f {} +
  22. find . -name '*.pyo' -exec rm -f {} +
  23. find . -name '*~' -exec rm -f {} +
  24. lint:
  25. flake8 pwman scripts
  26. test: install clean
  27. git checkout pwman/tests/pwman.v0.0.8.db
  28. python setup.py test
  29. test-all:
  30. tox
  31. coverage-run:
  32. coverage run --source pwman setup.py test
  33. coverage report -m
  34. @coverage html
  35. coverage: coverage-run
  36. @rm test.db
  37. docs:
  38. #rm -f docs/manutils.rst
  39. #rm -f docs/modules.rst
  40. sphinx-apidoc -o docs/source/ pwman
  41. $(MAKE) -C docs clean
  42. $(MAKE) -C docs html
  43. open docs/_build/html/index.html
  44. release: clean
  45. python setup.py sdist upload
  46. python setup.py bdist_wheel upload
  47. dist: clean
  48. python setup.py sdist
  49. python setup.py bdist_wheel
  50. ls -l dist
  51. install:
  52. pip uninstall -y pwman3
  53. python setup.py -q install