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
DO
class Owners(Base):
__tablename__ = "Owners"
owner_id = Column("OwnerID", Integer, primary_key=True, autoincrement=True)
creation_time = DateNowColumn("CreationTime")
name = Column("Name", String(255))
DONT
class Owners(Base):
__tablename__ = "Owners"
OwnerID = Column(Integer, primary_key=True, autoincrement=True)
CreationTime = DateNowColumn()
Name = Column(String(255))
(#268)
__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