From 2914262c6ac45a16325eb1f35d6c82e0e8e46862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Nesveda?= Date: Wed, 6 Sep 2023 15:11:37 +0200 Subject: [PATCH] Re-enable integration tests, unify changelog style, resolve few TODOs --- .flake8 | 2 -- .github/workflows/release.yaml | 10 +++++----- CHANGELOG.md | 22 +++++++++++----------- pyproject.toml | 4 ++-- src/apify/actor.py | 1 - src/apify/consts.py | 16 ++++++++-------- tests/integration/test_request_queue.py | 1 - 7 files changed, 26 insertions(+), 30 deletions(-) diff --git a/.flake8 b/.flake8 index 6999bfcb..5d383e28 100644 --- a/.flake8 +++ b/.flake8 @@ -4,12 +4,10 @@ filename = ./scripts/*.py, ./src/*.py, ./tests/*.py -# Todo: remove "src/apify/consts.py: F401" once consts from apify-shared are not being reexported per-file-ignores = docs/*: D scripts/*: D tests/*: D - src/apify/consts.py: F401 # Google docstring convention + D204 & D401 docstring-convention = all diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f1f2b0b..89a7b892 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,10 +32,10 @@ jobs: name: Run unit tests uses: ./.github/workflows/unit_tests.yaml - # integration_tests: - # name: Run integration tests - # uses: ./.github/workflows/integration_tests.yaml - # secrets: inherit + integration_tests: + name: Run integration tests + uses: ./.github/workflows/integration_tests.yaml + secrets: inherit check_docs: name: Check whether the documentation is up to date @@ -43,7 +43,7 @@ jobs: publish_to_pypi: name: Publish to PyPI - needs: [lint_and_type_checks, unit_tests, check_docs] # TODO: Add integration_tests back! + needs: [lint_and_type_checks, unit_tests, check_docs, integration_tests] runs-on: ubuntu-latest permissions: contents: write diff --git a/CHANGELOG.md b/CHANGELOG.md index ad0cb52d..ec9838f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,36 +1,36 @@ Changelog ========= -[1.1.4](../../releases/tag/v1.1.4) - Unreleased +[1.1.4](../../releases/tag/v1.1.4) - 2023-09-06 ----------------------------------------------- -### Fixes +### Fixed - resolved issue with querying request queue head multiple times in parallel ### Internal changes -- Fixed integration tests for Actor logger -- Removed `pytest-randomly` Pytest plugin - +- fixed integration tests for Actor logger +- removed `pytest-randomly` Pytest plugin +- unpinned `apify-client` and `apify-shared` to improve compatibility with their newer versions [1.1.3](../../releases/tag/v1.1.3) - 2023-08-25 ----------------------------------------------- ### Internal changes -- Unify indentation in configuration files -- Update the `Actor.reboot` method to use the new reboot endpoint +- unified indentation in configuration files +- update the `Actor.reboot` method to use the new reboot endpoint [1.1.2](../../releases/tag/v1.1.2) - 2023-08-02 ----------------------------------------------- ### Internal changes -- Library `apify-shared` is used for importing general consts and utils -- Code quality improvements suggested by `flake8-simplify` -- Actor env vars are used in favor of some Apify env vars -- `apify-client` and `apify-shared` have pinned versions to prevent their implicit updates from breaking SDK +- started importing general constants and utilities from the `apify-shared` library +- simplified code via `flake8-simplify` +- started using environment variables with prefix `ACTOR_` instead of some with prefix `APIFY_` +- pinned `apify-client` and `apify-shared` to prevent their implicit updates from breaking SDK [1.1.1](../../releases/tag/v1.1.1) - 2023-05-23 ----------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index c464b26f..f3c97c6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,8 +25,8 @@ requires-python = ">=3.8" dependencies = [ "aiofiles >= 22.1.0", "aioshutil >= 1.0", - "apify-client == 1.4.0", - "apify-shared == 1.0.2", + "apify-client ~= 1.4.0", + "apify-shared ~= 1.0.2", "colorama >= 0.4.6", "cryptography >= 39.0.0", "httpx >= 0.24.1", diff --git a/src/apify/actor.py b/src/apify/actor.py index b82b287a..4dc727e1 100644 --- a/src/apify/actor.py +++ b/src/apify/actor.py @@ -36,7 +36,6 @@ # This metaclass is needed so you can do `async with Actor: ...` instead of `async with Actor() as a: ...` # and have automatic `Actor.init()` and `Actor.exit()` -# TODO: decide if this mumbo jumbo is worth it or not, or if it maybe breaks something class _ActorContextManager(type): diff --git a/src/apify/consts.py b/src/apify/consts.py index e62a6eaa..84335087 100644 --- a/src/apify/consts.py +++ b/src/apify/consts.py @@ -3,14 +3,14 @@ from enum import Enum from typing import Any -from apify_shared.consts import BOOL_ENV_VARS as _BOOL_ENV_VARS -from apify_shared.consts import DATETIME_ENV_VARS as _DATETIME_ENV_VARS -from apify_shared.consts import FLOAT_ENV_VARS as _FLOAT_ENV_VARS -from apify_shared.consts import INTEGER_ENV_VARS as _INTEGER_ENV_VARS -from apify_shared.consts import STRING_ENV_VARS as _STRING_ENV_VARS -from apify_shared.consts import ActorEventTypes as _ActorEventTypes -from apify_shared.consts import ActorExitCodes as _ActorExitCodes -from apify_shared.consts import ApifyEnvVars as _ApifyEnvVars +from apify_shared.consts import BOOL_ENV_VARS as _BOOL_ENV_VARS # noqa: F401 +from apify_shared.consts import DATETIME_ENV_VARS as _DATETIME_ENV_VARS # noqa: F401 +from apify_shared.consts import FLOAT_ENV_VARS as _FLOAT_ENV_VARS # noqa: F401 +from apify_shared.consts import INTEGER_ENV_VARS as _INTEGER_ENV_VARS # noqa: F401 +from apify_shared.consts import STRING_ENV_VARS as _STRING_ENV_VARS # noqa: F401 +from apify_shared.consts import ActorEventTypes as _ActorEventTypes # noqa: F401 +from apify_shared.consts import ActorExitCodes as _ActorExitCodes # noqa: F401 +from apify_shared.consts import ApifyEnvVars as _ApifyEnvVars # noqa: F401 DEPRECATED_NAMES = [ 'BOOL_ENV_VARS', diff --git a/tests/integration/test_request_queue.py b/tests/integration/test_request_queue.py index 0a3b0bb2..2fbd9c63 100644 --- a/tests/integration/test_request_queue.py +++ b/tests/integration/test_request_queue.py @@ -3,7 +3,6 @@ from .conftest import ActorFactory -# TODO: this test is flaky, and the actor often times out, figure out why and fix it class TestRequestQueue: async def test_simple(self, make_actor: ActorFactory) -> None: async def main() -> None: