From 8deba2d7e301dea795faf83834d159b30bad6d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 1 Mar 2020 12:33:52 +0100 Subject: [PATCH] Fix flake8 errors and warnings We add the flake8 configuration used so we ensure everyone uses the same. We remove the usage of __all__ for non public API. When possible, we rationalize the class name according to its __name__ and module. issue9082 review297061002 --- .flake8 | 2 ++ carrier.py | 2 -- sale.py | 2 -- setup.py | 8 +++++--- stock.py | 2 -- tests/__init__.py | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000000..bb03d08a82 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore=E123,E124,E126,E128,W503 diff --git a/carrier.py b/carrier.py index 8cf58a34dc..971e4caf33 100644 --- a/carrier.py +++ b/carrier.py @@ -6,8 +6,6 @@ from trytond.transaction import Transaction from trytond.pool import Pool, PoolMeta from trytond.pyson import Eval -__all__ = ['Carrier'] - class Carrier(metaclass=PoolMeta): __name__ = 'carrier' diff --git a/sale.py b/sale.py index ae24546707..86bfd55903 100644 --- a/sale.py +++ b/sale.py @@ -4,8 +4,6 @@ from decimal import Decimal from trytond.pool import PoolMeta -__all__ = ['Sale'] - class Sale(metaclass=PoolMeta): __name__ = 'sale.sale' diff --git a/setup.py b/setup.py index c8e95080f8..c39c0d24f4 100755 --- a/setup.py +++ b/setup.py @@ -81,8 +81,9 @@ setup(name=name, keywords='tryton carrier percentage', package_dir={'trytond.modules.carrier_percentage': '.'}, packages=( - ['trytond.modules.carrier_percentage'] + - ['trytond.modules.carrier_percentage.%s' % p for p in find_packages()] + ['trytond.modules.carrier_percentage'] + + ['trytond.modules.carrier_percentage.%s' % p + for p in find_packages()] ), package_data={ 'trytond.modules.carrier_percentage': (info.get('xml', []) @@ -96,7 +97,8 @@ setup(name=name, 'Intended Audience :: Financial and Insurance Industry', 'Intended Audience :: Legal Industry', 'Intended Audience :: Manufacturing', - 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'License :: OSI Approved :: ' + 'GNU General Public License v3 or later (GPLv3+)', 'Natural Language :: Bulgarian', 'Natural Language :: Catalan', 'Natural Language :: Chinese (Simplified)', diff --git a/stock.py b/stock.py index 726cb772fa..a34fc91320 100644 --- a/stock.py +++ b/stock.py @@ -5,8 +5,6 @@ from decimal import Decimal from trytond.pool import Pool, PoolMeta from trytond.transaction import Transaction -__all__ = ['ShipmentIn', 'ShipmentOut'] - def _percentage_amount(lines, company): pool = Pool() diff --git a/tests/__init__.py b/tests/__init__.py index 937a0df1bb..25bae81353 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,7 +2,7 @@ # this repository contains the full copyright notices and license terms. try: - from trytond.modules.carrier_percentage.tests.test_carrier_percentage import suite + from trytond.modules.carrier_percentage.tests.test_carrier_percentage import suite # noqa: E501 except ImportError: from .test_carrier_percentage import suite