From e2b160b15e915220248b007ebb778757214e10fb Mon Sep 17 00:00:00 2001 From: natsukium Date: Tue, 7 May 2024 21:58:54 +0900 Subject: [PATCH] python311Packages.httpx-ws: init at 0.6.0 --- .../python-modules/httpx-ws/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/httpx-ws/default.nix diff --git a/pkgs/development/python-modules/httpx-ws/default.nix b/pkgs/development/python-modules/httpx-ws/default.nix new file mode 100644 index 000000000000..fd02d918f04f --- /dev/null +++ b/pkgs/development/python-modules/httpx-ws/default.nix @@ -0,0 +1,68 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + hatchling, + anyio, + httpcore, + httpx, + wsproto, + pytestCheckHook, + starlette, + trio, + uvicorn, +}: + +buildPythonPackage rec { + pname = "httpx-ws"; + version = "0.6.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "frankie567"; + repo = "httpx-ws"; + rev = "refs/tags/v${version}"; + hash = "sha256-eDc21FiGHi98doS4Zbubb/MVw4IjQ1q496TFHCX4xB4="; + }; + + # we don't need to use the hatch-regex-commit plugin + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'source = "regex_commit"' "" \ + --replace-fail 'commit_extra_args = ["-e"]' "" \ + --replace-fail '"hatch-regex-commit"' "" \ + --replace-fail 'addopts = "--cov=httpx_ws/ --cov-report=term-missing"' "" + ''; + + build-system = [ hatchling ]; + + dependencies = [ + anyio + httpcore + httpx + wsproto + ]; + + pythonImportsCheck = [ "httpx_ws" ]; + + nativeCheckInputs = [ + pytestCheckHook + starlette + trio + uvicorn + ]; + + disabledTestPaths = [ + # hang + "tests/test_api.py" + ]; + + meta = with lib; { + description = "WebSocket support for HTTPX"; + homepage = "https://github.com/frankie567/httpx-ws"; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ba579a179cc1..61fd9211801b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5527,6 +5527,8 @@ self: super: with self; { httpx-sse = callPackage ../development/python-modules/httpx-sse { }; + httpx-ws = callPackage ../development/python-modules/httpx-ws { }; + huawei-lte-api = callPackage ../development/python-modules/huawei-lte-api { }; huey = callPackage ../development/python-modules/huey { };