Makefile 1.5 KB

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