From cda82db150841f5b35ad59648d2ea29e663e9b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 23 Jun 2025 08:49:21 -0700 Subject: [PATCH] python3Packages.niquests: init at 3.15.2 --- .../python-modules/niquests/default.nix | 97 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 99 insertions(+) create mode 100644 pkgs/development/python-modules/niquests/default.nix diff --git a/pkgs/development/python-modules/niquests/default.nix b/pkgs/development/python-modules/niquests/default.nix new file mode 100644 index 000000000000..e9e52639cd98 --- /dev/null +++ b/pkgs/development/python-modules/niquests/default.nix @@ -0,0 +1,97 @@ +{ + buildPythonPackage, + charset-normalizer, + cryptography, + fetchFromGitHub, + hatchling, + lib, + orjson, + pytest-asyncio, + pytest-httpbin, + pytestCheckHook, + stdenv, + urllib3-future, + wassima, +}: + +buildPythonPackage rec { + pname = "niquests"; + version = "3.15.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jawah"; + repo = "niquests"; + tag = "v${version}"; + hash = "sha256-QRVefE/85k6fT0zhAzX4wFB79ANf7LUshWsbi+fpSgk="; + }; + + build-system = [ hatchling ]; + + pythonRelaxDeps = [ + "wassima" + ]; + + dependencies = [ + charset-normalizer + urllib3-future + wassima + ]; + + optional-dependencies = { + inherit (urllib3-future.optional-dependencies) + brotli + socks + ws + zstd + ; + full = [ + orjson + ] + ++ urllib3-future.optional-dependencies.brotli + ++ urllib3-future.optional-dependencies.socks + ++ urllib3-future.optional-dependencies.qh3 + ++ urllib3-future.optional-dependencies.ws + ++ urllib3-future.optional-dependencies.zstd; + http3 = urllib3-future.optional-dependencies.qh3; + ocsp = urllib3-future.optional-dependencies.qh3; + speedups = [ + orjson + ] + ++ urllib3-future.optional-dependencies.brotli + ++ urllib3-future.optional-dependencies.zstd; + }; + + pythonImportsCheck = [ "niquests" ]; + + nativeCheckInputs = [ + cryptography + pytest-asyncio + pytest-httpbin + pytestCheckHook + ] + ++ optional-dependencies.socks; + + disabledTestPaths = [ + # tests connect to the internet + "tests/test_requests.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # NameResolutionError: Failed to resolve 'localhost' + "tests/test_lowlevel.py" + "tests/test_testserver.py" + ]; + + disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ + # PermissionError: [Errno 1] Operation not permitted + "test_use_proxy_from_environment" + ]; + + meta = { + changelog = "https://github.com/jawah/niquests/blob/${src.tag}/HISTORY.md"; + description = "Simple HTTP library that is a drop-in replacement for Requests"; + homepage = "https://github.com/jawah/niquests"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 120c1273cf3d..1c2e8fd31b60 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10443,6 +10443,8 @@ self: super: with self; { nipype = callPackage ../development/python-modules/nipype { inherit (pkgs) which; }; + niquests = callPackage ../development/python-modules/niquests { }; + nitime = callPackage ../development/python-modules/nitime { }; nitpick = callPackage ../applications/version-management/nitpick { };