Makefile 1.3 KB

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