Skip to content

Commit

Permalink
Bump isort from 4.3.21 to 5.1.1 (#1730)
Browse files Browse the repository at this point in the history
* Bump isort from 4.3.21 to 5.1.1

Bumps [isort](https://github.com/timothycrosley/isort) from 4.3.21 to 5.1.1.
- [Release notes](https://github.com/timothycrosley/isort/releases)
- [Changelog](https://github.com/timothycrosley/isort/blob/develop/CHANGELOG.md)
- [Commits](PyCQA/isort@4.3.21...5.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

* isort 5 compatibility

* fix known_standard_library and apply isort changes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
  • Loading branch information
dependabot[bot] and samuelcolvin committed Jul 16, 2020
1 parent d2b0501 commit e985857
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DEFAULT_GOAL := all
isort = isort -rc pydantic tests
isort = isort pydantic tests
black = black -S -l 120 --target-version py38 pydantic tests

.PHONY: install
Expand All @@ -24,7 +24,7 @@ format:
.PHONY: lint
lint:
flake8 pydantic/ tests/
$(isort) --check-only -df
$(isort) --check-only --df
$(black) --check --diff

.PHONY: check-dist
Expand Down
2 changes: 1 addition & 1 deletion pydantic/class_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def __init__(
if TYPE_CHECKING:
from inspect import Signature

from .main import BaseConfig
from .fields import ModelField
from .main import BaseConfig
from .types import ModelOrDc

ValidatorCallable = Callable[[Optional[ModelOrDc], Any, Dict[str, Any], ModelField, Type[BaseConfig]], Any]
Expand Down
2 changes: 1 addition & 1 deletion pydantic/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def wrapper_function(*args: Any, **kwargs: Any) -> Any:

class ValidatedFunction:
def __init__(self, function: 'Callable'):
from inspect import signature, Parameter
from inspect import Parameter, signature

parameters: Mapping[str, Parameter] = signature(function).parameters

Expand Down
1 change: 1 addition & 0 deletions pydantic/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def isoformat(o: Union[datetime.date, datetime.time]) -> str:

def pydantic_encoder(obj: Any) -> Any:
from dataclasses import asdict, is_dataclass

from .main import BaseModel

if isinstance(obj, BaseModel):
Expand Down
16 changes: 13 additions & 3 deletions pydantic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,22 @@
)

if TYPE_CHECKING:
import typing_extensions
from inspect import Signature

import typing_extensions

from .class_validators import ValidatorListDict
from .types import ModelOrDc
from .typing import CallableGenerator, TupleGenerator, DictStrAny, DictAny, SetStr
from .typing import AbstractSetIntStr, MappingIntStrAny, ReprArgs # noqa: F401
from .typing import ( # noqa: F401
AbstractSetIntStr,
CallableGenerator,
DictAny,
DictStrAny,
MappingIntStrAny,
ReprArgs,
SetStr,
TupleGenerator,
)

ConfigType = Type['BaseConfig']
Model = TypeVar('Model', bound='BaseModel')
Expand Down
1 change: 1 addition & 0 deletions pydantic/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

if TYPE_CHECKING:
import email_validator

from .fields import ModelField
from .main import BaseConfig # noqa: F401
from .typing import AnyCallable
Expand Down
2 changes: 1 addition & 1 deletion pydantic/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
from .utils import get_model, lenient_issubclass, sequence_like

if TYPE_CHECKING:
from .main import BaseModel # noqa: F401
from .dataclasses import DataclassType # noqa: F401
from .main import BaseModel # noqa: F401

default_prefix = '#/definitions/'

Expand Down
4 changes: 2 additions & 2 deletions pydantic/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@

if TYPE_CHECKING:
from .dataclasses import DataclassType # noqa: F401
from .main import BaseModel, BaseConfig # noqa: F401
from .typing import CallableGenerator
from .fields import ModelField
from .main import BaseConfig, BaseModel # noqa: F401
from .typing import CallableGenerator

ModelOrDc = Type[Union['BaseModel', 'DataclassType']]

Expand Down
7 changes: 4 additions & 3 deletions pydantic/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@

if TYPE_CHECKING:
from inspect import Signature
from .main import BaseModel, BaseConfig # noqa: F401
from .typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs # noqa: F401
from .fields import ModelField # noqa: F401

from .dataclasses import DataclassType # noqa: F401
from .fields import ModelField # noqa: F401
from .main import BaseConfig, BaseModel # noqa: F401
from .typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs # noqa: F401

__all__ = (
'import_string',
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ exclude_lines =
[isort]
line_length=120
known_first_party=pydantic
known_standard_library=dataclasses
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ black==19.10b0
coverage==5.2
flake8==3.8.3
flake8-quotes==3.2.0
isort==4.3.21
isort==5.1.1
mypy==0.782
pycodestyle==2.6.0
pyflakes==2.2.0
Expand Down

0 comments on commit e985857

Please sign in to comment.