forked from mirrors/nixpkgs
python3Packages.Cerberus: fix build
The pypi sources don't contain everything required to run tests.
This commit is contained in:
parent
de71eb8973
commit
7f43a41cb3
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue