MC4EP cabinet core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.2KB

  1. .PHONY: clean clean-test clean-pyc clean-build docs help
  2. .DEFAULT_GOAL := help
  3. define BROWSER_PYSCRIPT
  4. import os, webbrowser, sys
  5. from urllib.request import pathname2url
  6. webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
  7. endef
  8. export BROWSER_PYSCRIPT
  9. define PRINT_HELP_PYSCRIPT
  10. import re, sys
  11. for line in sys.stdin:
  12. match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
  13. if match:
  14. target, help = match.groups()
  15. print("%-20s %s" % (target, help))
  16. endef
  17. export PRINT_HELP_PYSCRIPT
  18. BROWSER := python -c "$$BROWSER_PYSCRIPT"
  19. help:
  20. @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
  21. clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
  22. clean-build: ## remove build artifacts
  23. rm -fr build/
  24. rm -fr dist/
  25. rm -fr .eggs/
  26. find . -name '*.egg-info' -exec rm -fr {} +
  27. find . -name '*.egg' -exec rm -fr {} +
  28. clean-pyc: ## remove Python file artifacts
  29. find . -name '*.pyc' -exec rm -f {} +
  30. find . -name '*.pyo' -exec rm -f {} +
  31. find . -name '*~' -exec rm -f {} +
  32. find . -name '__pycache__' -exec rm -fr {} +
  33. clean-test: ## remove test and coverage artifacts
  34. rm -fr .tox/
  35. rm -f .coverage
  36. rm -fr htmlcov/
  37. rm -fr .pytest_cache
  38. rm -fr lavender/static
  39. lint: ## check style with flake8
  40. pylint lavender
  41. flake8 lavender tests
  42. test: ## run tests quickly with the default Python
  43. python setup.py test
  44. test-all: ## run tests on every Python version with tox
  45. tox
  46. coverage: ## check code coverage quickly with the default Python
  47. coverage run --source lavender_nidhoggr -m pytest
  48. coverage report -m
  49. coverage html
  50. $(BROWSER) htmlcov/index.html
  51. docs: ## generate Sphinx HTML documentation, including API docs
  52. rm -f docs/lavender_nidhoggr.rst
  53. rm -f docs/modules.rst
  54. sphinx-apidoc -o docs/generated lavender_nidhoggr
  55. $(MAKE) -C docs clean
  56. $(MAKE) -C docs html
  57. $(BROWSER) docs/_build/html/index.html
  58. servedocs: docs ## compile the docs watching for changes
  59. watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
  60. release: dist ## package and upload a release
  61. twine upload dist/*
  62. dist: clean ## builds source and wheel package
  63. python setup.py sdist
  64. python setup.py bdist_wheel
  65. ls -l dist
  66. install: clean ## install the package to the active Python's site-packages
  67. python setup.py install