diff --git a/pkgs/development/python-modules/sanic/default.nix b/pkgs/development/python-modules/sanic/default.nix index a4c8742fc153..0738dddcd0be 100644 --- a/pkgs/development/python-modules/sanic/default.nix +++ b/pkgs/development/python-modules/sanic/default.nix @@ -26,16 +26,19 @@ buildPythonPackage rec { pname = "sanic"; - version = "25.3.0"; + version = "25.12.0"; pyproject = true; src = fetchFromGitHub { owner = "sanic-org"; repo = "sanic"; tag = "v${version}"; - hash = "sha256-tucLXWYPpALQrPYf+aiovKHYf2iouu6jezvNdukEu9w="; + hash = "sha256-ygMTULkavd/5Mqxn/iS1TC29hfFcF6q3/kT8S7V1Xdo="; }; + # test compat for testing with pytest-asyncio + patches = [ ./pytest9-compat.patch ]; + build-system = [ setuptools ]; dependencies = [ @@ -59,7 +62,7 @@ buildPythonPackage rec { nativeCheckInputs = [ beautifulsoup4 gunicorn - pytest-asyncio + pytest-asyncio # upstream tests with anyio + pytest-sanic instead pytestCheckHook sanic-testing uvicorn @@ -101,6 +104,9 @@ buildPythonPackage rec { "test_create_server_trigger_events" "test_multiple_uvloop_configs_display_warning" "test_uvloop_cannot_never_called_with_create_server" + # Our mailcap database has a different mime type name for xml documentations + # AssertionError: assert 'text/xml; charset=utf-8' == 'application/xml' + "test_guess_content_type" ]; disabledTestPaths = [ diff --git a/pkgs/development/python-modules/sanic/pytest9-compat.patch b/pkgs/development/python-modules/sanic/pytest9-compat.patch new file mode 100644 index 000000000000..1f47760614ad --- /dev/null +++ b/pkgs/development/python-modules/sanic/pytest9-compat.patch @@ -0,0 +1,21 @@ +diff --git a/tests/http3/test_http_receiver.py b/tests/http3/test_http_receiver.py +index 9641791b..29cf3926 100644 +--- a/tests/http3/test_http_receiver.py ++++ b/tests/http3/test_http_receiver.py +@@ -1,6 +1,7 @@ + from unittest.mock import Mock + + import pytest ++import pytest_asyncio + + from aioquic.h3.connection import H3Connection + from aioquic.h3.events import DataReceived, HeadersReceived +@@ -27,7 +28,7 @@ except ImportError: + pytestmark = pytest.mark.asyncio + + +-@pytest.fixture(autouse=True) ++@pytest_asyncio.fixture(autouse=True) + async def setup(app: Sanic): + @app.get("/") + async def handler(*_):