Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. 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 clean
  26. git checkout pwman/tests/pwman.v0.0.8.db
  27. python setup.py test
  28. test-all:
  29. tox
  30. coverage-run:
  31. coverage run --source pwman setup.py test
  32. coverage report -m
  33. @coverage html
  34. coverage: coverage-run
  35. @rm test.db
  36. docs:
  37. #rm -f docs/manutils.rst
  38. #rm -f docs/modules.rst
  39. sphinx-apidoc -o docs/ pwman
  40. $(MAKE) -C docs clean
  41. $(MAKE) -C docs html
  42. open docs/_build/html/index.html
  43. release: clean
  44. python setup.py sdist upload
  45. python setup.py bdist_wheel upload
  46. dist: clean
  47. python setup.py sdist
  48. python setup.py bdist_wheel
  49. ls -l dist
  50. install:
  51. pip uninstall -y pwman3
  52. python setup.py -q install