python3Packages.niquests: init at 3.14.1 (#419602)

This commit is contained in:
dotlambda
2025-09-09 18:07:50 -07:00
committed by GitHub
5 changed files with 315 additions and 0 deletions
@@ -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 ];
};
}
@@ -0,0 +1,74 @@
{
buildPythonPackage,
cmake,
cryptography,
fetchFromGitHub,
lib,
pytest-asyncio,
pytest-mock,
pytestCheckHook,
rustPlatform,
stdenv,
}:
buildPythonPackage rec {
pname = "qh3";
version = "1.5.4";
pyproject = true;
src = fetchFromGitHub {
owner = "jawah";
repo = "qh3";
tag = "v${version}";
hash = "sha256-VlqkZk+7803dzwMBFpsSSQUSVu5/1jKouwuK7jNuMGU=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-Dgx7CSH+XyVZSVHAcr65QULsY//rxgeQe5jYQQkSjHc=";
};
nativeBuildInputs = [
cmake
rustPlatform.bindgenHook
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
dontUseCmakeConfigure = true;
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals stdenv.cc.isGNU [
"-Wno-error=stringop-overflow"
]
);
pythonImportsCheck = [ "qh3" ];
nativeCheckInputs = [
cryptography
pytest-asyncio
pytest-mock
pytestCheckHook
];
__darwinAllowLocalNetworking = true;
preCheck = ''
# import from $out
rm -r qh3
'';
disabledTests = lib.optionals stdenv.buildPlatform.isDarwin [
# ConnectionError
"test_connect_and_serve_ipv4"
];
meta = {
changelog = "https://github.com/jawah/qh3/blob/${src.tag}/CHANGELOG.rst";
description = "Lightweight QUIC and HTTP/3 implementation in Python";
homepage = "https://github.com/jawah/qh3";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ dotlambda ];
};
}
@@ -0,0 +1,95 @@
{
aiofile,
brotli,
brotlicffi,
buildPythonPackage,
fetchFromGitHub,
hatchling,
h11,
isPyPy,
jh2,
lib,
pytest-asyncio,
pytest-timeout,
pytestCheckHook,
python-socks,
pythonOlder,
qh3,
stdenv,
tornado,
trustme,
wsproto,
zstandard,
}:
buildPythonPackage rec {
pname = "urllib3-future";
version = "2.13.907";
pyproject = true;
src = fetchFromGitHub {
owner = "jawah";
repo = "urllib3.future";
tag = version;
hash = "sha256-JDN37PxeiJhlRFEJ8vkB/2Vt0Xmv0JTpD8LCsVwh3Q4=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "''''ignore:.*but not measured.*:coverage.exceptions.CoverageWarning''''," "" \
--replace-fail "''''ignore:.*No data was collected.*:coverage.exceptions.CoverageWarning''''," ""
'';
build-system = [ hatchling ];
# prevents installing a urllib3 module and thereby shadow the urllib3 package
env.URLLIB3_NO_OVERRIDE = "true";
dependencies = [
h11
jh2
qh3
];
optional-dependencies = {
brotli = [ (if isPyPy then brotlicffi else brotli) ];
qh3 = [ qh3 ];
secure = [ ];
socks = [ python-socks ];
ws = [ wsproto ];
zstd = lib.optionals (pythonOlder "3.14") [ zstandard ];
};
pythonImportsCheck = [ "urllib3_future" ];
# PermissionError: [Errno 1] Operation not permitted
doCheck = !stdenv.buildPlatform.isDarwin;
nativeCheckInputs = [
aiofile
pytest-asyncio
pytest-timeout
pytestCheckHook
tornado
trustme
]
++ lib.flatten (lib.attrValues optional-dependencies);
disabledTestPaths = [
# test connects to the internet
"test/contrib/test_resolver.py::test_url_resolver"
];
disabledTests = [
# test hangs
"test_proxy_rejection"
];
meta = {
changelog = "https://github.com/jawah/urllib3.future/blob/${src.tag}/CHANGES.rst";
description = "Powerful HTTP 1.1, 2, and 3 client with both sync and async interfaces";
homepage = "https://github.com/jawah/urllib3.future";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dotlambda ];
};
}
@@ -0,0 +1,39 @@
{
buildPythonPackage,
fetchFromGitHub,
hatchling,
lib,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "wassima";
version = "2.0.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jawah";
repo = "wassima";
tag = version;
hash = "sha256-MUGB8x4+G+B4cknCeiCcTqKwa8Gea8QrRyM4sYbVxdA=";
};
build-system = [ hatchling ];
pythonImportsCheck = [ "wassima" ];
nativeCheckInputs = [
pytestCheckHook
];
# tests connect to the internet
doCheck = false;
meta = {
changelog = "https://github.com/jawah/wassima/blob/${src.tag}/CHANGELOG.md";
description = "Access your OS root certificates with utmost ease";
homepage = "https://github.com/jawah/wassima";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dotlambda ];
};
}
+10
View File
@@ -10516,6 +10516,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 { };
nitransforms = callPackage ../development/python-modules/nitransforms { };
@@ -15455,6 +15457,10 @@ self: super: with self; {
qgrid = callPackage ../development/python-modules/qgrid { };
qh3 = callPackage ../development/python-modules/qh3 {
inherit (pkgs) cmake;
};
qiling = callPackage ../development/python-modules/qiling { };
qimage2ndarray = callPackage ../development/python-modules/qimage2ndarray { };
@@ -19522,6 +19528,8 @@ self: super: with self; {
urllib3 = callPackage ../development/python-modules/urllib3 { };
urllib3-future = callPackage ../development/python-modules/urllib3-future { };
urlman = callPackage ../development/python-modules/urlman { };
urlmatch = callPackage ../development/python-modules/urlmatch { };
@@ -19848,6 +19856,8 @@ self: super: with self; {
wasserstein = callPackage ../development/python-modules/wasserstein { };
wassima = callPackage ../development/python-modules/wassima { };
wat = callPackage ../development/python-modules/wat { };
watchdog = callPackage ../development/python-modules/watchdog { };