Helpers¶
create_service¶
Create new service following the structure as described in the fastapi_serviceutils documentation. Using Cookiecutter to create the new folder.
usage: create_service [-h] -n SERVICE_NAME -p SERVICE_PORT -a AUTHOR -e
AUTHOR_EMAIL -ep ENDPOINT -o OUTPUT_DIR
create new service based on fastapi using fastapi_serviceutils.
optional arguments:
-h, --help show this help message and exit
-n SERVICE_NAME, --service_name SERVICE_NAME
the name of the service to create. ATTENTION: only
ascii-letters, "_" and digits are allowed. Must not
start with a digit!
-p SERVICE_PORT, --service_port SERVICE_PORT
the port for the service to listen.
-a AUTHOR, --author AUTHOR
the name of the author of the service.
-e AUTHOR_EMAIL, --author_email AUTHOR_EMAIL
the email of the author of the service.
-ep ENDPOINT, --endpoint ENDPOINT
the name of the endpoint for the service to create.
ATTENTION: only lower ascii-letters, "_" and digits
are allowed. Must not start with a digit!
-o OUTPUT_DIR, --output_dir OUTPUT_DIR
Makefile¶
Usual tasks during development are wrapped inside the Makefile. This contains updating of the environment, creation of the docs, etc.
Helpers for development of fastapi_serviceutils.
Usage:
make <target> [flags...]
Targets:
check Run all checks defined in .pre-commit-config.yaml.
clean Clean the working directory from temporary files and caches.
doc Create sphinx documentation for the project.
docs Create sphinx documentation for the project.
finalize Finalize the main env.
help Show the help prompt.
info Show info about current project.
init Initialize project
tests Run tests using pytest.
update Update environments based on pyproject.toml definitions.
Flags:
Note:
This workflow requires the following programs / tools to be installed:
- poetry
- dephell
- pyenv
tmuxp¶
For a predefined development environment the .tmuxp.yml
configuration can
be used to create a Tmux-session (using Tmuxp) with a window including three
panels:
one panel for editing files
one panel running the service
one panel running the tests
Run the following command to create the tmux-session:
tmuxp load .