Opinionated decisions
TODO:
DO
import pytest
@pytest.fixture
def my_ficture():
...
DONT
from pytest import fixture
@fixture
def my_ficture():
...
DO
from datetime import datetime, timedelta
delay = datetime.now() + timedelta(hours=1)
DONT
import datetime
delay = datetime.datetime.now() + datetime.timedelta(hours=1)
ALWAYS DO
from __future__ import annotations
__init__.py
should not contain code, but__all__
- at a package level (router for example) we have one file per system (configuration.py for example)
- If we need more files (think of jobs, which have the sandbox, the joblogging, etc), we put them in a sub module (e.g routers.job). The code goes in a specific file (job.py, joblogging.py) but we use the the init.py to expose the specific file