Skip to content

Commit

Permalink
pythonPackages.cached-property: fix tests
Browse files Browse the repository at this point in the history
Need to fetch from GitHub because conftest.py is necessary to disable some tests for Python 2.
  • Loading branch information
Robert Schütz committed Feb 26, 2018
1 parent a367095 commit f760fcb
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions pkgs/development/python-modules/cached-property/default.nix
@@ -1,19 +1,28 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, pytest
, freezegun
}:

buildPythonPackage rec {
pname = "cached-property";
version = "1.4.0";

src = fetchPypi {
inherit pname version;
sha256 = "a2fa0f89dd422f7e5dd992a4a3e0ce209d5d1e47a4db28fd0a7b5273ec8da3f0";
# conftest.py is missing in PyPI tarball
# https://github.com/pydanny/cached-property/pull/87
src = fetchFromGitHub {
owner = "pydanny";
repo = pname;
rev = version;
sha256 = "0w7709grs4yqhfbnn7lva2fgyphvh43xcfqhi95lhh8sjad3xwkw";
};

checkInputs = [ freezegun ];
checkInputs = [ pytest freezegun ];

checkPhase = ''
py.test
'';

meta = {
description = "A decorator for caching properties in classes";
Expand All @@ -22,4 +31,4 @@ buildPythonPackage rec {
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ ericsagnes ];
};
}
}

0 comments on commit f760fcb

Please sign in to comment.