Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .PHONY: clean install help test lint isort run dependencies docs
  2. help:
  3. @echo " clean remove unwanted stuff"
  4. @echo " install install dependencies and flaskbb"
  5. @echo " devconfig generates a development config"
  6. @echo " test run the testsuite"
  7. @echo " lint check the source for style errors"
  8. @echo " isort sort the python imports"
  9. @echo " run run the development server with the development config"
  10. @echo " docs build the documentation"
  11. dependencies:requirements.txt
  12. @echo "Installing dependencies..."
  13. @pip install -r requirements.txt 1>/dev/null
  14. clean:
  15. find . -name '*.pyc' -exec rm -f {} +
  16. find . -name '*.pyo' -exec rm -f {} +
  17. find . -name '*~' -exec rm -f {} +
  18. find . -name '__pycache__' -exec rm -rf {} +
  19. test:
  20. py.test
  21. run:
  22. flaskbb run --debugger --reload
  23. devconfig:dependencies
  24. flaskbb makeconfig -d
  25. install:dependencies
  26. @[ -f ./flaskbb.cfg ] || (echo "flaskbb.cfg not found. You can generate a configuration file with 'flaskbb makeconfig'."; exit 1)
  27. flaskbb --config ./flaskbb.cfg install
  28. docs:
  29. $(MAKE) -C docs html
  30. lint:check-flake8
  31. flake8
  32. check-flake8:
  33. @type flake8 >/dev/null 2>&1 || echo "Flake8 is not installed. You can install it with 'pip install flake8'."
  34. isort:check-isort
  35. isort --order-by-type -rc -up
  36. check-isort:
  37. @type isort >/dev/null 2>&1 || echo "isort is not installed. You can install it with 'pip install isort'."