diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index cfe067061719..d91c1373db60 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -159,9 +159,11 @@ jobs: - name: Install Dependencies 📦 if: needs.changes.outputs.backend == 'true' + # Poetry intermittently fails to install dependency if it is not PEP 517 compliant + # This is a workaround for that issue run: | sudo apt-get -y install libpq-dev - make install-full + make install-full || make install-full || make install-full - name: Checkout target branch to be able to diff if: needs.changes.outputs.backend == 'true' && github.event_name == 'pull_request' @@ -305,9 +307,11 @@ jobs: - name: Install Dependencies (Linux) 📦 if: needs.changes.outputs.backend == 'true' && matrix.os == 'ubuntu-22.04' + # Poetry intermittently fails to install dependency if it is not PEP 517 compliant + # This is a workaround for that issue run: | sudo apt-get -y install libpq-dev - make install-full | tee .output + make install-full | tee .output || make install-full | tee .output || make install-full | tee .output if grep 'The lock file is not up to date' .output; then exit 1; fi make prepare-tests-ubuntu @@ -317,6 +321,8 @@ jobs: # We create symlinks for spacy models, that's why we need to clean them up # before caching the dependencies directory. # More information: https://github.com/actions/cache/issues/120 + # Poetry intermittently fails to install dependency if it is not PEP 517 compliant + # This is a workaround for that issue run: | $spacy_data_dir = ".venv\lib\site-packages\spacy\data" if (Test-Path $spacy_data_dir) { @@ -324,7 +330,7 @@ jobs: Remove-Item -Force -Recurse $spacy_data_dir New-Item -Path $spacy_data_dir -Type Directory } - make install-full + make install-full || make install-full || make install-full make prepare-tests-windows-gha - name: Add github workflow problem matchers @@ -749,7 +755,7 @@ jobs: - name: Install poetry 🦄 if: needs.changes.outputs.backend == 'true' - uses: Gr1N/setup-poetry@09236184f6c1ab47c0dc9c1001c7fe200cf2afb0 # v7 + uses: Gr1N/setup-poetry@15821dc8a61bc630db542ae4baf6a7c19a994844 # v8 with: poetry-version: ${{ env.POETRY_VERSION }} diff --git a/changelog/12365.misc.md b/changelog/12365.misc.md new file mode 100644 index 000000000000..2cfcd789fabd --- /dev/null +++ b/changelog/12365.misc.md @@ -0,0 +1 @@ +Moved dev-dependencies in `pyproject.toml` to the `dev` group. These depedencies are now in the section `[tool.poetry.group.dev.dependencies]` and run `make install-full` thrice as a workaround for Poetry's problem with PEP 517 non-compliant dependencies (more on it here: https://github.com/python-poetry/poetry/issues/7611) diff --git a/poetry.lock b/poetry.lock index 50b41fbe651e..8325feea9873 100644 --- a/poetry.lock +++ b/poetry.lock @@ -5705,31 +5705,6 @@ tensorflow = ["tensorflow (>=2.9.0,<2.12.0)"] tensorflow-cpu = ["tensorflow-cpu (>=2.9.0,<2.12.0)"] tensorflow-gpu = ["tensorflow-gpu (>=2.9.0,<2.12.0)"] -[[package]] -name = "tensorflow-addons" -version = "0.19.0" -description = "TensorFlow Addons." -category = "main" -optional = false -python-versions = "*" -files = [] -develop = false - -[package.dependencies] -packaging = "*" -typeguard = ">=2.7" - -[package.extras] -tensorflow = ["tensorflow (>=2.9.0,<2.12.0)"] -tensorflow-cpu = ["tensorflow-cpu (>=2.9.0,<2.12.0)"] -tensorflow-gpu = ["tensorflow-gpu (>=2.9.0,<2.12.0)"] - -[package.source] -type = "git" -url = "https://github.com/tensorflow/addons.git" -reference = "v0.19.0" -resolved_reference = "8f191c726c37931e34b98b5843e5918e9f1a5e49" - [[package]] name = "tensorflow-cpu-aws" version = "2.11.0" @@ -7101,4 +7076,4 @@ transformers = ["sentencepiece", "transformers"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.11" -content-hash = "cbc30712d78199c6c8d3af7bd4b3b13e2d5d02b516b0d1313ff6c288cabe0815" +content-hash = "56a8e3ea83fc5f952be7a05d1e32bf82a1dbea582e3774b762e898d1d216ce15" diff --git a/pyproject.toml b/pyproject.toml index d61b6ec8cf31..f9fe99327a78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -203,42 +203,6 @@ markers = "sys_platform != 'linux' or (platform_machine != 'arm64' and platform_ version = "0.19.0" markers = "sys_platform == 'linux' and (platform_machine == 'arm64' or platform_machine == 'aarch64')" -[tool.poetry.dev-dependencies] -pytest-cov = "^4.0.0" -pytest-asyncio = "^0.20.0" -pytest-xdist = "^3.2.1" -pytest = "^7.1.3" -freezegun = "^1.0.0" -responses = "^0.22.0" -aioresponses = "^0.7.2" -moto = "~=4.1.2" -fakeredis = "^2.11.2" -mongomock = "^4.1.2" -black = "^22.10.0" -google-cloud-storage = "^2.4.0" -azure-storage-blob = "<12.16.0" -coveralls = "^3.0.1" -towncrier = "^22.8.0" -toml = "^0.10.0" -pep440-version-utils = "^0.3.0" -pydoc-markdown = "^4.5.1" -pytest-timeout = "^2.1.0" -mypy = "^1.0.0" -bandit = "^1.6.3" -types-pytz = "^2022.1.1" -types-python-dateutil = "^2.8.19" -types-requests = "^2.25.0" -types-setuptools = "^67.2.0" -memory-profiler = "^0.61.0" -psutil = "^5.8.0" -mypy-extensions = "^0.4.3" -sanic-testing = ">=21.12.0,<22.9.0" -analytics-python = "^1.4.0" -datadog-api-client = "^2.0.0" -datadog = "^0.45.0" -types-redis = "^4.3.20" -httpx = "0.23.3" - [tool.poetry.extras] spacy = [ "spacy",] jieba = [ "jieba",] @@ -332,3 +296,37 @@ branch = "fix_signal_issue" [tool.poetry.group.dev.dependencies] ruff = "^0.0.255" docker = "^6.0.1" +pytest-cov = "^4.0.0" +pytest-asyncio = "^0.20.0" +pytest-xdist = "^3.2.1" +pytest = "^7.1.3" +freezegun = "^1.0.0" +responses = "^0.22.0" +aioresponses = "^0.7.2" +moto = "~=4.1.2" +fakeredis = "^2.11.2" +mongomock = "^4.1.2" +black = "^22.10.0" +google-cloud-storage = "^2.4.0" +azure-storage-blob = "<12.16.0" +coveralls = "^3.0.1" +towncrier = "^22.8.0" +toml = "^0.10.0" +pep440-version-utils = "^0.3.0" +pydoc-markdown = "^4.5.1" +pytest-timeout = "^2.1.0" +mypy = "^1.0.0" +bandit = "^1.6.3" +types-pytz = "^2022.1.1" +types-python-dateutil = "^2.8.19" +types-requests = "^2.25.0" +types-setuptools = "^67.2.0" +memory-profiler = "^0.61.0" +psutil = "^5.8.0" +mypy-extensions = "^0.4.3" +sanic-testing = ">=21.12.0,<22.9.0" +analytics-python = "^1.4.0" +datadog-api-client = "^2.0.0" +datadog = "^0.45.0" +types-redis = "^4.3.20" +httpx = "0.23.3" diff --git a/tests/core/test_broker.py b/tests/core/test_broker.py index 36c8e8040e29..f6fde15c6866 100644 --- a/tests/core/test_broker.py +++ b/tests/core/test_broker.py @@ -304,7 +304,12 @@ async def test_kafka_broker_security_protocols(file: Text, exception: Exception) producer.list_topics("topic", timeout=1) +@pytest.mark.flaky async def test_no_pika_logs_if_no_debug_mode(caplog: LogCaptureFixture): + """ + tests that when you run rasa with logging set at INFO, + the debugs from pika dependency are not going to be shown + """ broker = PikaEventBroker( "host", "username", "password", retry_delay_in_seconds=1, connection_attempts=1 ) @@ -313,14 +318,11 @@ async def test_no_pika_logs_if_no_debug_mode(caplog: LogCaptureFixture): with pytest.raises(Exception): await broker.connect() - caplog_records = [ - record for record in caplog.records if record.name != "ddtrace.internal.writer" - ] - # Only Rasa Open Source logs, but logs from the library itself. assert all( - record.name in ["rasa.core.brokers.pika", "asyncio"] - for record in caplog_records + record.name + in ["rasa.core.brokers.pika", "asyncio", "ddtrace.internal.writer.writer"] + for record in caplog.records )