Makefile 1.4 KB

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