apify 2.6.1b5__tar.gz → 2.6.1b7__tar.gz
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 apify might be problematic. Click here for more details.
- {apify-2.6.1b5 → apify-2.6.1b7}/.github/workflows/pre_release.yaml +8 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.github/workflows/release.yaml +8 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.github/workflows/run_code_checks.yaml +9 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/CONTRIBUTING.md +1 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/PKG-INFO +10 -8
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/02_running_actors_locally.mdx +1 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/pyproject.toml +16 -11
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_actor.py +3 -2
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_charging.py +4 -7
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_models.py +1 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_platform_event_manager.py +5 -20
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_utils.py +4 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/storages/_request_list.py +2 -2
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/conftest.py +2 -2
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_events.py +3 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_lifecycle.py +3 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/conftest.py +3 -22
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/test_platform_event_manager.py +4 -1
- {apify-2.6.1b5 → apify-2.6.1b7}/uv.lock +27 -298
- {apify-2.6.1b5 → apify-2.6.1b7}/.editorconfig +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.github/CODEOWNERS +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.github/workflows/build_and_deploy_docs.yaml +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.github/workflows/check_pr_title.yaml +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.github/workflows/update_new_issue.yaml +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.gitignore +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.markdownlint.yaml +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/.pre-commit-config.yaml +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/CHANGELOG.md +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/LICENSE +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/Makefile +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/README.md +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/01_introduction.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/03_actor_structure.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/code/01_introduction.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/code/actor_structure/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/code/actor_structure/__main__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/code/actor_structure/main.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/01_overview/code/actor_structure/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/01_beautifulsoup_httpx.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/02_crawlee.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/03_playwright.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/04_selenium.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/05_scrapy.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/01_beautifulsoup_httpx.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/02_crawlee_beautifulsoup.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/02_crawlee_playwright.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/03_playwright.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/04_selenium.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/__main__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/items.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/main.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/settings.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/spiders/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/spiders/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/02_guides/code/scrapy_project/src/spiders/title.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/01_actor_lifecycle.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/02_actor_input.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/03_storages.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/04_actor_events.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/05_proxy_management.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/06_interacting_with_other_actors.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/07_webhooks.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/08_access_apify_api.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/09_running_webserver.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/10_logging.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/11_configuration.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/12_pay_per_event.mdx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/01_context_manager.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/01_init_exit.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/01_reboot.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/01_status_message.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/02_input.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_dataset_exports.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_dataset_read_write.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_deleting_storages.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_kvs_iterating.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_kvs_public_url.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_kvs_read_write.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_opening_storages.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/03_rq.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/04_actor_events.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/05_apify_proxy.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/05_apify_proxy_config.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/05_custom_proxy.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/05_custom_proxy_function.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/05_proxy_actor_input.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/05_proxy_httpx.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/05_proxy_rotation.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/06_interacting_call.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/06_interacting_call_task.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/06_interacting_metamorph.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/06_interacting_start.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/07_webhook.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/07_webhook_preventing.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/08_actor_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/08_actor_new_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/09_webserver.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/10_log_config.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/10_logger_usage.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/11_config.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/actor_charge.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/03_concepts/code/conditional_actor_charge.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/04_upgrading/upgrading_to_v2.md +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/docs/pyproject.toml +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/renovate.json +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_configuration.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_consts.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_crypto.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/_proxy_configuration.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/_apify_storage_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/_dataset_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/_dataset_collection_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/_key_value_store_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/_key_value_store_collection_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/_request_queue_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/_request_queue_collection_client.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/apify_storage_client/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/log.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/_actor_runner.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/_async_thread.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/_logging_config.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/extensions/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/extensions/_httpcache.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/middlewares/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/middlewares/apify_proxy.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/middlewares/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/pipelines/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/pipelines/actor_dataset_push.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/pipelines/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/requests.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/scheduler.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/scrapy/utils.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/storages/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/src/apify/storages/py.typed +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/README.md +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/_utils.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/actor_source_base/Dockerfile +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/actor_source_base/requirements.txt +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/actor_source_base/src/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/actor_source_base/src/__main__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/actor_source_base/src/main.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_api_helpers.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_call_timeouts.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_charge.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_create_proxy_configuration.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_dataset.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_key_value_store.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_lifecycle.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_log.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_request_queue.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_actor_scrapy.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_fixtures.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/integration/test_request_queue.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_create_proxy_configuration.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_dataset.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_env_helpers.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_helpers.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_key_value_store.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_log.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_non_default_instance.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_actor_request_queue.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_configuration.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/actor/test_request_list.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/extensions/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/extensions/test_httpcache.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/middlewares/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/middlewares/test_apify_proxy.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/pipelines/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/pipelines/test_actor_dataset_push.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/requests/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/requests/test_to_apify_request.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/requests/test_to_scrapy_request.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/utils/__init__.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/utils/test_apply_apify_settings.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/scrapy/utils/test_get_basic_auth_header.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/test_crypto.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/tests/unit/test_proxy_configuration.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/.eslintrc.json +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/babel.config.js +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/build_api_reference.sh +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/docusaurus.config.js +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/generate_module_shortcuts.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/package-lock.json +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/package.json +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/sidebars.js +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/components/ApiLink.jsx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/components/Gradients.jsx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/components/Highlights.jsx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/components/Highlights.module.css +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/components/RunnableCodeBlock.jsx +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/components/RunnableCodeBlock.module.css +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/css/custom.css +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/pages/home_page_example.py +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/pages/index.js +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/src/pages/index.module.css +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/static/.nojekyll +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/static/img/docs-og.png +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/tools/docs-prettier.config.js +0 -0
- {apify-2.6.1b5 → apify-2.6.1b7}/website/tools/utils/externalLink.js +0 -0
|
@@ -31,19 +31,27 @@ jobs:
|
|
|
31
31
|
lint_check:
|
|
32
32
|
name: Lint check
|
|
33
33
|
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
|
|
34
|
+
with:
|
|
35
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
34
36
|
|
|
35
37
|
type_check:
|
|
36
38
|
name: Type check
|
|
37
39
|
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
|
|
40
|
+
with:
|
|
41
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
38
42
|
|
|
39
43
|
unit_tests:
|
|
40
44
|
name: Unit tests
|
|
41
45
|
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
|
|
46
|
+
with:
|
|
47
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
42
48
|
|
|
43
49
|
integration_tests:
|
|
44
50
|
name: Integration tests
|
|
45
51
|
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
|
|
46
52
|
secrets: inherit
|
|
53
|
+
with:
|
|
54
|
+
python-versions: '["3.10", "3.13"]'
|
|
47
55
|
|
|
48
56
|
update_changelog:
|
|
49
57
|
name: Update changelog
|
|
@@ -42,19 +42,27 @@ jobs:
|
|
|
42
42
|
lint_check:
|
|
43
43
|
name: Lint check
|
|
44
44
|
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
|
|
45
|
+
with:
|
|
46
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
45
47
|
|
|
46
48
|
type_check:
|
|
47
49
|
name: Type check
|
|
48
50
|
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
|
|
51
|
+
with:
|
|
52
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
49
53
|
|
|
50
54
|
unit_tests:
|
|
51
55
|
name: Unit tests
|
|
52
56
|
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
|
|
57
|
+
with:
|
|
58
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
53
59
|
|
|
54
60
|
integration_tests:
|
|
55
61
|
name: Integration tests
|
|
56
62
|
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
|
|
57
63
|
secrets: inherit
|
|
64
|
+
with:
|
|
65
|
+
python-versions: '["3.10", "3.13"]'
|
|
58
66
|
|
|
59
67
|
update_changelog:
|
|
60
68
|
name: Update changelog
|
|
@@ -10,14 +10,20 @@ jobs:
|
|
|
10
10
|
lint_check:
|
|
11
11
|
name: Lint check
|
|
12
12
|
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
|
|
13
|
+
with:
|
|
14
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
13
15
|
|
|
14
16
|
type_check:
|
|
15
17
|
name: Type check
|
|
16
18
|
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
|
|
19
|
+
with:
|
|
20
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
17
21
|
|
|
18
22
|
unit_tests:
|
|
19
23
|
name: Unit tests
|
|
20
24
|
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
|
|
25
|
+
with:
|
|
26
|
+
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
|
|
21
27
|
|
|
22
28
|
docs_check:
|
|
23
29
|
name: Docs check
|
|
@@ -26,5 +32,7 @@ jobs:
|
|
|
26
32
|
integration_tests:
|
|
27
33
|
name: Integration tests
|
|
28
34
|
needs: [lint_check, type_check, unit_tests]
|
|
29
|
-
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@
|
|
35
|
+
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
|
|
30
36
|
secrets: inherit
|
|
37
|
+
with:
|
|
38
|
+
python-versions: '["3.10", "3.13"]'
|
|
@@ -4,7 +4,7 @@ Here you'll find a contributing guide to get started with development.
|
|
|
4
4
|
|
|
5
5
|
## Environment
|
|
6
6
|
|
|
7
|
-
For local development, it is required to have Python 3.
|
|
7
|
+
For local development, it is required to have Python 3.10 (or a later version) installed.
|
|
8
8
|
|
|
9
9
|
We use [uv](https://docs.astral.sh/uv/) for project management. Install it and set up your IDE accordingly.
|
|
10
10
|
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apify
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.1b7
|
|
4
4
|
Summary: Apify SDK for Python
|
|
5
|
-
Project-URL: Homepage, https://
|
|
6
|
-
Project-URL: Apify homepage, https://apify.com
|
|
5
|
+
Project-URL: Apify Homepage, https://apify.com
|
|
7
6
|
Project-URL: Changelog, https://docs.apify.com/sdk/python/docs/changelog
|
|
8
|
-
Project-URL:
|
|
9
|
-
Project-URL:
|
|
10
|
-
Project-URL:
|
|
7
|
+
Project-URL: Discord, https://discord.com/invite/jyEM2PRvMU
|
|
8
|
+
Project-URL: Documentation, https://docs.apify.com/sdk/python/docs/overview/introduction
|
|
9
|
+
Project-URL: Homepage, https://docs.apify.com/sdk/python/
|
|
10
|
+
Project-URL: Issue Tracker, https://github.com/apify/apify-sdk-python/issues
|
|
11
|
+
Project-URL: Release Notes, https://docs.apify.com/sdk/python/docs/upgrading/upgrading-to-v2
|
|
12
|
+
Project-URL: Source Code, https://github.com/apify/apify-sdk-python
|
|
11
13
|
Author-email: "Apify Technologies s.r.o." <support@apify.com>
|
|
12
14
|
License: Apache License
|
|
13
15
|
Version 2.0, January 2004
|
|
@@ -213,16 +215,16 @@ License: Apache License
|
|
|
213
215
|
License-File: LICENSE
|
|
214
216
|
Keywords: apify,automation,chrome,crawlee,crawler,headless,scraper,scraping,sdk
|
|
215
217
|
Classifier: Development Status :: 5 - Production/Stable
|
|
218
|
+
Classifier: Environment :: Console
|
|
216
219
|
Classifier: Intended Audience :: Developers
|
|
217
220
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
218
221
|
Classifier: Operating System :: OS Independent
|
|
219
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
220
222
|
Classifier: Programming Language :: Python :: 3.10
|
|
221
223
|
Classifier: Programming Language :: Python :: 3.11
|
|
222
224
|
Classifier: Programming Language :: Python :: 3.12
|
|
223
225
|
Classifier: Programming Language :: Python :: 3.13
|
|
224
226
|
Classifier: Topic :: Software Development :: Libraries
|
|
225
|
-
Requires-Python: >=3.
|
|
227
|
+
Requires-Python: >=3.10
|
|
226
228
|
Requires-Dist: apify-client>=1.11.0
|
|
227
229
|
Requires-Dist: apify-shared>=1.3.0
|
|
228
230
|
Requires-Dist: crawlee~=0.6.0
|
|
@@ -11,7 +11,7 @@ In this page, you'll learn how to create and run Apify Actors locally on your co
|
|
|
11
11
|
|
|
12
12
|
## Requirements
|
|
13
13
|
|
|
14
|
-
The Apify SDK requires Python version 3.
|
|
14
|
+
The Apify SDK requires Python version 3.10 or above to run Python Actors locally.
|
|
15
15
|
|
|
16
16
|
## Creating your first Actor
|
|
17
17
|
|
|
@@ -4,18 +4,18 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "apify"
|
|
7
|
-
version = "2.6.
|
|
7
|
+
version = "2.6.1b7"
|
|
8
8
|
description = "Apify SDK for Python"
|
|
9
9
|
authors = [{ name = "Apify Technologies s.r.o.", email = "support@apify.com" }]
|
|
10
10
|
license = { file = "LICENSE" }
|
|
11
11
|
readme = "README.md"
|
|
12
|
-
requires-python = ">=3.
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
13
|
classifiers = [
|
|
14
14
|
"Development Status :: 5 - Production/Stable",
|
|
15
|
+
"Environment :: Console",
|
|
15
16
|
"Intended Audience :: Developers",
|
|
16
17
|
"License :: OSI Approved :: Apache Software License",
|
|
17
18
|
"Operating System :: OS Independent",
|
|
18
|
-
"Programming Language :: Python :: 3.9",
|
|
19
19
|
"Programming Language :: Python :: 3.10",
|
|
20
20
|
"Programming Language :: Python :: 3.11",
|
|
21
21
|
"Programming Language :: Python :: 3.12",
|
|
@@ -51,12 +51,14 @@ dependencies = [
|
|
|
51
51
|
scrapy = ["scrapy>=2.11.0"]
|
|
52
52
|
|
|
53
53
|
[project.urls]
|
|
54
|
-
"Homepage" = "https://
|
|
55
|
-
"Apify homepage" = "https://apify.com"
|
|
54
|
+
"Apify Homepage" = "https://apify.com"
|
|
56
55
|
"Changelog" = "https://docs.apify.com/sdk/python/docs/changelog"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
56
|
+
"Discord" = "https://discord.com/invite/jyEM2PRvMU"
|
|
57
|
+
"Documentation" = "https://docs.apify.com/sdk/python/docs/overview/introduction"
|
|
58
|
+
"Homepage" = "https://docs.apify.com/sdk/python/"
|
|
59
|
+
"Issue Tracker" = "https://github.com/apify/apify-sdk-python/issues"
|
|
60
|
+
"Release Notes" = "https://docs.apify.com/sdk/python/docs/upgrading/upgrading-to-v2"
|
|
61
|
+
"Source Code" = "https://github.com/apify/apify-sdk-python"
|
|
60
62
|
|
|
61
63
|
[dependency-groups]
|
|
62
64
|
dev = [
|
|
@@ -72,7 +74,7 @@ dev = [
|
|
|
72
74
|
"pytest-xdist~=3.8.0",
|
|
73
75
|
"pytest~=8.4.0",
|
|
74
76
|
"respx~=0.22.0",
|
|
75
|
-
"ruff~=0.
|
|
77
|
+
"ruff~=0.12.0",
|
|
76
78
|
"setuptools", # setuptools are used by pytest but not explicitly required
|
|
77
79
|
]
|
|
78
80
|
|
|
@@ -135,6 +137,9 @@ indent-style = "space"
|
|
|
135
137
|
"TRY301", # Abstract `raise` to an inner function
|
|
136
138
|
"TID252", # Prefer absolute imports over relative imports from parent modules
|
|
137
139
|
]
|
|
140
|
+
"**/{tests}/{integration}/*" = [
|
|
141
|
+
"PLC0415", # `import` should be at the top-level of a file
|
|
142
|
+
]
|
|
138
143
|
"**/{docs,website}/**" = [
|
|
139
144
|
"D", # Everything from the pydocstyle
|
|
140
145
|
"INP001", # File {filename} is part of an implicit namespace package, add an __init__.py
|
|
@@ -182,7 +187,7 @@ asyncio_mode = "auto"
|
|
|
182
187
|
timeout = 1200
|
|
183
188
|
|
|
184
189
|
[tool.mypy]
|
|
185
|
-
python_version = "3.
|
|
190
|
+
python_version = "3.10"
|
|
186
191
|
plugins = ["pydantic.mypy"]
|
|
187
192
|
files = ["src", "tests", "docs", "website"]
|
|
188
193
|
check_untyped_defs = true
|
|
@@ -209,7 +214,7 @@ module = [
|
|
|
209
214
|
ignore_missing_imports = true
|
|
210
215
|
|
|
211
216
|
[tool.basedpyright]
|
|
212
|
-
pythonVersion = "3.
|
|
217
|
+
pythonVersion = "3.10"
|
|
213
218
|
typeCheckingMode = "standard"
|
|
214
219
|
include = ["src", "tests", "docs", "website"]
|
|
215
220
|
|
|
@@ -5,7 +5,7 @@ import os
|
|
|
5
5
|
import sys
|
|
6
6
|
from contextlib import suppress
|
|
7
7
|
from datetime import datetime, timedelta, timezone
|
|
8
|
-
from typing import TYPE_CHECKING, Any,
|
|
8
|
+
from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast, overload
|
|
9
9
|
|
|
10
10
|
from lazy_object_proxy import Proxy
|
|
11
11
|
from more_itertools import flatten
|
|
@@ -39,6 +39,7 @@ from apify.storages import Dataset, KeyValueStore, RequestQueue
|
|
|
39
39
|
|
|
40
40
|
if TYPE_CHECKING:
|
|
41
41
|
import logging
|
|
42
|
+
from collections.abc import Callable
|
|
42
43
|
from types import TracebackType
|
|
43
44
|
|
|
44
45
|
from typing_extensions import Self
|
|
@@ -1187,7 +1188,7 @@ class _ActorType:
|
|
|
1187
1188
|
|
|
1188
1189
|
# Check if running in Scrapy by attempting to import it.
|
|
1189
1190
|
with suppress(ImportError):
|
|
1190
|
-
import scrapy # noqa: F401
|
|
1191
|
+
import scrapy # noqa: F401 PLC0415
|
|
1191
1192
|
|
|
1192
1193
|
self.log.debug('Running in Scrapy, setting default `exit_process` to False.')
|
|
1193
1194
|
return False
|
|
@@ -4,7 +4,7 @@ import math
|
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
from datetime import datetime, timezone
|
|
6
6
|
from decimal import Decimal
|
|
7
|
-
from typing import TYPE_CHECKING, Protocol
|
|
7
|
+
from typing import TYPE_CHECKING, Protocol
|
|
8
8
|
|
|
9
9
|
from pydantic import TypeAdapter
|
|
10
10
|
|
|
@@ -23,8 +23,7 @@ if TYPE_CHECKING:
|
|
|
23
23
|
|
|
24
24
|
from apify._configuration import Configuration
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
run_validator: TypeAdapter[ActorRun | None] = TypeAdapter(Union[ActorRun, None])
|
|
26
|
+
run_validator = TypeAdapter[ActorRun | None](ActorRun | None)
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
@docs_group('Interfaces')
|
|
@@ -216,9 +215,7 @@ class ChargingManagerImplementation(ChargingManager):
|
|
|
216
215
|
PricingInfoItem(
|
|
217
216
|
price=Decimal()
|
|
218
217
|
if self._is_at_home
|
|
219
|
-
else Decimal(
|
|
220
|
-
'1'
|
|
221
|
-
), # Use a nonzero price for local development so that the maximum budget can be reached,
|
|
218
|
+
else Decimal(1), # Use a nonzero price for local development so that the maximum budget can be reached,
|
|
222
219
|
title=f"Unknown event '{event_name}'",
|
|
223
220
|
),
|
|
224
221
|
)
|
|
@@ -282,7 +279,7 @@ class ChargingManagerImplementation(ChargingManager):
|
|
|
282
279
|
if pricing_info is not None:
|
|
283
280
|
price = pricing_info.price
|
|
284
281
|
elif not self._is_at_home:
|
|
285
|
-
price = Decimal(
|
|
282
|
+
price = Decimal(1) # Use a nonzero price for local development so that the maximum budget can be reached
|
|
286
283
|
else:
|
|
287
284
|
price = Decimal()
|
|
288
285
|
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
from datetime import datetime
|
|
5
|
-
from typing import TYPE_CHECKING, Annotated, Any, Literal
|
|
5
|
+
from typing import TYPE_CHECKING, Annotated, Any, Literal
|
|
6
6
|
|
|
7
7
|
import websockets.asyncio.client
|
|
8
8
|
from pydantic import BaseModel, Discriminator, Field, TypeAdapter
|
|
@@ -113,25 +113,10 @@ class UnknownEvent(BaseModel):
|
|
|
113
113
|
data: Annotated[dict[str, Any], Field(default_factory=dict)]
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
EventMessage =
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
AbortingEvent,
|
|
121
|
-
ExitEvent,
|
|
122
|
-
EventWithoutData,
|
|
123
|
-
]
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
event_data_adapter: TypeAdapter[EventMessage | DeprecatedEvent | UnknownEvent] = TypeAdapter(
|
|
127
|
-
Union[
|
|
128
|
-
Annotated[
|
|
129
|
-
EventMessage,
|
|
130
|
-
Discriminator('name'),
|
|
131
|
-
],
|
|
132
|
-
DeprecatedEvent,
|
|
133
|
-
UnknownEvent,
|
|
134
|
-
]
|
|
116
|
+
EventMessage = PersistStateEvent | SystemInfoEvent | MigratingEvent | AbortingEvent | ExitEvent | EventWithoutData
|
|
117
|
+
|
|
118
|
+
event_data_adapter = TypeAdapter[EventMessage | DeprecatedEvent | UnknownEvent](
|
|
119
|
+
Annotated[EventMessage, Discriminator('name')] | DeprecatedEvent | UnknownEvent
|
|
135
120
|
)
|
|
136
121
|
|
|
137
122
|
|
|
@@ -3,7 +3,10 @@ from __future__ import annotations
|
|
|
3
3
|
import builtins
|
|
4
4
|
import sys
|
|
5
5
|
from importlib import metadata
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import TYPE_CHECKING, Literal
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from collections.abc import Callable
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
def get_system_info() -> dict:
|
|
@@ -4,7 +4,7 @@ import asyncio
|
|
|
4
4
|
import re
|
|
5
5
|
from asyncio import Task
|
|
6
6
|
from functools import partial
|
|
7
|
-
from typing import Annotated, Any
|
|
7
|
+
from typing import Annotated, Any
|
|
8
8
|
|
|
9
9
|
from pydantic import BaseModel, Field, TypeAdapter
|
|
10
10
|
|
|
@@ -35,7 +35,7 @@ class _SimpleUrlInput(_RequestDetails):
|
|
|
35
35
|
url: str
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
url_input_adapter = TypeAdapter(list[
|
|
38
|
+
url_input_adapter = TypeAdapter(list[_RequestsFromUrlInput | _SimpleUrlInput])
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
@docs_group('Classes')
|
|
@@ -7,7 +7,7 @@ import subprocess
|
|
|
7
7
|
import sys
|
|
8
8
|
import textwrap
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
from typing import TYPE_CHECKING, Any,
|
|
10
|
+
from typing import TYPE_CHECKING, Any, Protocol
|
|
11
11
|
|
|
12
12
|
import pytest
|
|
13
13
|
from filelock import FileLock
|
|
@@ -22,7 +22,7 @@ from ._utils import generate_unique_resource_name
|
|
|
22
22
|
from apify._models import ActorRun
|
|
23
23
|
|
|
24
24
|
if TYPE_CHECKING:
|
|
25
|
-
from collections.abc import Awaitable, Coroutine, Iterator, Mapping
|
|
25
|
+
from collections.abc import Awaitable, Callable, Coroutine, Iterator, Mapping
|
|
26
26
|
from decimal import Decimal
|
|
27
27
|
|
|
28
28
|
from apify_client.clients.resource_clients import ActorClientAsync
|
|
@@ -16,9 +16,11 @@ async def test_emit_and_capture_interval_events(
|
|
|
16
16
|
run_actor: RunActorFunction,
|
|
17
17
|
) -> None:
|
|
18
18
|
async def main() -> None:
|
|
19
|
+
# TC003 - TYPE_CHECKING section is problematic for our integration tests.
|
|
19
20
|
import os
|
|
21
|
+
from collections.abc import Callable # noqa: TC003
|
|
20
22
|
from datetime import datetime
|
|
21
|
-
from typing import Any
|
|
23
|
+
from typing import Any
|
|
22
24
|
|
|
23
25
|
from apify_shared.consts import ActorEventTypes, ApifyEnvVars
|
|
24
26
|
from crawlee.events._types import Event, EventSystemInfoData
|
|
@@ -5,7 +5,7 @@ import contextlib
|
|
|
5
5
|
import json
|
|
6
6
|
import sys
|
|
7
7
|
from datetime import datetime, timezone
|
|
8
|
-
from typing import TYPE_CHECKING, Any,
|
|
8
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
9
9
|
from unittest.mock import AsyncMock, Mock
|
|
10
10
|
|
|
11
11
|
import pytest
|
|
@@ -19,6 +19,8 @@ from apify import Actor
|
|
|
19
19
|
from apify._actor import _ActorType
|
|
20
20
|
|
|
21
21
|
if TYPE_CHECKING:
|
|
22
|
+
from collections.abc import Callable
|
|
23
|
+
|
|
22
24
|
from lazy_object_proxy import Proxy
|
|
23
25
|
|
|
24
26
|
|
|
@@ -4,8 +4,7 @@ import asyncio
|
|
|
4
4
|
import inspect
|
|
5
5
|
import os
|
|
6
6
|
from collections import defaultdict
|
|
7
|
-
from
|
|
8
|
-
from typing import TYPE_CHECKING, Any, Callable, get_type_hints
|
|
7
|
+
from typing import TYPE_CHECKING, Any, get_type_hints
|
|
9
8
|
|
|
10
9
|
import pytest
|
|
11
10
|
|
|
@@ -19,6 +18,7 @@ from crawlee.storages import _creation_management
|
|
|
19
18
|
import apify._actor
|
|
20
19
|
|
|
21
20
|
if TYPE_CHECKING:
|
|
21
|
+
from collections.abc import Callable
|
|
22
22
|
from pathlib import Path
|
|
23
23
|
|
|
24
24
|
|
|
@@ -125,26 +125,7 @@ class ApifyClientAsyncPatcher:
|
|
|
125
125
|
if not client_method:
|
|
126
126
|
raise ValueError(f'ApifyClientAsync does not contain method "{method}"!')
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
# Try to get the return type of the client method using `typing.get_type_hints()`
|
|
130
|
-
client_method_return_type = get_type_hints(client_method)['return']
|
|
131
|
-
except TypeError:
|
|
132
|
-
# There is a known issue with `typing.get_type_hints()` on Python 3.9. It raises a `TypeError`
|
|
133
|
-
# when `|` (Union) is used in the type hint, even with `from __future__ import annotations`. Since we
|
|
134
|
-
# only need the return type, we attempt the following workaround.
|
|
135
|
-
|
|
136
|
-
# 1. Create a deep copy of the client method object
|
|
137
|
-
client_method_copied = deepcopy(client_method)
|
|
138
|
-
|
|
139
|
-
# 2. Restrict the annotations to only include the return type
|
|
140
|
-
client_method_copied.__annotations__ = {'return': client_method.__annotations__['return']}
|
|
141
|
-
|
|
142
|
-
# 3. Try to get the return type again using `typing.get_type_hints()`
|
|
143
|
-
client_method_return_type = get_type_hints(client_method_copied)['return']
|
|
144
|
-
|
|
145
|
-
# TODO: Remove this fallback once we drop support for Python 3.9
|
|
146
|
-
# https://github.com/apify/apify-sdk-python/issues/151
|
|
147
|
-
|
|
128
|
+
client_method_return_type = get_type_hints(client_method)['return']
|
|
148
129
|
original_submethod = getattr(client_method_return_type, submethod, None)
|
|
149
130
|
|
|
150
131
|
if not original_submethod:
|
|
@@ -4,7 +4,7 @@ import asyncio
|
|
|
4
4
|
import json
|
|
5
5
|
import logging
|
|
6
6
|
from collections import defaultdict
|
|
7
|
-
from typing import
|
|
7
|
+
from typing import TYPE_CHECKING, Any
|
|
8
8
|
from unittest.mock import Mock
|
|
9
9
|
|
|
10
10
|
import pytest
|
|
@@ -17,6 +17,9 @@ from crawlee.events._types import Event
|
|
|
17
17
|
from apify import Configuration
|
|
18
18
|
from apify._platform_event_manager import PlatformEventManager, SystemInfoEventData
|
|
19
19
|
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from collections.abc import Callable
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
@pytest.mark.skip(reason='There are issues with log propagation to caplog, see issue #462.')
|
|
22
25
|
async def test_lifecycle_local(caplog: pytest.LogCaptureFixture) -> None:
|