Useful Commands
How to create invoke commands
Add a method to tasks.py. All underscores in the method name will be transformed into hyphens (hello_world → hello-world).
To execute something in the terminal use the context c that is passed as an argument to the method.
With c.run a command can be executed.
The method ‘your_new_command’ can be executed via the terminal with:
poetry run invoke [your-new-command]
How to create flask commands
Add a method to qunicorn_core.db.cli.py with the annotation @DB_CLI.command([your-command]).
This method can be executed via the terminal, with the command
flask [your-command]
How to add a dependency to poetry
poetry add [dependency-name]
poetry run invoke update-dependencies
The first command will automatically install the dependency and add it to pyproject.toml and poetry.lock.
Both need to be pushed to git.
The second command updates the list of licenses and the requirements file used by ReadTheDocs.
The changes made by the second command also need to be pushed to git.