From 91ed2d02ad15828bdc002bc4502d6861a7d359a1 Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Thu, 20 Apr 2023 01:01:03 +0530 Subject: [PATCH] Added isort to setup, makefile and tox --- .circleci/config.yml | 4 +++- .isort.cfg | 15 +++++++++++++++ Makefile | 6 +++++- setup.py | 3 ++- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .isort.cfg diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a785d01bf..8332805721 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,9 @@ common: &common - cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} - run: name: install dependencies - command: pip install --user tox + command: | + python -m pip install --upgrade pip + python -m pip install tox --upgrade - run: name: run tox command: python -m tox -r diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000000..46b3001233 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,15 @@ +[settings] +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 \ No newline at end of file diff --git a/Makefile b/Makefile index 7c355d1124..92e9582d36 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 + $(MAKE) lint test: py.test --tb native tests diff --git a/setup.py b/setup.py index a062642ef4..f8db49f851 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", @@ -72,7 +73,7 @@ "idna==2.7", # idna 2.7 is not supported by requests 2.18 "requests>=2.20,<3", - "tox==2.7.0", + "tox>=4.0.0", "twine", ], }