2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
watchdog,
|
|
|
|
portalocker,
|
|
|
|
pytestCheckHook,
|
|
|
|
pymongo,
|
|
|
|
dnspython,
|
|
|
|
pymongo-inmemory,
|
|
|
|
pandas,
|
|
|
|
birch,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cachier";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "3.0.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-cachier";
|
|
|
|
repo = "cachier";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-3rKsgcJQ9RQwosVruD7H99msB8iGtAai320okrCZCTI=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pythonRemoveDeps = [ "setuptools" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2023-10-09 19:29:22 +00:00
|
|
|
watchdog
|
|
|
|
portalocker
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail \
|
2024-02-29 20:09:43 +00:00
|
|
|
'"--cov' \
|
|
|
|
'#"--cov'
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pymongo
|
|
|
|
dnspython
|
|
|
|
pymongo-inmemory
|
|
|
|
pandas
|
2024-01-13 08:15:51 +00:00
|
|
|
birch
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# touches network
|
|
|
|
"test_mongetter_default_param"
|
|
|
|
"test_stale_after_applies_dynamically"
|
|
|
|
"test_next_time_applies_dynamically"
|
|
|
|
"test_wait_for_calc_"
|
|
|
|
"test_precache_value"
|
|
|
|
"test_ignore_self_in_methods"
|
|
|
|
"test_mongo_index_creation"
|
|
|
|
"test_mongo_core"
|
|
|
|
|
|
|
|
# don't test formatting
|
|
|
|
"test_flake8"
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "cachier" ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/python-cachier/cachier";
|
|
|
|
description = "Persistent, stale-free, local and cross-machine caching for functions";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cachier";
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with lib.maintainers; [ pbsds ];
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|