Files
nixpkgs/pkgs/development/python-modules/mocket/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

107 lines
1.9 KiB
Nix

{
lib,
buildPythonPackage,
stdenv,
fetchPypi,
# build-system
hatchling,
# dependencies
decorator,
h11,
puremagic,
urllib3,
# optional-dependencies
xxhash,
pook,
# tests
aiohttp,
asgiref,
fastapi,
gevent,
httpx,
psutil,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
redis,
redisTestHook,
requests,
sure,
}:
buildPythonPackage rec {
pname = "mocket";
version = "3.13.11";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-kdG2Md90YknRA265u+JjHuiKw/6h1NcdwYOLXy8UF1o=";
};
build-system = [ hatchling ];
dependencies = [
decorator
h11
puremagic
urllib3
];
optional-dependencies = {
pook = [ pook ];
speedups = [ xxhash ];
};
nativeCheckInputs = [
aiohttp
asgiref
fastapi
gevent
httpx
psutil
pytest-asyncio
pytest-cov-stub
pytestCheckHook
redis
redisTestHook
requests
sure
]
++ lib.flatten (lib.attrValues optional-dependencies);
# Skip http tests, they require network access
env.SKIP_TRUE_HTTP = true;
__darwinAllowLocalNetworking = true;
disabledTests = [
# tests that require network access (like DNS lookups)
"test_truesendall_with_dump_from_recording"
"test_aiohttp"
"test_asyncio_record_replay"
"test_gethostbyname"
# httpx read failure
"test_no_dangling_fds"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# fails on darwin due to upstream bug: https://github.com/mindflayer/python-mocket/issues/287
"test_httprettish_httpx_session"
];
pythonImportsCheck = [ "mocket" ];
meta = with lib; {
changelog = "https://github.com/mindflayer/python-mocket/releases/tag/${version}";
description = "Socket mock framework for all kinds of sockets including web-clients";
homepage = "https://github.com/mindflayer/python-mocket";
license = licenses.bsd3;
maintainers = [ ];
};
}