3
0
Fork 0
forked from mirrors/nixpkgs

python3Packages.Cerberus: fix build

The pypi sources don't contain everything required to run tests.
This commit is contained in:
Martin Weinelt 2021-06-19 13:15:17 +02:00
parent de71eb8973
commit 7f43a41cb3

View file

@ -1,20 +1,38 @@
{ lib, buildPythonPackage, fetchPypi, pytestrunner, pytest }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "Cerberus";
version = "1.3.4";
src = fetchPypi {
inherit pname version;
sha256 = "d1b21b3954b2498d9a79edf16b3170a3ac1021df88d197dc2ce5928ba519237c";
src = fetchFromGitHub {
owner = "pyeve";
repo = "cerberus";
rev = version;
sha256 = "03kj15cf1pbd11mxsik96m5w1m6p0fbdc4ia5ihzmq8rz28razpq";
};
checkInputs = [ pytestrunner pytest ];
checkInputs = [
pytestCheckHook
];
checkPhase = ''
pytest -k 'not nested_oneofs'
preCheck = ''
export TESTDIR=$(mktemp -d)
cp -R ./cerberus/tests $TESTDIR
pushd $TESTDIR
'';
postCheck = ''
popd
'';
pythonImportsCheck = [
"cerberus"
];
meta = with lib; {
homepage = "http://python-cerberus.org/";
description = "Lightweight, extensible schema and data validation tool for Python dictionaries";