Skip to content

Commit 99767e7

Browse files
committed
Use generated models rather than consts from apify_shared
1 parent 2b4aaaa commit 99767e7

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/apify/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from importlib import metadata
22

3-
from apify_shared.consts import WebhookEventType
3+
from apify_client._models import WebhookEventType
44
from crawlee import Request
55
from crawlee.events import (
66
Event,

src/apify/_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from pydantic import BaseModel, BeforeValidator, ConfigDict, Field
88

9-
from apify_shared.consts import ActorJobStatus, MetaOrigin, WebhookEventType
9+
from apify_client._models import ActorJobStatus, RunOrigin, WebhookEventType
1010
from crawlee._utils.models import timedelta_ms
1111
from crawlee._utils.urls import validate_http_url
1212

@@ -39,7 +39,7 @@ class Webhook(BaseModel):
3939
class ActorRunMeta(BaseModel):
4040
__model_config__ = ConfigDict(populate_by_name=True)
4141

42-
origin: Annotated[MetaOrigin, Field()]
42+
origin: Annotated[RunOrigin, Field()]
4343

4444

4545
@docs_group('Actor')

tests/integration/actor/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from filelock import FileLock
1414

1515
from apify_client import ApifyClient, ApifyClientAsync
16-
from apify_shared.consts import ActorJobStatus, ActorPermissionLevel, ActorSourceType
16+
from apify_client._models import ActorJobStatus, ActorPermissionLevel, VersionSourceType
1717

1818
from .._utils import generate_unique_resource_name
1919
from apify._models import ActorRun
@@ -230,7 +230,7 @@ async def _make_actor(
230230
{
231231
'versionNumber': '0.0',
232232
'buildTag': 'latest',
233-
'sourceType': ActorSourceType.SOURCE_FILES,
233+
'sourceType': VersionSourceType.SOURCE_FILES,
234234
'sourceFiles': source_files_for_api,
235235
}
236236
],

tests/integration/actor/test_actor_api_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import json
55
from typing import TYPE_CHECKING
66

7-
from apify_shared.consts import ActorPermissionLevel
7+
from apify_client._models import ActorPermissionLevel
88
from crawlee._utils.crypto import crypto_random_object_id
99

1010
from .._utils import generate_unique_resource_name

tests/integration/actor/test_actor_charge.py

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

77
import pytest_asyncio
88

9-
from apify_shared.consts import ActorJobStatus
9+
from apify_client._models import ActorJobStatus
1010

1111
from apify import Actor
1212
from apify._models import ActorRun

tests/integration/actor/test_actor_scrapy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44
from typing import TYPE_CHECKING
55

6-
from apify_shared.consts import ActorPermissionLevel
6+
from apify_client._models import ActorPermissionLevel
77

88
if TYPE_CHECKING:
99
from .conftest import MakeActorFunction, RunActorFunction

tests/unit/actor/test_actor_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import pytest
66

77
from apify_client import ApifyClientAsync
8-
from apify_client._models import Run
9-
from apify_shared.consts import ApifyEnvVars, WebhookEventType
8+
from apify_client._models import Run, WebhookEventType
9+
from apify_shared.consts import ApifyEnvVars
1010

1111
from apify import Actor, Webhook
1212
from apify._actor import _ActorType

0 commit comments

Comments
 (0)