Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ dev = [
# We explicitly constrain black>=24.3.0 to override the transitive dependency.
"black>=24.3.0",
"anyio<5.0.0",
# Pin below 3.0, which drops Python 3.10 support and introduces a breaking API. Once Crawlee
# drops Python 3.10 (https://github.com/apify/crawlee-python/issues/1721), remove this constraint.
"apify_client<3.0.0", # For e2e tests.
"apify_client<4.0.0", # For e2e tests.
"build<2.0.0", # For e2e tests.
"fakeredis[probabilistic,json,lua]<3.0.0",
"poethepoet<1.0.0",
Expand Down
13 changes: 7 additions & 6 deletions tests/e2e/project_template/test_static_crawlers_templates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import re
import subprocess
from datetime import timedelta
from pathlib import Path
from typing import Literal

Expand Down Expand Up @@ -137,15 +138,15 @@ async def test_static_crawler_actor_at_apify(
# then poll client-side via `BuildClientAsync.wait_for_finish` until it reaches a terminal
# status, and assert it succeeded before starting the run.
rebuild = await actor.build(version_number='0.0')
finished_build = await client.build(rebuild['id']).wait_for_finish(wait_secs=900)
finished_build = await client.build(rebuild.id).wait_for_finish(wait_duration=timedelta(seconds=900))
assert finished_build is not None, 'Stagehand rebuild did not reach a terminal status within 900s.'
assert finished_build['status'] == 'SUCCEEDED', (
f'Stagehand rebuild did not succeed: status={finished_build["status"]!r}, build={finished_build}'
assert finished_build.status == 'SUCCEEDED', (
f'Stagehand rebuild did not succeed: status={finished_build.status!r}, build={finished_build}'
)
build_number = finished_build['buildNumber']
build_number = finished_build.build_number

started_run_data = await actor.start(memory_mbytes=8192, build=build_number)
actor_run = client.run(started_run_data['id'])
actor_run = client.run(started_run_data.id)

finished_run_data = await actor_run.wait_for_finish()
actor_run_log = await actor_run.log().get()
Expand All @@ -157,7 +158,7 @@ async def test_static_crawler_actor_at_apify(
additional_run_info = f'Full actor run log: {actor_run_log}'
assert actor_run_log
assert finished_run_data
assert finished_run_data['status'] == 'SUCCEEDED', additional_run_info
assert finished_run_data.status == 'SUCCEEDED', additional_run_info
assert (
'Crawler.stop() was called with following reason: The crawler has reached its limit of 10 requests per crawl.'
) in actor_run_log, additional_run_info
Expand Down
59 changes: 39 additions & 20 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading