From b0f1d64f82e66f6d3673d90bb68a9ea54860a1ff Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Fri, 19 Jun 2026 19:32:05 +0900 Subject: [PATCH 1/7] chore: add smoke tests for packages that have entropy patches --- .../entropy-patches/entropy-patches.wd-test | 18 +++++++ .../entropy-patches/pyproject.toml | 18 +++++++ .../tests/test_aiohttp_websocket.py | 5 ++ .../entropy-patches/tests/test_langsmith.py | 10 ++++ .../entropy-patches/tests/test_numpy.py | 21 ++++++++ .../entropy-patches/tests/test_pydantic.py | 46 ++++++++++++++++++ .../tests/test_rust_packages.py | 48 +++++++++++++++++++ .../tests/test_ssl_avoidance.py | 31 ++++++++++++ .../workerd-test/entropy-patches/worker.py | 26 ++++++++++ .../entropy-patches/wrangler.jsonc | 5 ++ 10 files changed, 228 insertions(+) create mode 100644 packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test create mode 100644 packages/cli/tests/workerd-test/entropy-patches/pyproject.toml create mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py create mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py create mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py create mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py create mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py create mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py create mode 100644 packages/cli/tests/workerd-test/entropy-patches/worker.py create mode 100644 packages/cli/tests/workerd-test/entropy-patches/wrangler.jsonc diff --git a/packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test b/packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test new file mode 100644 index 0000000..8776629 --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test @@ -0,0 +1,18 @@ +using Workerd = import "/workerd/workerd.capnp"; + +const python :Workerd.Worker = ( + modules = [ + (name = "worker.py", pythonModule = embed "worker.py"), + %PYTHON_MODULES + ], + compatibilityDate = "%COMPAT_DATE", + compatibilityFlags = ["python_workers", "service_binding_extra_handlers", "enable_python_external_sdk"], +); + +const unitTests :Workerd.Config = ( + services = [ + ( name = "entropy-patches", + worker = .python + ), + ], +); diff --git a/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml b/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml new file mode 100644 index 0000000..f01885a --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml @@ -0,0 +1,18 @@ +[project] +name = "test" +version = "0.0.0" +requires-python = ">=3.12" +dependencies = [ + "pytest", + "pytest-asyncio<1.2.0", + "numpy", + "pydantic", + "requests", + "urllib3", + "tiktoken", + "cryptography", + "jiter", + "aiohttp", + "langsmith", + "langchain-openai", +] diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py new file mode 100644 index 0000000..a77feaa --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py @@ -0,0 +1,5 @@ +import aiohttp.http_websocket + + +def test_aiohttp_http_websocket_import(): + assert aiohttp.http_websocket is not None diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py new file mode 100644 index 0000000..48b8886 --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py @@ -0,0 +1,10 @@ +import langchain_openai.chat_models.base +from langsmith import traceable + + +def test_langsmith_import(): + assert traceable is not None + + +def test_langchain_openai_import(): + assert langchain_openai.chat_models.base is not None diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py new file mode 100644 index 0000000..18d446c --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py @@ -0,0 +1,21 @@ +import numpy as np + + +def test_numpy_random_default_rng_with_seed(): + rng = np.random.default_rng(42) + val = rng.random() + assert 0.0 <= val < 1.0 + + +def test_numpy_random_default_rng_without_seed(): + rng = np.random.default_rng() + val = rng.random() + assert 0.0 <= val < 1.0 + + +def test_numpy_random_seed_produces_deterministic_results(): + np.random.seed(42) + a = np.random.random(5) + np.random.seed(42) + b = np.random.random(5) + np.testing.assert_array_equal(a, b) diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py new file mode 100644 index 0000000..fe3ef07 --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py @@ -0,0 +1,46 @@ +import pydantic +import pydantic_core +from pydantic import BaseModel + + +def test_pydantic_core_validate_core_schema(): + schema = pydantic_core.core_schema.str_schema() + validator = pydantic_core.SchemaValidator(schema) + assert validator.validate_python("hello") == "hello" + + +def test_pydantic_model_creation(): + class User(BaseModel): + name: str + age: int + + user = User(name="Alice", age=30) + assert user.name == "Alice" + assert user.age == 30 + + +def test_pydantic_model_validation_error(): + class Item(BaseModel): + price: float + quantity: int + + try: + Item(price="not a number", quantity="bad") + raise AssertionError("Expected ValidationError") + except pydantic.ValidationError: + pass + + +def test_pydantic_model_serialization(): + class Config(BaseModel): + host: str + port: int + debug: bool = False + + config = Config(host="localhost", port=8080) + data = config.model_dump() + assert data == {"host": "localhost", "port": 8080, "debug": False} + + json_str = config.model_dump_json() + assert "localhost" in json_str + assert "8080" in json_str diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py new file mode 100644 index 0000000..42f3a12 --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py @@ -0,0 +1,48 @@ +"""Tests for Rust package entropy patches. + +Rust packages that use HashMap need one entropy call at init time for the hash +seed. The entropy patch allows this call during snapshotting. Only the first Rust +package imported makes the call -- subsequent ones reuse the seed. + +This file tests that importing multiple Rust packages in various orderings works +correctly through the snapshot cycle. +""" + +import itertools + +import jiter +import pytest +import tiktoken._tiktoken +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.hashes import SHA256 + +RUST_PACKAGES = ["tiktoken._tiktoken", "cryptography.exceptions", "jiter"] + + +@pytest.mark.parametrize( + "order", + list(itertools.permutations(RUST_PACKAGES)), + ids=[ + "->".join(m.split(".")[0] for m in perm) + for perm in itertools.permutations(RUST_PACKAGES) + ], +) +def test_rust_import_permutations(order): + for module_name in order: + __import__(module_name) + + +def test_tiktoken_import(): + assert tiktoken._tiktoken is not None + + +def test_cryptography_hashing(): + digest = hashes.Hash(SHA256()) + digest.update(b"test data") + result = digest.finalize() + assert len(result) == 32 + + +def test_jiter_parse(): + result = jiter.from_json(b'{"key": "value", "num": 42}') + assert result == {"key": "value", "num": 42} diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py new file mode 100644 index 0000000..ce53856 --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py @@ -0,0 +1,31 @@ +"""Tests for packages that use the no_ssl() entropy avoidance patch. + +aiohttp.connector, requests.adapters, and urllib3.util.ssl_ all call +ssl.create_default_context() at import time, which consumes entropy. The patch +temporarily hides the ssl module during import to exercise their fallback paths. +""" + +import pytest +import requests +import urllib3 +from aiohttp.connector import TCPConnector +from requests.adapters import HTTPAdapter + + +def test_requests_import_and_session(): + assert HTTPAdapter is not None + + session = requests.Session() + assert session is not None + + +def test_urllib3_import(): + pool = urllib3.HTTPConnectionPool("example.com", port=80) + assert pool is not None + + +@pytest.mark.asyncio +async def test_aiohttp_connector_import(): + connector = TCPConnector() + assert connector is not None + await connector.close() diff --git a/packages/cli/tests/workerd-test/entropy-patches/worker.py b/packages/cli/tests/workerd-test/entropy-patches/worker.py new file mode 100644 index 0000000..1b0888b --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/worker.py @@ -0,0 +1,26 @@ +import asyncio +import os +import sys + +import pytest +from pyodide.webloop import WebLoop +from workers import WorkerEntrypoint + + +async def noop(*args): + pass + + +# pytest-asyncio relies on these but in Pyodide < 0.29 WebLoop does not implement them +WebLoop.shutdown_asyncgens = noop +WebLoop.shutdown_default_executor = noop + +if sys.version_info < (3, 13): + asyncio.runners._cancel_all_tasks = lambda loop: None # type: ignore[attr-defined] + + +class Default(WorkerEntrypoint): + async def test(self): + os.chdir("/session/metadata/tests") + args = [".", "-vv"] + assert pytest.main(args) == 0 diff --git a/packages/cli/tests/workerd-test/entropy-patches/wrangler.jsonc b/packages/cli/tests/workerd-test/entropy-patches/wrangler.jsonc new file mode 100644 index 0000000..f89cde9 --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/wrangler.jsonc @@ -0,0 +1,5 @@ +{ + "name": "test-worker", + "compatibility_date": "%COMPAT_DATE", + "compatibility_flags": ["python_workers"] +} From c140585f4d7bf9c42ca9c0f43ceccd910094d605 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Mon, 22 Jun 2026 13:39:55 +0900 Subject: [PATCH 2/7] chore: clean up useless tests --- .../entropy-patches/entropy-patches.wd-test | 2 +- .../tests/test_aiohttp_websocket.py | 6 ++- .../entropy-patches/tests/test_langsmith.py | 12 ++--- .../entropy-patches/tests/test_numpy.py | 26 +++------- .../entropy-patches/tests/test_pydantic.py | 46 ++---------------- .../tests/test_rust_packages.py | 48 ++----------------- .../tests/test_ssl_avoidance.py | 36 +++----------- 7 files changed, 33 insertions(+), 143 deletions(-) diff --git a/packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test b/packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test index 8776629..7ada6bc 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test +++ b/packages/cli/tests/workerd-test/entropy-patches/entropy-patches.wd-test @@ -6,7 +6,7 @@ const python :Workerd.Worker = ( %PYTHON_MODULES ], compatibilityDate = "%COMPAT_DATE", - compatibilityFlags = ["python_workers", "service_binding_extra_handlers", "enable_python_external_sdk"], + compatibilityFlags = ["python_workers", "service_binding_extra_handlers", "enable_python_external_sdk", "python_process_pth_files"], ); const unitTests :Workerd.Config = ( diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py index a77feaa..3581cf4 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py @@ -1,5 +1,7 @@ +# ruff: noqa: F401 import aiohttp.http_websocket -def test_aiohttp_http_websocket_import(): - assert aiohttp.http_websocket is not None +def test_import(): + # make sure this file is collected by pytest + pass diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py index 48b8886..5f00120 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_langsmith.py @@ -1,10 +1,8 @@ +# ruff: noqa: F401 import langchain_openai.chat_models.base -from langsmith import traceable +import langsmith._internal._constants -def test_langsmith_import(): - assert traceable is not None - - -def test_langchain_openai_import(): - assert langchain_openai.chat_models.base is not None +def test_import(): + # make sure this file is collected by pytest + pass diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py index 18d446c..20f6de6 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_numpy.py @@ -1,21 +1,9 @@ -import numpy as np +# ruff: noqa: F401 +import numpy +import numpy.random +import numpy.random.mtrand -def test_numpy_random_default_rng_with_seed(): - rng = np.random.default_rng(42) - val = rng.random() - assert 0.0 <= val < 1.0 - - -def test_numpy_random_default_rng_without_seed(): - rng = np.random.default_rng() - val = rng.random() - assert 0.0 <= val < 1.0 - - -def test_numpy_random_seed_produces_deterministic_results(): - np.random.seed(42) - a = np.random.random(5) - np.random.seed(42) - b = np.random.random(5) - np.testing.assert_array_equal(a, b) +def test_import(): + # make sure this file is collected by pytest + pass diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py index fe3ef07..64c2bd9 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_pydantic.py @@ -1,46 +1,8 @@ +# ruff: noqa: F401 import pydantic import pydantic_core -from pydantic import BaseModel -def test_pydantic_core_validate_core_schema(): - schema = pydantic_core.core_schema.str_schema() - validator = pydantic_core.SchemaValidator(schema) - assert validator.validate_python("hello") == "hello" - - -def test_pydantic_model_creation(): - class User(BaseModel): - name: str - age: int - - user = User(name="Alice", age=30) - assert user.name == "Alice" - assert user.age == 30 - - -def test_pydantic_model_validation_error(): - class Item(BaseModel): - price: float - quantity: int - - try: - Item(price="not a number", quantity="bad") - raise AssertionError("Expected ValidationError") - except pydantic.ValidationError: - pass - - -def test_pydantic_model_serialization(): - class Config(BaseModel): - host: str - port: int - debug: bool = False - - config = Config(host="localhost", port=8080) - data = config.model_dump() - assert data == {"host": "localhost", "port": 8080, "debug": False} - - json_str = config.model_dump_json() - assert "localhost" in json_str - assert "8080" in json_str +def test_import(): + # make sure this file is collected by pytest + pass diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py index 42f3a12..bcd522c 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_rust_packages.py @@ -1,48 +1,10 @@ -"""Tests for Rust package entropy patches. - -Rust packages that use HashMap need one entropy call at init time for the hash -seed. The entropy patch allows this call during snapshotting. Only the first Rust -package imported makes the call -- subsequent ones reuse the seed. - -This file tests that importing multiple Rust packages in various orderings works -correctly through the snapshot cycle. -""" - -import itertools +# ruff: noqa: F401 +import cryptography.exceptions import jiter -import pytest import tiktoken._tiktoken -from cryptography.hazmat.primitives import hashes -from cryptography.hazmat.primitives.hashes import SHA256 - -RUST_PACKAGES = ["tiktoken._tiktoken", "cryptography.exceptions", "jiter"] - - -@pytest.mark.parametrize( - "order", - list(itertools.permutations(RUST_PACKAGES)), - ids=[ - "->".join(m.split(".")[0] for m in perm) - for perm in itertools.permutations(RUST_PACKAGES) - ], -) -def test_rust_import_permutations(order): - for module_name in order: - __import__(module_name) - - -def test_tiktoken_import(): - assert tiktoken._tiktoken is not None - - -def test_cryptography_hashing(): - digest = hashes.Hash(SHA256()) - digest.update(b"test data") - result = digest.finalize() - assert len(result) == 32 -def test_jiter_parse(): - result = jiter.from_json(b'{"key": "value", "num": 42}') - assert result == {"key": "value", "num": 42} +def test_import(): + # make sure this file is collected by pytest + pass diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py index ce53856..21c9729 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py @@ -1,31 +1,9 @@ -"""Tests for packages that use the no_ssl() entropy avoidance patch. +# ruff: noqa: F401 +import aiohttp.connector +import requests.adapters +import urllib3.util.ssl_ -aiohttp.connector, requests.adapters, and urllib3.util.ssl_ all call -ssl.create_default_context() at import time, which consumes entropy. The patch -temporarily hides the ssl module during import to exercise their fallback paths. -""" -import pytest -import requests -import urllib3 -from aiohttp.connector import TCPConnector -from requests.adapters import HTTPAdapter - - -def test_requests_import_and_session(): - assert HTTPAdapter is not None - - session = requests.Session() - assert session is not None - - -def test_urllib3_import(): - pool = urllib3.HTTPConnectionPool("example.com", port=80) - assert pool is not None - - -@pytest.mark.asyncio -async def test_aiohttp_connector_import(): - connector = TCPConnector() - assert connector is not None - await connector.close() +def test_import(): + # make sure this file is collected by pytest + pass From 3cd922d55b638f7448d210bdd8e317719b5a5be4 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Tue, 23 Jun 2026 12:35:43 +0900 Subject: [PATCH 3/7] chore: remove aiohttp for now --- .../cli/tests/workerd-test/entropy-patches/pyproject.toml | 1 - .../entropy-patches/tests/test_aiohttp_websocket.py | 7 ------- .../entropy-patches/tests/test_ssl_avoidance.py | 1 - 3 files changed, 9 deletions(-) delete mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py diff --git a/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml b/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml index f01885a..86bae84 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml +++ b/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml @@ -12,7 +12,6 @@ dependencies = [ "tiktoken", "cryptography", "jiter", - "aiohttp", "langsmith", "langchain-openai", ] diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py deleted file mode 100644 index 3581cf4..0000000 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py +++ /dev/null @@ -1,7 +0,0 @@ -# ruff: noqa: F401 -import aiohttp.http_websocket - - -def test_import(): - # make sure this file is collected by pytest - pass diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py index 21c9729..24bd6b4 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py @@ -1,5 +1,4 @@ # ruff: noqa: F401 -import aiohttp.connector import requests.adapters import urllib3.util.ssl_ From 82d887966e39eb4123575399d8e04bea3b03d546 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Tue, 23 Jun 2026 14:22:09 +0900 Subject: [PATCH 4/7] chore: debug --- packages/cli/src/pywrangler/sync.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cli/src/pywrangler/sync.py b/packages/cli/src/pywrangler/sync.py index ce9a14b..c962ff8 100644 --- a/packages/cli/src/pywrangler/sync.py +++ b/packages/cli/src/pywrangler/sync.py @@ -196,6 +196,9 @@ def _install_requirements_to_vendor(plan: InstallPlan) -> str | None: ) if result.returncode != 0: + logger.warning("debug") + logger.warning(f"Failed to install packages from {plan.lockfile}") + logger.warning(plan.lockfile.read_text()) return result.stdout.strip() shutil.rmtree(vendor_path) From a71ff194459271690a000834266c8ab8501a0bb9 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Tue, 23 Jun 2026 14:34:11 +0900 Subject: [PATCH 5/7] Revert "chore: remove aiohttp for now" This reverts commit 3cd922d55b638f7448d210bdd8e317719b5a5be4. --- .../cli/tests/workerd-test/entropy-patches/pyproject.toml | 1 + .../entropy-patches/tests/test_aiohttp_websocket.py | 7 +++++++ .../entropy-patches/tests/test_ssl_avoidance.py | 1 + 3 files changed, 9 insertions(+) create mode 100644 packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py diff --git a/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml b/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml index 86bae84..f01885a 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml +++ b/packages/cli/tests/workerd-test/entropy-patches/pyproject.toml @@ -12,6 +12,7 @@ dependencies = [ "tiktoken", "cryptography", "jiter", + "aiohttp", "langsmith", "langchain-openai", ] diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py new file mode 100644 index 0000000..3581cf4 --- /dev/null +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_aiohttp_websocket.py @@ -0,0 +1,7 @@ +# ruff: noqa: F401 +import aiohttp.http_websocket + + +def test_import(): + # make sure this file is collected by pytest + pass diff --git a/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py index 24bd6b4..21c9729 100644 --- a/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py +++ b/packages/cli/tests/workerd-test/entropy-patches/tests/test_ssl_avoidance.py @@ -1,4 +1,5 @@ # ruff: noqa: F401 +import aiohttp.connector import requests.adapters import urllib3.util.ssl_ From b54d6dbfd829aad03ff7153b5396a3f902a6c08a Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Tue, 23 Jun 2026 14:34:16 +0900 Subject: [PATCH 6/7] Revert "chore: debug" This reverts commit 82d887966e39eb4123575399d8e04bea3b03d546. --- packages/cli/src/pywrangler/sync.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/cli/src/pywrangler/sync.py b/packages/cli/src/pywrangler/sync.py index c962ff8..ce9a14b 100644 --- a/packages/cli/src/pywrangler/sync.py +++ b/packages/cli/src/pywrangler/sync.py @@ -196,9 +196,6 @@ def _install_requirements_to_vendor(plan: InstallPlan) -> str | None: ) if result.returncode != 0: - logger.warning("debug") - logger.warning(f"Failed to install packages from {plan.lockfile}") - logger.warning(plan.lockfile.read_text()) return result.stdout.strip() shutil.rmtree(vendor_path) From ec8f6f34bfd89df78e7239d6159e461ccb8c025a Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Tue, 23 Jun 2026 14:38:40 +0900 Subject: [PATCH 7/7] chore: disable entropy test in old compat date --- packages/cli/tests/test_in_workerd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/tests/test_in_workerd.py b/packages/cli/tests/test_in_workerd.py index e4cf83a..f47f5fa 100644 --- a/packages/cli/tests/test_in_workerd.py +++ b/packages/cli/tests/test_in_workerd.py @@ -61,7 +61,7 @@ def test_in_workerd( # noqa: PLR0913 (too-many-arguments) # This is reproducible only in the unittest environment, and doesn't happen # when running the same worker manually. if ( - test_dir.name == "sdk" + test_dir.name in ("sdk", "entropy-patches") and compat_date < "2025-09-29" and sys.platform == "linux" ):