Skip to content

Commit 2599905

Browse files
committed
fix isort
Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com>
1 parent 85d6694 commit 2599905

34 files changed

+33
-63
lines changed

samples/http-image-cloudevents/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import sys
1616

1717
import requests
18-
1918
from cloudevents_v1.conversion import to_binary, to_structured
2019
from cloudevents_v1.http import CloudEvent
2120

samples/http-image-cloudevents/image_sample_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414

1515
import io
1616

17+
from cloudevents_v1.http import from_http
1718
from flask import Flask, request
1819
from PIL import Image
1920

20-
from cloudevents_v1.http import from_http
21-
2221
app = Flask(__name__)
2322

2423

samples/http-image-cloudevents/image_sample_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818

1919
import pytest
2020
from client import image_bytes
21-
from image_sample_server import app
22-
from PIL import Image
23-
2421
from cloudevents_v1.conversion import to_binary, to_structured
2522
from cloudevents_v1.http import CloudEvent, from_http
23+
from image_sample_server import app
24+
from PIL import Image
2625

2726
image_fileobj = io.BytesIO(image_bytes)
2827
image_expected_shape = (1880, 363)

samples/http-json-cloudevents/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import sys
1616

1717
import requests
18-
1918
from cloudevents_v1.conversion import to_binary, to_structured
2019
from cloudevents_v1.http import CloudEvent
2120

samples/http-json-cloudevents/json_sample_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from flask import Flask, request
16-
1715
from cloudevents_v1.http import from_http
16+
from flask import Flask, request
1817

1918
app = Flask(__name__)
2019

samples/http-json-cloudevents/json_sample_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
# under the License.
1414

1515
import pytest
16-
from json_sample_server import app
17-
1816
from cloudevents_v1.conversion import to_binary, to_structured
1917
from cloudevents_v1.http import CloudEvent
18+
from json_sample_server import app
2019

2120

2221
@pytest.fixture

src/cloudevents/v1/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from cloudevents_v1.abstract import AnyCloudEvent
2121
from cloudevents_v1.sdk import converters, marshaller, types
2222
from cloudevents_v1.sdk.converters import is_binary
23-
from cloudevents_v1.sdk.event import v1, v03
23+
from cloudevents_v1.sdk.event import v03, v1
2424

2525

2626
def _best_effort_serialize_to_json( # type: ignore[no-untyped-def]

src/cloudevents/v1/http/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import cloudevents_v1.exceptions as cloud_exceptions
2020
from cloudevents_v1 import abstract
21-
from cloudevents_v1.sdk.event import v1, v03
21+
from cloudevents_v1.sdk.event import v03, v1
2222

2323
_required_by_version = {
2424
"1.0": v1.Event._ce_required_fields,

src/cloudevents/v1/http/event_type.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
# under the License.
1414
import typing
1515

16-
from deprecation import deprecated
17-
1816
from cloudevents_v1.sdk.converters import is_binary as _moved_is_binary
1917
from cloudevents_v1.sdk.converters import is_structured as _moved_is_structured
18+
from deprecation import deprecated
2019

2120
# THIS MODULE IS DEPRECATED, YOU SHOULD NOT ADD NEW FUNCTIONALLY HERE
2221

src/cloudevents/v1/http/http_methods.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414

1515
import typing
1616

17-
from deprecation import deprecated
18-
1917
from cloudevents_v1.abstract import AnyCloudEvent
2018
from cloudevents_v1.conversion import to_binary as _moved_to_binary
2119
from cloudevents_v1.conversion import to_structured as _moved_to_structured
2220
from cloudevents_v1.http.conversion import from_http as _moved_from_http
2321
from cloudevents_v1.http.event import CloudEvent
2422
from cloudevents_v1.sdk import types
23+
from deprecation import deprecated
2524

2625
# THIS MODULE IS DEPRECATED, YOU SHOULD NOT ADD NEW FUNCTIONALLY HERE
2726

src/cloudevents/v1/http/json_methods.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
import typing
1616

17-
from deprecation import deprecated
18-
1917
from cloudevents_v1.abstract import AnyCloudEvent
2018
from cloudevents_v1.conversion import to_json as _moved_to_json
2119
from cloudevents_v1.http import CloudEvent
2220
from cloudevents_v1.http.conversion import from_json as _moved_from_json
2321
from cloudevents_v1.sdk import types
22+
from deprecation import deprecated
2423

2524
# THIS MODULE IS DEPRECATED, YOU SHOULD NOT ADD NEW FUNCTIONALLY HERE
2625

src/cloudevents/v1/http/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
# under the License.
1414
import typing
1515

16-
from deprecation import deprecated
17-
1816
from cloudevents_v1.conversion import (
1917
_best_effort_serialize_to_json as _moved_default_marshaller,
2018
)
19+
from deprecation import deprecated
2120

2221
# THIS MODULE IS DEPRECATED, YOU SHOULD NOT ADD NEW FUNCTIONALLY HERE
2322

src/cloudevents/v1/pydantic/v2/event.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
import typing
1818
from typing import Any
1919

20-
from pydantic.deprecated import parse as _deprecated_parse
21-
2220
from cloudevents_v1.exceptions import PydanticFeatureNotInstalled
2321
from cloudevents_v1.pydantic.fields_docs import FIELD_DESCRIPTIONS
22+
from pydantic.deprecated import parse as _deprecated_parse
2423

2524
try:
2625
from pydantic import BaseModel, ConfigDict, Field, model_serializer

src/cloudevents/v1/sdk/converters/binary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from cloudevents_v1.sdk.converters import base
1919
from cloudevents_v1.sdk.converters.util import has_binary_headers
2020
from cloudevents_v1.sdk.event import base as event_base
21-
from cloudevents_v1.sdk.event import v1, v03
21+
from cloudevents_v1.sdk.event import v03, v1
2222

2323

2424
class BinaryHTTPCloudEventConverter(base.Converter):

src/cloudevents/v1/tests/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from cloudevents_v1.sdk.event import v1, v03
15+
from cloudevents_v1.sdk.event import v03, v1
1616

1717
content_type = "application/json"
1818
ce_type = "word.found.exclamation"

src/cloudevents/v1/tests/test_backwards_compatability.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414
import pytest
15-
1615
from cloudevents_v1.conversion import _best_effort_serialize_to_json
1716
from cloudevents_v1.http import CloudEvent
1817

src/cloudevents/v1/tests/test_base_events.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
import pytest
16-
1715
import cloudevents_v1.exceptions as cloud_exceptions
18-
from cloudevents_v1.sdk.event import v1, v03
16+
import pytest
17+
from cloudevents_v1.sdk.event import v03, v1
1918

2019

2120
@pytest.mark.parametrize("event_class", [v1.Event, v03.Event])

src/cloudevents/v1/tests/test_converters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# under the License.
1414

1515
import pytest
16-
1716
from cloudevents_v1.sdk import exceptions
1817
from cloudevents_v1.sdk.converters import base, binary
1918

src/cloudevents/v1/tests/test_data_encaps_refs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
from uuid import uuid4
1717

1818
import pytest
19-
2019
from cloudevents_v1.sdk import converters, marshaller
21-
from cloudevents_v1.sdk.event import v1, v03
20+
from cloudevents_v1.sdk.event import v03, v1
2221
from cloudevents_v1.tests import data
2322

2423

src/cloudevents/v1/tests/test_deprecated_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# under the License.
1414

1515
import pytest
16-
1716
from cloudevents_v1.http import (
1817
CloudEvent,
1918
to_binary,

src/cloudevents/v1/tests/test_event_extensions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import json
1616

1717
import pytest
18-
1918
from cloudevents_v1.http import CloudEvent, from_http, to_binary, to_structured
2019

2120
test_data = json.dumps({"data-key": "val"})

src/cloudevents/v1/tests/test_event_from_request_converter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
import json
1616

1717
import pytest
18-
1918
from cloudevents_v1.sdk import marshaller
2019
from cloudevents_v1.sdk.converters import binary, structured
21-
from cloudevents_v1.sdk.event import v1, v03
20+
from cloudevents_v1.sdk.event import v03, v1
2221
from cloudevents_v1.tests import data
2322

2423

src/cloudevents/v1/tests/test_event_pipeline.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
import json
1616

1717
import pytest
18-
1918
from cloudevents_v1.sdk import converters, marshaller
2019
from cloudevents_v1.sdk.converters import structured
21-
from cloudevents_v1.sdk.event import v1, v03
20+
from cloudevents_v1.sdk.event import v03, v1
2221
from cloudevents_v1.tests import data
2322

2423

src/cloudevents/v1/tests/test_event_to_request_converter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
import json
1616

1717
import pytest
18-
1918
from cloudevents_v1.sdk import converters, marshaller
20-
from cloudevents_v1.sdk.event import v1, v03
19+
from cloudevents_v1.sdk.event import v03, v1
2120
from cloudevents_v1.tests import data
2221

2322

src/cloudevents/v1/tests/test_http_cloudevent.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
import pytest
16-
1715
import cloudevents_v1.exceptions as cloud_exceptions
16+
import pytest
1817
from cloudevents_v1.conversion import _json_or_string
1918
from cloudevents_v1.http import CloudEvent
2019

src/cloudevents/v1/tests/test_http_conversions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import json
1818

1919
import pytest
20-
2120
from cloudevents_v1.conversion import to_dict, to_json
2221
from cloudevents_v1.http import CloudEvent, from_dict, from_json
2322
from cloudevents_v1.sdk.event.attribute import SpecVersion

src/cloudevents/v1/tests/test_http_events.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717
import json
1818
import typing
1919

20-
import pytest
21-
from sanic import Sanic, response
22-
2320
import cloudevents_v1.exceptions as cloud_exceptions
21+
import pytest
2422
from cloudevents_v1.http import CloudEvent, from_http, to_binary, to_structured
2523
from cloudevents_v1.http.event_type import is_binary as deprecated_is_binary
2624
from cloudevents_v1.http.event_type import is_structured as deprecated_is_structured
2725
from cloudevents_v1.sdk import converters
2826
from cloudevents_v1.sdk.converters.binary import is_binary
2927
from cloudevents_v1.sdk.converters.structured import is_structured
28+
from sanic import Sanic, response
3029

3130
invalid_test_headers = [
3231
{

src/cloudevents/v1/tests/test_kafka_conversions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import json
1818

1919
import pytest
20-
2120
from cloudevents_v1 import exceptions as cloud_exceptions
2221
from cloudevents_v1.http import CloudEvent
2322
from cloudevents_v1.kafka.conversion import (

src/cloudevents/v1/tests/test_marshaller.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414

1515
import json
1616

17-
import pytest
18-
1917
import cloudevents_v1.exceptions as cloud_exceptions
18+
import pytest
2019
from cloudevents_v1.http import CloudEvent, from_http, to_binary, to_structured
2120
from cloudevents_v1.sdk import exceptions, marshaller
2221
from cloudevents_v1.sdk.converters import binary, structured

src/cloudevents/v1/tests/test_options.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# under the License.
1414

1515
import pytest
16-
1716
from cloudevents_v1.sdk.event.opt import Option
1817

1918

src/cloudevents/v1/tests/test_pydantic_cloudevent.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
from json import loads
1616

1717
import pytest
18-
from pydantic import ValidationError as PydanticV2ValidationError
19-
from pydantic.v1 import ValidationError as PydanticV1ValidationError
20-
2118
from cloudevents_v1.conversion import _json_or_string
2219
from cloudevents_v1.exceptions import IncompatibleArgumentsError
2320
from cloudevents_v1.pydantic.v1.event import CloudEvent as PydanticV1CloudEvent
2421
from cloudevents_v1.pydantic.v2.event import CloudEvent as PydanticV2CloudEvent
2522
from cloudevents_v1.sdk.event.attribute import SpecVersion
23+
from pydantic import ValidationError as PydanticV2ValidationError
24+
from pydantic.v1 import ValidationError as PydanticV1ValidationError
2625

2726
_DUMMY_SOURCE = "dummy:source"
2827
_DUMMY_TYPE = "tests.cloudevents.override"

src/cloudevents/v1/tests/test_pydantic_conversions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
import json
1818

1919
import pytest
20-
from pydantic import ValidationError as PydanticV2ValidationError
21-
from pydantic.v1 import ValidationError as PydanticV1ValidationError
22-
2320
from cloudevents_v1.conversion import to_json
2421
from cloudevents_v1.pydantic.v1.conversion import from_dict as pydantic_v1_from_dict
2522
from cloudevents_v1.pydantic.v1.conversion import from_json as pydantic_v1_from_json
@@ -28,6 +25,8 @@
2825
from cloudevents_v1.pydantic.v2.conversion import from_json as pydantic_v2_from_json
2926
from cloudevents_v1.pydantic.v2.event import CloudEvent as PydanticV2CloudEvent
3027
from cloudevents_v1.sdk.event.attribute import SpecVersion
28+
from pydantic import ValidationError as PydanticV2ValidationError
29+
from pydantic.v1 import ValidationError as PydanticV1ValidationError
3130

3231
test_data = json.dumps({"data-key": "val"})
3332
test_attributes = {

src/cloudevents/v1/tests/test_pydantic_events.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717
import json
1818
import typing
1919

20-
import pytest
21-
from pydantic import ValidationError as PydanticV2ValidationError
22-
from pydantic.v1 import ValidationError as PydanticV1ValidationError
23-
from sanic import Sanic, response
24-
2520
import cloudevents_v1.exceptions as cloud_exceptions
21+
import pytest
2622
from cloudevents_v1.conversion import to_binary, to_structured
2723
from cloudevents_v1.pydantic.v1.conversion import from_http as pydantic_v1_from_http
2824
from cloudevents_v1.pydantic.v1.event import CloudEvent as PydanticV1CloudEvent
@@ -31,6 +27,9 @@
3127
from cloudevents_v1.sdk import converters
3228
from cloudevents_v1.sdk.converters.binary import is_binary
3329
from cloudevents_v1.sdk.converters.structured import is_structured
30+
from pydantic import ValidationError as PydanticV2ValidationError
31+
from pydantic.v1 import ValidationError as PydanticV1ValidationError
32+
from sanic import Sanic, response
3433

3534
invalid_test_headers = [
3635
{

src/cloudevents/v1/tests/test_with_sanic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from sanic import Sanic, response
16-
1715
from cloudevents_v1.sdk import converters, marshaller
1816
from cloudevents_v1.sdk.event import v1
1917
from cloudevents_v1.tests import data as test_data
18+
from sanic import Sanic, response
2019

2120
m = marshaller.NewDefaultHTTPMarshaller()
2221
app = Sanic("test_with_sanic")

0 commit comments

Comments
 (0)