diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000000..e1c6495da9 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,3 @@ +[settings] +multi_line_output=4 +known_first_party=trytond diff --git a/proteus/__init__.py b/proteus/__init__.py index 403fea9066..7e41f4424b 100644 --- a/proteus/__init__.py +++ b/proteus/__init__.py @@ -3,9 +3,9 @@ ''' A library to access Tryton's models like a client. ''' -import threading import datetime import functools +import threading from decimal import Decimal import proteus.config diff --git a/proteus/config.py b/proteus/config.py index 1d9a523a23..81bee69a1e 100644 --- a/proteus/config.py +++ b/proteus/config.py @@ -10,8 +10,8 @@ import os import threading import urllib.parse import xmlrpc.client -from decimal import Decimal from contextlib import contextmanager +from decimal import Decimal __all__ = ['set_trytond', 'set_xmlrpc', 'get_config'] diff --git a/proteus/pyson.py b/proteus/pyson.py index 0b28b61ddf..a7cb0bb62d 100644 --- a/proteus/pyson.py +++ b/proteus/pyson.py @@ -1,11 +1,12 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -import json import datetime +import json from decimal import Decimal -from dateutil.relativedelta import relativedelta from functools import reduce +from dateutil.relativedelta import relativedelta + class PYSON(object): diff --git a/proteus/tests/__init__.py b/proteus/tests/__init__.py index 4918d37e9f..94c1daa2e2 100644 --- a/proteus/tests/__init__.py +++ b/proteus/tests/__init__.py @@ -1,9 +1,9 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. +import doctest import os import sys import unittest -import doctest import proteus import proteus.config diff --git a/proteus/tests/common.py b/proteus/tests/common.py index dcbcc24ec9..063b948c8b 100644 --- a/proteus/tests/common.py +++ b/proteus/tests/common.py @@ -2,9 +2,8 @@ # this repository contains the full copyright notices and license terms. from unittest import TestCase -from trytond.tests.test_tryton import db_exist, create_db - from proteus import config +from trytond.tests.test_tryton import create_db, db_exist class ProteusTestCase(TestCase): diff --git a/proteus/tests/test_config.py b/proteus/tests/test_config.py index 3841c860a4..50d576486b 100644 --- a/proteus/tests/test_config.py +++ b/proteus/tests/test_config.py @@ -1,6 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import proteus.config + from .common import ProteusTestCase diff --git a/proteus/tests/test_model.py b/proteus/tests/test_model.py index a60a801062..1a5188e3f3 100644 --- a/proteus/tests/test_model.py +++ b/proteus/tests/test_model.py @@ -1,6 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from proteus import Model + from .common import ProteusTestCase diff --git a/proteus/tests/test_report.py b/proteus/tests/test_report.py index 3df9fc5d87..edb89f1d6d 100644 --- a/proteus/tests/test_report.py +++ b/proteus/tests/test_report.py @@ -1,12 +1,14 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import unittest + try: import pydot except ImportError: pydot = None -from proteus import Report, Model +from proteus import Model, Report + from .common import ProteusTestCase diff --git a/proteus/tests/test_wizard.py b/proteus/tests/test_wizard.py index b36effcd62..3d1c9f7927 100644 --- a/proteus/tests/test_wizard.py +++ b/proteus/tests/test_wizard.py @@ -1,6 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from proteus import Wizard, Model +from proteus import Model, Wizard + from .common import ProteusTestCase diff --git a/setup.py b/setup.py index 94e82c2e1a..6cd34338c4 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,8 @@ import io import os import re -from setuptools import setup, find_packages + +from setuptools import find_packages, setup def read(fname):