Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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_all:
  13. clean
  14. clean_docs
  15. clean_coverage_report
  16. clean: clean-build clean-pyc
  17. rm -f test.db
  18. rm -f pwman/tests/test.conf
  19. clean_docs:
  20. $(MAKE) -C docs clean
  21. clean_coverage_report:
  22. rm -rf htmlcov/
  23. clean-build:
  24. rm -fr build/
  25. rm -fr dist/
  26. rm -fr *.egg-info
  27. clean-pyc:
  28. find . -name '*.pyc' -exec rm -f {} +
  29. find . -name '*.pyo' -exec rm -f {} +
  30. find . -name '*~' -exec rm -f {} +
  31. lint:
  32. flake8 pwman scripts
  33. test: install clean
  34. git checkout pwman/tests/pwman.v0.0.8.db
  35. python setup.py test
  36. test-all:
  37. tox
  38. coverage-run:
  39. coverage run --source pwman setup.py test
  40. coverage report -m
  41. @coverage html
  42. coverage: coverage-run
  43. @rm test.db
  44. docs:
  45. #rm -f docs/manutils.rst
  46. #rm -f docs/modules.rst
  47. sphinx-apidoc -o docs/source/ pwman
  48. $(MAKE) -C docs clean
  49. $(MAKE) -C docs html
  50. open docs/_build/html/index.html
  51. release: clean
  52. python setup.py sdist upload
  53. python setup.py bdist_wheel upload
  54. dist: clean
  55. python setup.py sdist
  56. python setup.py bdist_wheel
  57. ls -l dist
  58. install:
  59. -pip uninstall -y pwman3
  60. python setup.py -q install