port-ocean 0.12.2.dev10__py3-none-any.whl → 0.12.2.dev12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of port-ocean might be problematic. Click here for more details.
- port_ocean/cli/commands/list_integrations.py +8 -5
- port_ocean/cli/commands/pull.py +20 -16
- port_ocean/clients/port/authentication.py +12 -13
- port_ocean/clients/port/client.py +9 -8
- port_ocean/clients/port/mixins/blueprints.py +14 -14
- port_ocean/clients/port/mixins/entities.py +7 -8
- port_ocean/clients/port/mixins/integrations.py +11 -11
- port_ocean/clients/port/mixins/migrations.py +5 -5
- port_ocean/clients/port/retry_transport.py +13 -35
- port_ocean/clients/port/utils.py +32 -23
- port_ocean/core/defaults/clean.py +3 -3
- port_ocean/core/defaults/common.py +3 -3
- port_ocean/core/defaults/initialize.py +48 -47
- port_ocean/core/integrations/base.py +3 -2
- port_ocean/core/integrations/mixins/sync_raw.py +3 -3
- port_ocean/core/utils.py +4 -3
- port_ocean/helpers/retry.py +71 -221
- port_ocean/log/logger_setup.py +2 -2
- port_ocean/ocean.py +18 -24
- port_ocean/tests/clients/port/mixins/test_entities.py +3 -4
- port_ocean/tests/test_smoke.py +3 -3
- port_ocean/utils/async_http.py +13 -8
- port_ocean/utils/repeat.py +9 -2
- port_ocean/utils/signal.py +1 -2
- {port_ocean-0.12.2.dev10.dist-info → port_ocean-0.12.2.dev12.dist-info}/METADATA +3 -1
- {port_ocean-0.12.2.dev10.dist-info → port_ocean-0.12.2.dev12.dist-info}/RECORD +29 -30
- {port_ocean-0.12.2.dev10.dist-info → port_ocean-0.12.2.dev12.dist-info}/WHEEL +1 -1
- port_ocean/helpers/async_client.py +0 -53
- {port_ocean-0.12.2.dev10.dist-info → port_ocean-0.12.2.dev12.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.12.2.dev10.dist-info → port_ocean-0.12.2.dev12.dist-info}/entry_points.txt +0 -0
port_ocean/ocean.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import sys
|
|
3
|
-
import threading
|
|
4
3
|
from contextlib import asynccontextmanager
|
|
5
4
|
from typing import Callable, Any, Dict, AsyncIterator, Type
|
|
6
5
|
|
|
@@ -9,8 +8,6 @@ from loguru import logger
|
|
|
9
8
|
from pydantic import BaseModel
|
|
10
9
|
from starlette.types import Scope, Receive, Send
|
|
11
10
|
|
|
12
|
-
from port_ocean.core.handlers.resync_state_updater import ResyncStateUpdater
|
|
13
|
-
from port_ocean.core.models import Runtime
|
|
14
11
|
from port_ocean.clients.port.client import PortClient
|
|
15
12
|
from port_ocean.config.settings import (
|
|
16
13
|
IntegrationConfiguration,
|
|
@@ -20,23 +17,24 @@ from port_ocean.context.ocean import (
|
|
|
20
17
|
ocean,
|
|
21
18
|
initialize_port_ocean_context,
|
|
22
19
|
)
|
|
20
|
+
from port_ocean.core.handlers.resync_state_updater import ResyncStateUpdater
|
|
23
21
|
from port_ocean.core.integrations.base import BaseIntegration
|
|
22
|
+
from port_ocean.core.models import Runtime
|
|
24
23
|
from port_ocean.log.sensetive import sensitive_log_filter
|
|
25
24
|
from port_ocean.middlewares import request_handler
|
|
26
25
|
from port_ocean.utils.repeat import repeat_every
|
|
27
26
|
from port_ocean.utils.signal import signal_handler
|
|
28
27
|
from port_ocean.version import __integration_version__
|
|
29
|
-
from port_ocean.utils.misc import IntegrationStateStatus
|
|
30
28
|
|
|
31
29
|
|
|
32
30
|
class Ocean:
|
|
33
31
|
def __init__(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
self,
|
|
33
|
+
app: FastAPI | None = None,
|
|
34
|
+
integration_class: Callable[[PortOceanContext], BaseIntegration] | None = None,
|
|
35
|
+
integration_router: APIRouter | None = None,
|
|
36
|
+
config_factory: Type[BaseModel] | None = None,
|
|
37
|
+
config_override: Dict[str, Any] | None = None,
|
|
40
38
|
):
|
|
41
39
|
initialize_port_ocean_context(self)
|
|
42
40
|
self.fast_api_app = app or FastAPI()
|
|
@@ -74,23 +72,23 @@ class Ocean:
|
|
|
74
72
|
return self.config.runtime == Runtime.Saas
|
|
75
73
|
|
|
76
74
|
async def _setup_scheduled_resync(
|
|
77
|
-
|
|
75
|
+
self,
|
|
78
76
|
) -> None:
|
|
79
77
|
async def execute_resync_all() -> None:
|
|
80
|
-
await self.resync_state_updater.update_before_resync()
|
|
78
|
+
# await self.resync_state_updater.update_before_resync()
|
|
81
79
|
logger.info("Starting a new scheduled resync")
|
|
82
80
|
try:
|
|
83
81
|
await self.integration.sync_raw_all()
|
|
84
|
-
await self.resync_state_updater.update_after_resync()
|
|
82
|
+
# await self.resync_state_updater.update_after_resync()
|
|
85
83
|
except asyncio.CancelledError:
|
|
86
84
|
logger.warning(
|
|
87
85
|
"resync was cancelled by the scheduled resync, skipping state update"
|
|
88
86
|
)
|
|
89
|
-
except Exception as e:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
# except Exception as e:
|
|
88
|
+
# await self.resync_state_updater.update_after_resync(
|
|
89
|
+
# IntegrationStateStatus.Failed
|
|
90
|
+
# )
|
|
91
|
+
# raise e
|
|
94
92
|
|
|
95
93
|
interval = self.config.scheduled_resync_interval
|
|
96
94
|
loop = asyncio.get_event_loop()
|
|
@@ -102,13 +100,9 @@ class Ocean:
|
|
|
102
100
|
repeated_function = repeat_every(
|
|
103
101
|
seconds=interval * 60,
|
|
104
102
|
# Not running the resync immediately because the event listener should run resync on startup
|
|
105
|
-
wait_first=
|
|
103
|
+
wait_first=False,
|
|
106
104
|
)(
|
|
107
|
-
|
|
108
|
-
target=lambda: asyncio.run_coroutine_threadsafe(
|
|
109
|
-
execute_resync_all(), loop
|
|
110
|
-
)
|
|
111
|
-
).start()
|
|
105
|
+
execute_resync_all
|
|
112
106
|
)
|
|
113
107
|
await repeated_function()
|
|
114
108
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
from unittest.mock import MagicMock
|
|
3
3
|
|
|
4
|
+
import aiohttp
|
|
4
5
|
import pytest
|
|
5
6
|
|
|
6
7
|
from port_ocean.clients.port.mixins.entities import EntityClientMixin
|
|
7
8
|
from port_ocean.core.models import Entity
|
|
8
|
-
from httpx import ReadTimeout
|
|
9
|
-
|
|
10
9
|
|
|
11
10
|
errored_entity_identifier: str = "a"
|
|
12
11
|
expected_result_entities = [
|
|
@@ -20,7 +19,7 @@ all_entities = [
|
|
|
20
19
|
|
|
21
20
|
async def mock_upsert_entity(entity: Entity, *args: Any, **kwargs: Any) -> Entity:
|
|
22
21
|
if entity.identifier == errored_entity_identifier:
|
|
23
|
-
raise
|
|
22
|
+
raise aiohttp.ConnectionTimeoutError("")
|
|
24
23
|
else:
|
|
25
24
|
return entity
|
|
26
25
|
|
|
@@ -47,7 +46,7 @@ async def test_batch_upsert_entities_read_timeout_should_raise_false(
|
|
|
47
46
|
async def test_batch_upsert_entities_read_timeout_should_raise_true(
|
|
48
47
|
entity_client: EntityClientMixin,
|
|
49
48
|
) -> None:
|
|
50
|
-
with pytest.raises(
|
|
49
|
+
with pytest.raises(aiohttp.ConnectionTimeoutError):
|
|
51
50
|
await entity_client.batch_upsert_entities(
|
|
52
51
|
entities=all_entities, request_options=MagicMock(), should_raise=True
|
|
53
52
|
)
|
port_ocean/tests/test_smoke.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from os import environ
|
|
2
2
|
from typing import Tuple
|
|
3
|
+
|
|
3
4
|
import pytest
|
|
4
5
|
|
|
5
6
|
from port_ocean.clients.port.client import PortClient
|
|
6
7
|
from port_ocean.clients.port.types import UserAgentType
|
|
7
8
|
from port_ocean.tests.helpers.smoke_test import SmokeTestDetails
|
|
8
9
|
|
|
9
|
-
|
|
10
10
|
pytestmark = pytest.mark.smoke
|
|
11
11
|
|
|
12
12
|
|
|
@@ -54,7 +54,7 @@ async def test_valid_fake_persons(
|
|
|
54
54
|
headers=headers,
|
|
55
55
|
)
|
|
56
56
|
|
|
57
|
-
fake_person_entities = fake_person_entities_result.json()["entities"]
|
|
57
|
+
fake_person_entities = (await fake_person_entities_result.json())["entities"]
|
|
58
58
|
assert len(fake_person_entities)
|
|
59
59
|
|
|
60
60
|
fake_departments_result = await port_client.client.get(
|
|
@@ -62,7 +62,7 @@ async def test_valid_fake_persons(
|
|
|
62
62
|
headers=headers,
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
-
departments = [x["identifier"] for x in fake_departments_result.json()["entities"]]
|
|
65
|
+
departments = [x["identifier"] for x in (await fake_departments_result.json())["entities"]]
|
|
66
66
|
|
|
67
67
|
for department in departments:
|
|
68
68
|
assert len(
|
port_ocean/utils/async_http.py
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
from asyncio import ensure_future
|
|
2
|
+
|
|
3
|
+
import aiohttp
|
|
4
|
+
from aiohttp import ClientTimeout
|
|
2
5
|
from werkzeug.local import LocalStack, LocalProxy
|
|
3
6
|
|
|
4
7
|
from port_ocean.context.ocean import ocean
|
|
5
|
-
from port_ocean.helpers.
|
|
6
|
-
from port_ocean.
|
|
8
|
+
from port_ocean.helpers.retry import RetryRequestClass
|
|
9
|
+
from port_ocean.utils.signal import signal_handler
|
|
7
10
|
|
|
8
|
-
_http_client: LocalStack[
|
|
11
|
+
_http_client: LocalStack[aiohttp.ClientSession] = LocalStack()
|
|
9
12
|
|
|
10
13
|
|
|
11
|
-
def _get_http_client_context() ->
|
|
14
|
+
def _get_http_client_context() -> aiohttp.ClientSession:
|
|
12
15
|
client = _http_client.top
|
|
13
16
|
if client is None:
|
|
14
|
-
client =
|
|
17
|
+
client = aiohttp.ClientSession(request_class=RetryRequestClass,
|
|
18
|
+
timeout=ClientTimeout(total=ocean.config.client_timeout))
|
|
15
19
|
_http_client.push(client)
|
|
20
|
+
signal_handler.register(lambda: ensure_future(client.close()))
|
|
16
21
|
|
|
17
22
|
return client
|
|
18
23
|
|
|
19
24
|
|
|
20
25
|
"""
|
|
21
26
|
Utilize this client for all outbound integration requests to the third-party application. It functions as a wrapper
|
|
22
|
-
around the
|
|
27
|
+
around the aiohttp.ClientSession, incorporating retry logic at the transport layer for handling retries on 5xx errors and
|
|
23
28
|
connection errors.
|
|
24
29
|
|
|
25
30
|
The client is instantiated lazily, only coming into existence upon its initial access. It should not be closed when in
|
|
26
31
|
use, as it operates as a singleton shared across all events in the thread. It also takes care of recreating the client
|
|
27
32
|
in scenarios such as the creation of a new event loop, such as when initiating a new thread.
|
|
28
33
|
"""
|
|
29
|
-
http_async_client:
|
|
34
|
+
http_async_client: aiohttp.ClientSession = LocalProxy(lambda: _get_http_client_context()) # type: ignore
|
port_ocean/utils/repeat.py
CHANGED
|
@@ -5,7 +5,8 @@ from traceback import format_exception
|
|
|
5
5
|
from typing import Callable, Coroutine, Any
|
|
6
6
|
|
|
7
7
|
from loguru import logger
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
from port_ocean.utils.signal import signal_handler
|
|
9
10
|
|
|
10
11
|
NoArgsNoReturnFuncT = Callable[[], None]
|
|
11
12
|
NoArgsNoReturnAsyncFuncT = Callable[[], Coroutine[Any, Any, None]]
|
|
@@ -14,6 +15,10 @@ NoArgsNoReturnDecorator = Callable[
|
|
|
14
15
|
]
|
|
15
16
|
|
|
16
17
|
|
|
18
|
+
def run_in_threadpool(param):
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
def repeat_every(
|
|
18
23
|
seconds: float,
|
|
19
24
|
wait_first: bool = False,
|
|
@@ -63,7 +68,9 @@ def repeat_every(
|
|
|
63
68
|
repetitions += 1
|
|
64
69
|
try:
|
|
65
70
|
if is_coroutine:
|
|
66
|
-
|
|
71
|
+
task = asyncio.create_task(func())
|
|
72
|
+
signal_handler.register(lambda: task.cancel())
|
|
73
|
+
ensure_future(task)
|
|
67
74
|
else:
|
|
68
75
|
await run_in_threadpool(func)
|
|
69
76
|
except Exception as exc:
|
port_ocean/utils/signal.py
CHANGED
|
@@ -3,8 +3,7 @@ from typing import Callable, Any
|
|
|
3
3
|
from werkzeug.local import LocalProxy, LocalStack
|
|
4
4
|
|
|
5
5
|
from port_ocean.exceptions.utils import (
|
|
6
|
-
SignalHandlerNotInitialized,
|
|
7
|
-
SignalHandlerAlreadyInitialized,
|
|
6
|
+
SignalHandlerAlreadyInitialized, SignalHandlerNotInitialized,
|
|
8
7
|
)
|
|
9
8
|
from port_ocean.utils.misc import generate_uuid
|
|
10
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: port-ocean
|
|
3
|
-
Version: 0.12.2.
|
|
3
|
+
Version: 0.12.2.dev12
|
|
4
4
|
Summary: Port Ocean is a CLI tool for managing your Port projects.
|
|
5
5
|
Home-page: https://app.getport.io
|
|
6
6
|
Keywords: ocean,port-ocean,port
|
|
@@ -16,11 +16,13 @@ Classifier: Programming Language :: Python
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
20
|
Classifier: Topic :: Software Development :: Libraries
|
|
20
21
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
21
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
23
|
Classifier: Topic :: Utilities
|
|
23
24
|
Provides-Extra: cli
|
|
25
|
+
Requires-Dist: aiohttp (>=3.10.10,<4.0.0)
|
|
24
26
|
Requires-Dist: aiostream (>=0.5.2,<0.7.0)
|
|
25
27
|
Requires-Dist: click (>=8.1.3,<9.0.0) ; extra == "cli"
|
|
26
28
|
Requires-Dist: confluent-kafka (>=2.1.1,<3.0.0)
|
|
@@ -7,10 +7,10 @@ port_ocean/cli/commands/defaults/__init___.py,sha256=5OKgakO79bTbplFv1_yWCrw1x_J
|
|
|
7
7
|
port_ocean/cli/commands/defaults/clean.py,sha256=b3MVxAc9pASGxG3O6AjbDJiFngw82UqclVuCZObVPGM,1544
|
|
8
8
|
port_ocean/cli/commands/defaults/dock.py,sha256=pFtHrU_LTvb5Ddrzj09Wxy-jg1Ym10wBYD-0tpDRugE,1104
|
|
9
9
|
port_ocean/cli/commands/defaults/group.py,sha256=hii_4CYoQ7jSMePbnP4AmruO_RKWCUcoV7dXXBlZafc,115
|
|
10
|
-
port_ocean/cli/commands/list_integrations.py,sha256=
|
|
10
|
+
port_ocean/cli/commands/list_integrations.py,sha256=EZlhN2K8CG0J_l5FBxUAJPlbkPvq_jxJxHQUNUhrJgg,1217
|
|
11
11
|
port_ocean/cli/commands/main.py,sha256=gj0lmuLep2XeLNuabB7Wk0UVYPT7_CD_rAw5AoUQWSE,1057
|
|
12
12
|
port_ocean/cli/commands/new.py,sha256=uNDzb2cmUdOHBGsBujWmlB9FrlJvB8CD9dnXY_btGUc,3777
|
|
13
|
-
port_ocean/cli/commands/pull.py,sha256=
|
|
13
|
+
port_ocean/cli/commands/pull.py,sha256=WmlAYJCkJ1LaujjYD03BplgyaN622O0WJ6Re7i3JzbI,2439
|
|
14
14
|
port_ocean/cli/commands/sail.py,sha256=rY7rEMjfy_KXiWvtL0T72TTLgeQ3HW4SOzKkz9wL9nI,2282
|
|
15
15
|
port_ocean/cli/commands/version.py,sha256=hEuIEIcm6Zkamz41Z9nxeSM_4g3oNlAgWwQyDGboh-E,536
|
|
16
16
|
port_ocean/cli/cookiecutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -39,16 +39,16 @@ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.
|
|
|
39
39
|
port_ocean/cli/utils.py,sha256=IUK2UbWqjci-lrcDdynZXqVP5B5TcjF0w5CpEVUks-k,54
|
|
40
40
|
port_ocean/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
port_ocean/clients/port/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
-
port_ocean/clients/port/authentication.py,sha256=
|
|
43
|
-
port_ocean/clients/port/client.py,sha256=
|
|
42
|
+
port_ocean/clients/port/authentication.py,sha256=az5OZI7yAVgfiqCHygn8W10XKi5Y2tGUvW3CBAn9HTY,2972
|
|
43
|
+
port_ocean/clients/port/client.py,sha256=b-Q9Ow3wDl6AYRqAmpvWOfClQf1vf5lr6k4JnNTxTI4,3417
|
|
44
44
|
port_ocean/clients/port/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
-
port_ocean/clients/port/mixins/blueprints.py,sha256=
|
|
46
|
-
port_ocean/clients/port/mixins/entities.py,sha256=
|
|
47
|
-
port_ocean/clients/port/mixins/integrations.py,sha256=
|
|
48
|
-
port_ocean/clients/port/mixins/migrations.py,sha256=
|
|
49
|
-
port_ocean/clients/port/retry_transport.py,sha256=
|
|
45
|
+
port_ocean/clients/port/mixins/blueprints.py,sha256=4WTBtS_eHzeKs_fB51FT3RJmI3upk_njYLr7WVQsteE,4717
|
|
46
|
+
port_ocean/clients/port/mixins/entities.py,sha256=BIN9FSIfDN4IlWhZdTi5VeqXm7Hdd9Mu51gRU22d7_g,8864
|
|
47
|
+
port_ocean/clients/port/mixins/integrations.py,sha256=2K9do-lCuVkFl6bJj_tTyCeMVCWh438X3iScwCTWm0g,4927
|
|
48
|
+
port_ocean/clients/port/mixins/migrations.py,sha256=bnUFxZ2OGVcvC_Tr-DsYj-YRJ5gp1dcKIEa4X5Rf1oo,1483
|
|
49
|
+
port_ocean/clients/port/retry_transport.py,sha256=gTeyHQxGQC3221_EXh9p8DRxFh055jF2UsKqV7yzLIE,1127
|
|
50
50
|
port_ocean/clients/port/types.py,sha256=nvlgiAq4WH5_F7wQbz_GAWl-faob84LVgIjZ2Ww5mTk,451
|
|
51
|
-
port_ocean/clients/port/utils.py,sha256=
|
|
51
|
+
port_ocean/clients/port/utils.py,sha256=B4cYHv5AHg_UPjTOUSL79AEcUTvvCaFtJSIyZmb75yg,2942
|
|
52
52
|
port_ocean/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
port_ocean/config/base.py,sha256=x1gFbzujrxn7EJudRT81C6eN9WsYAb3vOHwcpcpX8Tc,6370
|
|
54
54
|
port_ocean/config/dynamic.py,sha256=qOFkRoJsn_BW7581omi_AoMxoHqasf_foxDQ_G11_SI,2030
|
|
@@ -61,9 +61,9 @@ port_ocean/context/ocean.py,sha256=2EreWOj-N2H7QUjEt5wGiv5KHP4pTZc70tn_wHcpF4w,4
|
|
|
61
61
|
port_ocean/context/resource.py,sha256=yDj63URzQelj8zJPh4BAzTtPhpKr9Gw9DRn7I_0mJ1s,1692
|
|
62
62
|
port_ocean/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
63
|
port_ocean/core/defaults/__init__.py,sha256=8qCZg8n06WAdMu9s_FiRtDYLGPGHbOuS60vapeUoAks,142
|
|
64
|
-
port_ocean/core/defaults/clean.py,sha256=
|
|
65
|
-
port_ocean/core/defaults/common.py,sha256=
|
|
66
|
-
port_ocean/core/defaults/initialize.py,sha256=
|
|
64
|
+
port_ocean/core/defaults/clean.py,sha256=_PQEG2gD2NvnJBilar693IerFAmiN006guBLbSaDkm0,2187
|
|
65
|
+
port_ocean/core/defaults/common.py,sha256=xaNubpAxZe7H2-Sj7Lgb1rAFVunIUaawa5aXORYXXyQ,3555
|
|
66
|
+
port_ocean/core/defaults/initialize.py,sha256=6dIfucQ2cR36eyLK7EPWwGzmH65KSqRLjevcyH8aYvE,8621
|
|
67
67
|
port_ocean/core/event_listener/__init__.py,sha256=mzJ33wRq0kh60fpVdOHVmvMTUQIvz3vxmifyBgwDn0E,889
|
|
68
68
|
port_ocean/core/event_listener/base.py,sha256=1Nmpg00OfT2AD2L8eFm4VQEcdG2TClpSWJMhWhAjkEE,2356
|
|
69
69
|
port_ocean/core/event_listener/factory.py,sha256=AYYfSHPAF7P5H-uQECXT0JVJjKDHrYkWJJBSL4mGkg8,3697
|
|
@@ -89,16 +89,16 @@ port_ocean/core/handlers/port_app_config/models.py,sha256=YvYtf_44KD_rN4xK-3xHtd
|
|
|
89
89
|
port_ocean/core/handlers/resync_state_updater/__init__.py,sha256=kG6y-JQGpPfuTHh912L_bctIDCzAK4DN-d00S7rguWU,81
|
|
90
90
|
port_ocean/core/handlers/resync_state_updater/updater.py,sha256=Yg9ET6ZV5B9GW7u6zZA6GlB_71kmvxvYX2FWgQNzMvo,3182
|
|
91
91
|
port_ocean/core/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
|
-
port_ocean/core/integrations/base.py,sha256=
|
|
92
|
+
port_ocean/core/integrations/base.py,sha256=3nGOgJHzzlhr1OlrebzDENDAG6tiOyJfnijWFYtPn1U,3012
|
|
93
93
|
port_ocean/core/integrations/mixins/__init__.py,sha256=FA1FEKMM6P-L2_m7Q4L20mFa4_RgZnwSRmTCreKcBVM,220
|
|
94
94
|
port_ocean/core/integrations/mixins/events.py,sha256=Ddfx2L4FpghV38waF8OfVeOV0bHBxNIgjU-q5ffillI,2341
|
|
95
95
|
port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
|
|
96
96
|
port_ocean/core/integrations/mixins/sync.py,sha256=B9fEs8faaYLLikH9GBjE_E61vo0bQDjIGQsQ1SRXOlA,3931
|
|
97
|
-
port_ocean/core/integrations/mixins/sync_raw.py,sha256=
|
|
97
|
+
port_ocean/core/integrations/mixins/sync_raw.py,sha256=fUFlhT1huXrolqAw9jB_zo5WhNw4GHbc9yos_-6KuaM,18996
|
|
98
98
|
port_ocean/core/integrations/mixins/utils.py,sha256=7y1rGETZIjOQadyIjFJXIHKkQFKx_SwiP-TrAIsyyLY,2303
|
|
99
99
|
port_ocean/core/models.py,sha256=dJ2_olTdbjUpObQJNmg7e7EENU_zZiX6XOaknNp54B0,1342
|
|
100
100
|
port_ocean/core/ocean_types.py,sha256=3_d8-n626f1kWLQ_Jxw194LEyrOVupz05qs_Y1pvB-A,990
|
|
101
|
-
port_ocean/core/utils.py,sha256=
|
|
101
|
+
port_ocean/core/utils.py,sha256=btXrgW5jB1lRRrW4mo3yyvhgF4m-cwuKORqn1Krq4cQ,3678
|
|
102
102
|
port_ocean/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
103
|
port_ocean/exceptions/api.py,sha256=TLmTMqn4uHGaHgZK8PMIJ0TVJlPB4iP7xl9rx7GtCyY,426
|
|
104
104
|
port_ocean/exceptions/base.py,sha256=uY4DX7fIITDFfemCJDWpaZi3bD51lcANc5swpoNvMJA,46
|
|
@@ -108,19 +108,18 @@ port_ocean/exceptions/core.py,sha256=Zmb1m6NnkSPWpAiQA5tgejm3zpDMt1WQEN47OJNo54A
|
|
|
108
108
|
port_ocean/exceptions/port_defaults.py,sha256=45Bno5JEB-GXztvKsy8mw7TrydQmw13-4JAo2oQmXkE,438
|
|
109
109
|
port_ocean/exceptions/utils.py,sha256=gjOqpi-HpY1l4WlMFsGA9yzhxDhajhoGGdDDyGbLnqI,197
|
|
110
110
|
port_ocean/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
111
|
-
port_ocean/helpers/
|
|
112
|
-
port_ocean/helpers/retry.py,sha256=IQ0RfQ2T5o6uoZh2WW2nrFH5TT6K_k3y2Im0HDp5j9Y,15059
|
|
111
|
+
port_ocean/helpers/retry.py,sha256=0rKkpkoanP00KQ70EQ6bUHXUFxgtApPQhVT0Jqp-syA,8259
|
|
113
112
|
port_ocean/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
114
113
|
port_ocean/log/handlers.py,sha256=k9G_Mb4ga2-Jke9irpdlYqj6EYiwv0gEsh4TgyqqOmI,2853
|
|
115
|
-
port_ocean/log/logger_setup.py,sha256=
|
|
114
|
+
port_ocean/log/logger_setup.py,sha256=qSeVwnivV4WoLx_4SfBwn2PtmUpNdkSEgfm0C8B3yUw,2332
|
|
116
115
|
port_ocean/log/sensetive.py,sha256=lVKiZH6b7TkrZAMmhEJRhcl67HNM94e56x12DwFgCQk,2920
|
|
117
116
|
port_ocean/middlewares.py,sha256=9wYCdyzRZGK1vjEJ28FY_DkfwDNENmXp504UKPf5NaQ,2727
|
|
118
|
-
port_ocean/ocean.py,sha256=
|
|
117
|
+
port_ocean/ocean.py,sha256=rDyJOzGR8wW2dreJasaLI14n0ELtnSVV8c8N-7lw1hM,4865
|
|
119
118
|
port_ocean/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
120
119
|
port_ocean/run.py,sha256=rTxBlrQd4yyrtgErCFJCHCEHs7d1OXrRiJehUYmIbN0,2212
|
|
121
120
|
port_ocean/sonar-project.properties,sha256=X_wLzDOkEVmpGLRMb2fg9Rb0DxWwUFSvESId8qpvrPI,73
|
|
122
121
|
port_ocean/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
123
|
-
port_ocean/tests/clients/port/mixins/test_entities.py,sha256=
|
|
122
|
+
port_ocean/tests/clients/port/mixins/test_entities.py,sha256=5zeWFp3Rm31OzL7UJFmgiB2HvGw1Bvjb46xNTNzo40I,1608
|
|
124
123
|
port_ocean/tests/conftest.py,sha256=JXASSS0IY0nnR6bxBflhzxS25kf4iNaABmThyZ0mZt8,101
|
|
125
124
|
port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py,sha256=Yv03P-LDcJCKZ21exiTFrcT1eu0zn6Z954dilxrb52Y,10842
|
|
126
125
|
port_ocean/tests/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -129,19 +128,19 @@ port_ocean/tests/helpers/integration.py,sha256=_RxS-RHpu11lrbhUXYPZp862HLWx8AoD7
|
|
|
129
128
|
port_ocean/tests/helpers/ocean_app.py,sha256=Dp1bwEDhWsx_G-KVxOfJX1eVIS4168ajLu39wAY275g,1693
|
|
130
129
|
port_ocean/tests/helpers/port_client.py,sha256=5d6GNr8vNNSOkrz1AdOhxBUKuusr_-UPDP7AVpHasQw,599
|
|
131
130
|
port_ocean/tests/helpers/smoke_test.py,sha256=_9aJJFRfuGJEg2D2YQJVJRmpreS6gEPHHQq8Q01x4aQ,2697
|
|
132
|
-
port_ocean/tests/test_smoke.py,sha256=
|
|
131
|
+
port_ocean/tests/test_smoke.py,sha256=zxNAyz1pLeZHfSc-5eS-3dPAUje0uItZPK901t2PEUY,2573
|
|
133
132
|
port_ocean/utils/__init__.py,sha256=KMGnCPXZJbNwtgxtyMycapkDz8tpSyw23MSYT3iVeHs,91
|
|
134
|
-
port_ocean/utils/async_http.py,sha256=
|
|
133
|
+
port_ocean/utils/async_http.py,sha256=3rd_iv7qDkl6GLws_YRsM1sPl2fpUMDw9CEzg8RtqQM,1459
|
|
135
134
|
port_ocean/utils/async_iterators.py,sha256=iw3cUHxfQm3zUSPdw2FmSXDU8E1Ppnys4TGhswNuQ8s,1569
|
|
136
135
|
port_ocean/utils/cache.py,sha256=3KItZDE2yVrbVDr-hoM8lNna8s2dlpxhP4ICdLjH4LQ,2231
|
|
137
136
|
port_ocean/utils/misc.py,sha256=0q2cJ5psqxn_5u_56pT7vOVQ3shDM02iC1lzyWQ_zl0,2098
|
|
138
137
|
port_ocean/utils/queue_utils.py,sha256=KWWl8YVnG-glcfIHhM6nefY-2sou_C6DVP1VynQwzB4,2762
|
|
139
|
-
port_ocean/utils/repeat.py,sha256=
|
|
140
|
-
port_ocean/utils/signal.py,sha256=
|
|
138
|
+
port_ocean/utils/repeat.py,sha256=IMOGPuwAcoVmcHK5l7s1ZODJB9Xck6jZxNHFbdYQd9w,3401
|
|
139
|
+
port_ocean/utils/signal.py,sha256=z9iJBw8aAfxGKwlSHjhEq1g8HbPkCaYpVMyvtisrjZU,1365
|
|
141
140
|
port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
|
|
142
141
|
port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
|
|
143
|
-
port_ocean-0.12.2.
|
|
144
|
-
port_ocean-0.12.2.
|
|
145
|
-
port_ocean-0.12.2.
|
|
146
|
-
port_ocean-0.12.2.
|
|
147
|
-
port_ocean-0.12.2.
|
|
142
|
+
port_ocean-0.12.2.dev12.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
143
|
+
port_ocean-0.12.2.dev12.dist-info/METADATA,sha256=hzkdR-UH6FZRj9cd9PMV9IObpMrRRd8hpzzVM83lcnM,6713
|
|
144
|
+
port_ocean-0.12.2.dev12.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
145
|
+
port_ocean-0.12.2.dev12.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
146
|
+
port_ocean-0.12.2.dev12.dist-info/RECORD,,
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
from typing import Any, Callable, Type
|
|
2
|
-
|
|
3
|
-
import httpx
|
|
4
|
-
from loguru import logger
|
|
5
|
-
|
|
6
|
-
from port_ocean.helpers.retry import RetryTransport
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class OceanAsyncClient(httpx.AsyncClient):
|
|
10
|
-
"""
|
|
11
|
-
This class is a wrapper around httpx.AsyncClient that uses a custom transport class.
|
|
12
|
-
This is done to allow passing our custom transport class to the AsyncClient constructor while still allowing
|
|
13
|
-
all the default AsyncClient behavior that is changed when passing a custom transport instance.
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
def __init__(
|
|
17
|
-
self,
|
|
18
|
-
transport_class: Type[RetryTransport] = RetryTransport,
|
|
19
|
-
transport_kwargs: dict[str, Any] | None = None,
|
|
20
|
-
**kwargs: Any,
|
|
21
|
-
):
|
|
22
|
-
self._transport_kwargs = transport_kwargs
|
|
23
|
-
self._transport_class = transport_class
|
|
24
|
-
super().__init__(**kwargs)
|
|
25
|
-
|
|
26
|
-
def _init_transport( # type: ignore[override]
|
|
27
|
-
self,
|
|
28
|
-
transport: httpx.AsyncBaseTransport | None = None,
|
|
29
|
-
app: Callable[..., Any] | None = None,
|
|
30
|
-
**kwargs: Any,
|
|
31
|
-
) -> httpx.AsyncBaseTransport:
|
|
32
|
-
if transport is not None or app is not None:
|
|
33
|
-
return super()._init_transport(transport=transport, app=app, **kwargs)
|
|
34
|
-
|
|
35
|
-
return self._transport_class(
|
|
36
|
-
wrapped_transport=httpx.AsyncHTTPTransport(
|
|
37
|
-
**kwargs,
|
|
38
|
-
),
|
|
39
|
-
logger=logger,
|
|
40
|
-
**(self._transport_kwargs or {}),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
def _init_proxy_transport( # type: ignore[override]
|
|
44
|
-
self, proxy: httpx.Proxy, **kwargs: Any
|
|
45
|
-
) -> httpx.AsyncBaseTransport:
|
|
46
|
-
return self._transport_class(
|
|
47
|
-
wrapped_transport=httpx.AsyncHTTPTransport(
|
|
48
|
-
proxy=proxy,
|
|
49
|
-
**kwargs,
|
|
50
|
-
),
|
|
51
|
-
logger=logger,
|
|
52
|
-
**(self._transport_kwargs or {}),
|
|
53
|
-
)
|
|
File without changes
|
|
File without changes
|