FastAPI is mostly uvicorn+starlette. As such, the documentation is spread over multiple places. Also, pydantic parsing of arguments is a pain to work with. Since we don't need powerful performance, we switch to Quart. Quart is preferred over Flask because of its async capabilities, which we need for log streaming in websockets. In progress: execute tutor commands and stream logs.
38 lines
1.3 KiB
Makefile
38 lines
1.3 KiB
Makefile
.DEFAULT_GOAL := help
|
||
.PHONY: docs
|
||
SRC_DIRS = ./tutordash
|
||
BLACK_OPTS = --exclude templates ${SRC_DIRS}
|
||
|
||
runserver: ## Run a development server
|
||
tutor dash run --dev
|
||
|
||
scss: ## Compile SCSS files
|
||
sass ${SASS_OPTS} tutordash/server/static/scss/:tutordash/server/static/css/
|
||
|
||
scss-watch: ## Compile SCSS files and watch for changes
|
||
$(MAKE) scss SASS_OPTS="--watch"
|
||
|
||
# Warning: These checks are not necessarily run on every PR.
|
||
test: test-lint test-types test-format # Run some static checks.
|
||
|
||
test-format: ## Run code formatting tests
|
||
black --check --diff $(BLACK_OPTS)
|
||
|
||
test-lint: ## Run code linting tests
|
||
pylint --errors-only --enable=unused-import,unused-argument --ignore=templates --ignore=docs/_ext ${SRC_DIRS}
|
||
|
||
test-types: ## Run type checks.
|
||
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}
|
||
|
||
format: ## Format code automatically
|
||
black $(BLACK_OPTS)
|
||
|
||
isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes.
|
||
isort --skip=templates ${SRC_DIRS}
|
||
|
||
ESCAPE =
|
||
help: ## Print this help
|
||
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \
|
||
| sed 's/######* \(.*\)/@ $(ESCAPE)[1;31m\1$(ESCAPE)[0m/g' | tr '@' '\n' \
|
||
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'
|