Makefile 1.7 KB

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