Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. pre-test:
  33. $(shell sudo service postgresql-9.4 start)
  34. $(shell sudo service mysql start)
  35. $(shell sudo service mongodb start)
  36. test: install clean
  37. python setup.py test
  38. @rm -f tests/test.conf
  39. test-all:
  40. tox
  41. coverage-run:
  42. coverage run --source pwman setup.py test
  43. coverage report -m
  44. @coverage html
  45. coverage: coverage-run
  46. docs:
  47. #rm -f docs/manutils.rst
  48. #rm -f docs/modules.rst
  49. sphinx-apidoc -o docs/source/ pwman
  50. $(MAKE) -C docs clean
  51. $(MAKE) -C docs html
  52. xdg-open docs/build/html/index.html
  53. release: clean
  54. python setup.py sdist
  55. twine upload --skip-existing dist/*
  56. dist: clean
  57. python setup.py sdist
  58. python setup.py bdist_wheel
  59. ls -l dist
  60. install:
  61. pip uninstall -y pwman3
  62. pip install -e .