Files
nixpkgs/pkgs/development/python-modules/mocket/default.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01: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.14.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-68bjR5lf1sKxShM4p3Fm7ff8HvmTk2Fdz53CwfHI9Q8=";
};
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.concatAttrValues 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 = {
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 = lib.licenses.bsd3;
maintainers = [ ];
};
}