From bf262f4e32976bc8743e88058fc1682937fe6468 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Tue, 10 Jan 2023 09:57:52 -0600 Subject: [PATCH] Update isort configuration after discussion in boxtree https://github.com/inducer/boxtree/pull/74 --- pytools/__init__.py | 5 +++-- pytools/graph.py | 5 +++-- pytools/py_codegen.py | 4 ++-- pytools/tag.py | 4 ++-- setup.cfg | 3 +++ test/test_persistent_dict.py | 6 +++--- test/test_pytools.py | 4 ++-- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 8ebcb63..89baa9f 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -35,8 +35,9 @@ import re import sys from functools import reduce, wraps from sys import intern -from typing import (Any, Callable, ClassVar, Dict, Generic, Hashable, Iterable, - List, Optional, Set, Tuple, TypeVar, Union) +from typing import ( + Any, Callable, ClassVar, Dict, Generic, Hashable, Iterable, List, Optional, Set, + Tuple, TypeVar, Union) try: diff --git a/pytools/graph.py b/pytools/graph.py index 7b0f342..054c544 100644 --- a/pytools/graph.py +++ b/pytools/graph.py @@ -64,8 +64,9 @@ Type Variables Used is included as a key in the graph. """ -from typing import (Any, Callable, Collection, Dict, Hashable, Iterator, List, - Mapping, MutableSet, Optional, Set, Tuple, TypeVar) +from typing import ( + Any, Callable, Collection, Dict, Hashable, Iterator, List, Mapping, MutableSet, + Optional, Set, Tuple, TypeVar) try: diff --git a/pytools/py_codegen.py b/pytools/py_codegen.py index 6d2b259..4e08239 100644 --- a/pytools/py_codegen.py +++ b/pytools/py_codegen.py @@ -24,8 +24,8 @@ import marshal from importlib.util import MAGIC_NUMBER as BYTECODE_VERSION from types import FunctionType, ModuleType -from pytools.codegen import CodeGenerator as CodeGeneratorBase -from pytools.codegen import Indentation, remove_common_indentation # noqa +from pytools.codegen import ( # noqa + CodeGenerator as CodeGeneratorBase, Indentation, remove_common_indentation) class PythonCodeGenerator(CodeGeneratorBase): diff --git a/pytools/tag.py b/pytools/tag.py index 7359082..d15131f 100644 --- a/pytools/tag.py +++ b/pytools/tag.py @@ -30,8 +30,8 @@ Internal stuff that is only here because the documentation tool wants it import sys from dataclasses import dataclass -from typing import (Any, FrozenSet, Iterable, Set, Tuple, Type, # noqa: F401 - TypeVar, Union) +from typing import ( # noqa: F401 + Any, FrozenSet, Iterable, Set, Tuple, Type, TypeVar, Union) from pytools import memoize, memoize_method diff --git a/setup.cfg b/setup.cfg index 299be3d..80d9d12 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,7 +10,10 @@ multiline-quotes = """ # enable-isort [isort] +line_length = 85 lines_after_imports = 2 +combine_as_imports = True +multi_line_output = 4 [wheel] universal = 1 diff --git a/test/test_persistent_dict.py b/test/test_persistent_dict.py index 66b1d56..a64b718 100644 --- a/test/test_persistent_dict.py +++ b/test/test_persistent_dict.py @@ -6,9 +6,9 @@ from enum import Enum, IntEnum import pytest -from pytools.persistent_dict import (CollisionWarning, NoSuchEntryError, - PersistentDict, ReadOnlyEntryError, - WriteOncePersistentDict) +from pytools.persistent_dict import ( + CollisionWarning, NoSuchEntryError, PersistentDict, ReadOnlyEntryError, + WriteOncePersistentDict) from pytools.tag import Tag, tag_dataclass diff --git a/test/test_pytools.py b/test/test_pytools.py index 9ec0dff..8398589 100644 --- a/test/test_pytools.py +++ b/test/test_pytools.py @@ -494,8 +494,8 @@ def test_obj_array_vectorize(c=1): def test_tag(): - from pytools.tag import (NonUniqueTagError, Tag, Taggable, UniqueTag, - check_tag_uniqueness) + from pytools.tag import ( + NonUniqueTagError, Tag, Taggable, UniqueTag, check_tag_uniqueness) # Need a subclass that defines the copy function in order to test. class TaggableWithCopy(Taggable): -- GitLab