This is an API service to send emails and other information based on templates and double opt-ins from form submissions https://forms.fsfe.org
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.

Makefile 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # =============================================================================
  2. # Development helpers in the form of make targets
  3. # =============================================================================
  4. # This file is part of the FSFE Form Server.
  5. #
  6. # Copyright © 2017-2019 Free Software Foundation Europe <contact@fsfe.org>
  7. #
  8. # The FSFE Form Server is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by the Free
  10. # Software Foundation, either version 3 of the License, or (at your option) any
  11. # later version.
  12. #
  13. # The FSFE Form Server is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  16. # details <http://www.gnu.org/licenses/>.
  17. # =============================================================================
  18. SOURCE_DIR = fsfe_forms
  19. export FLASK_SKIP_DOTENV = 1
  20. export FLASK_APP = ${SOURCE_DIR}
  21. export FLASK_ENV = development
  22. export FLASK_RUN_HOST = localhost
  23. export FLASK_RUN_PORT = 8080
  24. .DEFAULT_GOAL := help
  25. GREEN = $(shell tput -Txterm setaf 2)
  26. WHITE = $(shell tput -Txterm setaf 7)
  27. YELLOW = $(shell tput -Txterm setaf 3)
  28. RESET = $(shell tput -Txterm sgr0)
  29. HELPME = \
  30. %help; \
  31. while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
  32. for (sort keys %help) { \
  33. print "${WHITE}$$_:${RESET}\n"; \
  34. for (@{$$help{$$_}}) { \
  35. $$sep = " " x (20 - length $$_->[0]); \
  36. print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
  37. }; \
  38. print "\n"; }
  39. help:
  40. @perl -e '$(HELPME)' $(MAKEFILE_LIST)
  41. .PHONY: help
  42. virtualenv: ##@development Set up the virtual environment with the Python dependencies.
  43. @pipenv install --dev
  44. .PHONY: virtualenv
  45. applyisort: ##@development Apply a correct Python import sort inline.
  46. @pipenv run isort
  47. .PHONY: applyisort
  48. flask: ##@development Run the Flask built-in web server.
  49. @pipenv run flask run
  50. .PHONY: flask
  51. gunicorn: ##@development Run the Gunicorn based web server.
  52. @. ./.env && pipenv run gunicorn --bind $$FLASK_RUN_HOST:$$FLASK_RUN_PORT "$$FLASK_APP:create_app()"
  53. .PHONY: gunicorn
  54. isort: ##@quality Check the Python source code for import sorting.
  55. @pipenv run isort --check-only --diff
  56. .PHONY: isort
  57. lint: ##@quality Check the Python source code for coding standards compliance.
  58. @pipenv run pylama
  59. .PHONY: lint
  60. pytest: ##@quality Run the functional tests.
  61. @pipenv run pytest --cov=$(SOURCE_DIR)
  62. @pipenv run coverage html
  63. .PHONY: pytest
  64. quality: isort lint pytest ##@quality Run all quality checks.
  65. .PHONY: quality