alembic revision -m "Desc"
alembic upgrade head
poetry shell
poetry add fastapi
poetry add pytest --dev
poetry install
poetry install --no-dev
poetry update
poetry run
peotry remove fastapi
poetry remove pytest --no-dev
poetry [command] -vvv
Automatically activates virtual environments created by Poetry when changing to a project directory with a valid pyproject.toml
It's better to specify version of package to install to prevent to speedup resolving dependencies
poetry add package_name==1.18
instead of
poetry add package_name
or you can use these commands
PACKAGE=mypy && poetry add $PACKAGE=`poetry add $PACKAGE --dry-run 2>/dev/null | head -n1 | awk '{print substr($3, 2)}'`
poetry run pre-commit run --all-files
or
pre-commit run --all-files
- pre-commit-hooks checks structures of files like toml, ast, and ...
- reorder python imports Reorder python imports to reduct merge conflict
- pycln A formatter for finding and removing unused import statements
- pyupgrade
Upgrade python syntax. for example change
dict()
to{}
- black Code formatter
- mypy Checks types
- pylint Code analyzer
- bandit Security analyzer
Write your fixtures in conftest.py
and your helper functions in utils.py
poetry run python -s -m pytest tests -o log_cli=true
You can skip using docker with --docker false
poetry run python -s -m pytest tests --docker false -o log_cli=true
To set environment for production you can use export ENV_FOR_DYNACONF=production