2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
|
|
|
aiomcache,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
marshmallow,
|
|
|
|
msgpack,
|
|
|
|
pkgs,
|
|
|
|
pytest-asyncio,
|
2024-10-04 16:56:33 +00:00
|
|
|
pytest-cov-stub,
|
2024-06-05 15:53:02 +00:00
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
2024-10-04 16:56:33 +00:00
|
|
|
pythonOlder,
|
2024-06-05 15:53:02 +00:00
|
|
|
redis,
|
|
|
|
setuptools,
|
2021-02-22 21:28:39 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aiocache";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "0.12.3";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-02-22 21:28:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aio-libs";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "aiocache";
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-4QYCRXMWlt9fsiWgUTc2pKzXG7AG/zGmd4HT5ggIZNM=";
|
2021-02-22 21:28:39 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
redis = [ redis ];
|
|
|
|
memcached = [ aiomcache ];
|
|
|
|
msgpack = [ msgpack ];
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
2021-02-22 21:28:39 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
aiohttp
|
|
|
|
marshmallow
|
|
|
|
pytest-asyncio
|
2024-10-04 16:56:33 +00:00
|
|
|
pytest-cov-stub
|
2024-05-15 15:35:15 +00:00
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ lib.flatten (lib.attrValues optional-dependencies);
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
2024-06-05 15:53:02 +00:00
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
2024-05-15 15:35:15 +00:00
|
|
|
# TypeError: object MagicMock can't be used in 'await' expression
|
|
|
|
"--deselect=tests/ut/backends/test_redis.py::TestRedisBackend::test_close"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2024-06-05 15:53:02 +00:00
|
|
|
# Test calls apache benchmark and fails, no usable output
|
2024-05-15 15:35:15 +00:00
|
|
|
"test_concurrency_error_rates"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Benchmark and performance tests are not relevant for Nixpkgs
|
|
|
|
"tests/performance/"
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
preCheck = ''
|
|
|
|
${lib.getBin pkgs.redis}/bin/redis-server &
|
|
|
|
REDIS_PID=$!
|
|
|
|
|
|
|
|
${lib.getBin pkgs.memcached}/bin/memcached &
|
|
|
|
MEMCACHED_PID=$!
|
|
|
|
'';
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
kill $REDIS_PID
|
|
|
|
kill $MEMCACHED_PID
|
|
|
|
'';
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true;
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "aiocache" ];
|
2021-02-22 21:28:39 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python API Rate Limit Decorator";
|
2023-02-16 17:41:37 +00:00
|
|
|
homepage = "https://github.com/aio-libs/aiocache";
|
|
|
|
changelog = "https://github.com/aio-libs/aiocache/releases/tag/v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = licenses.bsd3;
|
2021-02-22 21:28:39 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|