From: Sergey Matveev Date: Sat, 30 Nov 2024 15:42:49 +0000 (+0300) Subject: Unify import-s grouping X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=db8355b430aae0d394342fe0dc86eb6cf7d3cf4b8a5b557abfdcfc920acb96f5;p=keks.git Unify import-s grouping As PEP8 (https://peps.python.org/pep-0008/) says, imports must be grouped the following way: standard libraries, related third-party, local application ones. "typing" is native library (since some modern version), not third-party one. Also, it is not explicitly noted anywhere, but imports are sorted with ignored character case. --- diff --git a/pyac/tests/test_blob.py b/pyac/tests/test_blob.py index 2950424..3aae82d 100644 --- a/pyac/tests/test_blob.py +++ b/pyac/tests/test_blob.py @@ -4,8 +4,8 @@ from hypothesis import given from hypothesis.strategies import binary from pyac import Blob -from pyac import dumps from pyac import DecodeError +from pyac import dumps from pyac import loads from pyac import NotEnoughData diff --git a/pyac/tests/test_errors.py b/pyac/tests/test_errors.py index fd44c58..f4b0bc3 100644 --- a/pyac/tests/test_errors.py +++ b/pyac/tests/test_errors.py @@ -1,11 +1,11 @@ +from typing import Any from unittest import TestCase from hypothesis import given from hypothesis.strategies import integers -from typing import Any -from pyac import dumps from pyac import DecodeError +from pyac import dumps from pyac import loads from pyac import NotEnoughData diff --git a/pyac/tests/test_float.py b/pyac/tests/test_float.py index c86b241..95207d8 100644 --- a/pyac/tests/test_float.py +++ b/pyac/tests/test_float.py @@ -1,6 +1,5 @@ -from unittest import TestCase - from typing import List +from unittest import TestCase from pyac import dumps from pyac import loads diff --git a/pyac/tests/test_int.py b/pyac/tests/test_int.py index ca5154c..cb92ad5 100644 --- a/pyac/tests/test_int.py +++ b/pyac/tests/test_int.py @@ -1,7 +1,7 @@ from unittest import TestCase -from pyac import dumps from pyac import DecodeError +from pyac import dumps from pyac import loads from pyac import NotEnoughData diff --git a/pyac/tests/test_list.py b/pyac/tests/test_list.py index 9deebf2..d81806b 100644 --- a/pyac/tests/test_list.py +++ b/pyac/tests/test_list.py @@ -1,8 +1,10 @@ +from typing import List from unittest import TestCase from hypothesis import given from hypothesis.strategies import binary from hypothesis.strategies import booleans +from hypothesis.strategies import characters from hypothesis.strategies import datetimes from hypothesis.strategies import deferred from hypothesis.strategies import dictionaries @@ -14,8 +16,6 @@ from hypothesis.strategies import one_of from hypothesis.strategies import text from hypothesis.strategies import tuples from hypothesis.strategies import uuids -from hypothesis.strategies import characters -from typing import List from pyac import Blob from pyac import dumps diff --git a/pyac/tests/test_map.py b/pyac/tests/test_map.py index b8c4d54..c3579b9 100644 --- a/pyac/tests/test_map.py +++ b/pyac/tests/test_map.py @@ -3,6 +3,7 @@ from unittest import TestCase from hypothesis import given from hypothesis.strategies import binary from hypothesis.strategies import booleans +from hypothesis.strategies import characters from hypothesis.strategies import datetimes from hypothesis.strategies import dictionaries from hypothesis.strategies import integers @@ -13,13 +14,13 @@ from hypothesis.strategies import one_of from hypothesis.strategies import text from hypothesis.strategies import tuples from hypothesis.strategies import uuids -from hypothesis.strategies import characters from pyac import Blob from pyac import dumps from pyac import DecodeError from pyac import loads + blobs_st = tuples(integers(1, 20), binary(max_size=60)).map(lambda x: Blob(*x)) text_st = text( diff --git a/pyac/tests/test_str.py b/pyac/tests/test_str.py index 5b0824f..8a3e5af 100644 --- a/pyac/tests/test_str.py +++ b/pyac/tests/test_str.py @@ -4,8 +4,8 @@ from hypothesis import given from hypothesis.strategies import integers from hypothesis.strategies import text -from pyac import dumps from pyac import DecodeError +from pyac import dumps from pyac import loads from pyac import NotEnoughData diff --git a/pyac/tests/test_symmetric.py b/pyac/tests/test_symmetric.py index 62db02d..9eff3fe 100644 --- a/pyac/tests/test_symmetric.py +++ b/pyac/tests/test_symmetric.py @@ -1,9 +1,10 @@ +from typing import Any from unittest import TestCase -from typing import Any from hypothesis import given from hypothesis.strategies import binary from hypothesis.strategies import booleans +from hypothesis.strategies import characters from hypothesis.strategies import datetimes from hypothesis.strategies import deferred from hypothesis.strategies import dictionaries @@ -15,11 +16,11 @@ from hypothesis.strategies import one_of from hypothesis.strategies import text from hypothesis.strategies import tuples from hypothesis.strategies import uuids -from hypothesis.strategies import characters +from pyac import Blob from pyac import dumps from pyac import loads -from pyac import Blob + blobs_st = tuples(integers(1, 20), binary(max_size=60)).map(lambda x: Blob(*x)) diff --git a/pyac/tests/test_tai.py b/pyac/tests/test_tai.py index 75b680a..3d80fdf 100644 --- a/pyac/tests/test_tai.py +++ b/pyac/tests/test_tai.py @@ -1,13 +1,13 @@ -from unittest import TestCase - from datetime import datetime from datetime import timedelta +from unittest import TestCase +from uuid import UUID + from hypothesis import given from hypothesis.strategies import binary -from uuid import UUID -from pyac import dumps from pyac import DecodeError +from pyac import dumps from pyac import Leapsecs from pyac import loads from pyac import NotEnoughData diff --git a/pyac/tests/test_uuid.py b/pyac/tests/test_uuid.py index 1c33220..a5c286d 100644 --- a/pyac/tests/test_uuid.py +++ b/pyac/tests/test_uuid.py @@ -1,5 +1,4 @@ from unittest import TestCase - from uuid import UUID from pyac import dumps