1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 dill,
6 coverage,
7 coveralls,
8 mock,
9 nose,
10}:
11
12buildPythonPackage rec {
13 pname = "expiringdict";
14 version = "1.2.2";
15 format = "setuptools";
16
17 # use fetchFromGitHub instead of fetchPypi because the test suite of
18 # the package is not included into the PyPI tarball
19 src = fetchFromGitHub {
20 owner = "mailgun";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-vRhJSHIqc51I+s/wndtfANM44CKW3QS1iajqyoSBf0I=";
24 };
25
26 nativeCheckInputs = [
27 dill
28 coverage
29 coveralls
30 mock
31 nose
32 ];
33
34 checkPhase = ''
35 runHook preCheck
36 nosetests -v --with-coverage --cover-package=expiringdict
37 runHook postCheck
38 '';
39
40 pythonImportsCheck = [ "expiringdict" ];
41
42 meta = with lib; {
43 description = "Dictionary with auto-expiring values for caching purposes";
44 homepage = "https://github.com/mailgun/expiringdict";
45 license = licenses.asl20;
46 maintainers = with maintainers; [ gravndal ];
47 };
48}