From 1ce3072489e89b5e7f3111eea51dcef8ca7955d9 Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Wed, 26 Apr 2023 01:09:03 +0530 Subject: [PATCH] Added isort to setup, makefile and tox (#2101) --- Makefile | 6 +++++- setup.py | 1 + tox.ini | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c355d1124..652d4a6c23 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,11 @@ clean-pyc: find . -name '__pycache__' -exec rm -rf {} + lint: - tox -e lint + tox run -e lint + +lint-roll: + isort eth tests + $(MAKE) lint test: py.test --tb native tests diff --git a/setup.py b/setup.py index a062642ef4..2380b86f12 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ "pydocstyle>=6.0.0", "types-setuptools", "importlib-metadata<5.0;python_version<'3.8'", + "isort==5.11.4" ], 'benchmark': [ "termcolor>=1.1.0,<2.0.0", diff --git a/tox.ini b/tox.ini index 8c6e696540..5dceb0853d 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,22 @@ envlist= py{37,38,39}-lint py39-docs +[isort] +profile=black +force_grid_wrap=1 +multi_line_output=3 +honor_noqa=true +float_to_top=true +combine_as_imports=true +force_sort_within_sections=true +include_trailing_comma=true +extra_standard_library=pytest +known_first_party=eth +line_length=88 +use_parentheses=true +# skip `__init__.py` files because sometimes order of initialization is important +skip=__init__.py + [flake8] max-line-length= 100 exclude=