layout | status | adr | title | deciders | date |
---|---|---|---|---|---|
page |
proposed |
0004 |
Isort Import Formatting |
Import ordering in Archivematica related projects is inconsistant and can be a distraction from actual content.
The import style described by PEP 8 is good, but not specific enough.
As with code formatting tools, automating import ordering simplifies developer decisions and code review.
- isort - the standard, widely used
- black - black is considering making import reodering an option, but it hasn't happend yet
isort, because it's well established. If black does add support, it may make sense to move to it.
- future
- stdlib
- third party
- artefactual libs (e.g metsrw)
- archivematicaCommon
- dashboard, mcpclient, mcpserver
For example:
from __future__ import unicode_literals
import os
from lxml import etree
from django import forms
from django.conf import settings
from countryCodes import getCodeForCountry
from main.models import Derivation, File, FPCommandOutput, RightsStatement