Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .PHONY: clean install help test lint isort run dependencies docs wheel upload
  2. .DEFAULT_GOAL := help
  3. help: ## Displays this help message.
  4. @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
  5. dependencies:requirements.txt
  6. @echo "Installing dependencies..."
  7. @pip install -r requirements.txt 1>/dev/null
  8. clean: ## Remove unwanted stuff such as __pycache__, etc...
  9. find . -name '*.pyc' -exec rm -f {} +
  10. find . -name '*.pyo' -exec rm -f {} +
  11. find . -name '*~' -exec rm -f {} +
  12. find . -name '__pycache__' -exec rm -rf {} +
  13. test: ## Runs the testsuite
  14. tox
  15. run: ## Runs the development server with the development config
  16. flaskbb run --debugger --reload
  17. frontend: ## Runs the webpack server which watches for changes in flaskbb/themes/aurora
  18. cd flaskbb/themes/aurora && npm run watch
  19. devconfig:dependencies ## Generates a development config
  20. flaskbb makeconfig -d
  21. install:dependencies ## Installs the dependencies and FlaskBB
  22. @[ -f ./flaskbb.cfg ] || (echo "flaskbb.cfg not found. You can generate a configuration file with 'flaskbb makeconfig'."; exit 1)
  23. flaskbb --config ./flaskbb.cfg install
  24. docs: ## Builds the Sphinx docs
  25. $(MAKE) -C docs html
  26. lint: ## Checks the source for style errors
  27. @type flake8 >/dev/null 2>&1 || echo "Flake8 is not installed. You can install it with 'pip install flake8'."
  28. flake8
  29. isort: ## Sorts the python imports
  30. @type isort >/dev/null 2>&1 || echo "isort is not installed. You can install it with 'pip install isort'."
  31. isort --order-by-type -rc -up
  32. dist: ## Creates distribution packages (bdist_wheel, sdist)
  33. python setup.py sdist bdist_wheel
  34. upload:dist ## Uploads a new version of FlaskBB to PyPI
  35. twine upload --skip-existing dist/*