1 { lib, buildPythonPackage, fetchFromGitHub, python, requests }:
5 json-ld = fetchFromGitHub {
8 rev = "843a70e4523d7cd2a4d3f5325586e726eb1b123f";
9 sha256 = "05j0nq6vafclyypxjj30iw898ig0m32nvz0rjdlslx6lawkiwb2a";
12 normalization = fetchFromGitHub {
14 repo = "normalization";
15 rev = "aceeaf224b64d6880189d795bd99c3ffadb5d79e";
16 sha256 = "125q5rllfm8vg9mz8hn7bhvhv2vqpd86kx2kxlk84smh33l8kbyl";
21 buildPythonPackage rec {
24 format = "setuptools";
26 src = fetchFromGitHub {
27 owner = "digitalbazaar";
30 sha256 = "0z2vkllw8bvzxripwb6l757r7av5qwhzsiy4061gmlhq8z8gq961";
33 propagatedBuildInputs = [ requests ];
35 # Unfortunately PyLD does not pass all testcases in the JSON-LD corpus. We
36 # check for at least a minimum amount of successful tests so we know it's not
37 # getting worse, at least.
41 if ! ${python.interpreter} tests/runtests.py -d ${json-ld}/test-suite 2>&1 | tee test.out; then
42 ok_count=$(grep -F '... ok' test.out | wc -l)
43 if [[ $ok_count -lt $ok_min ]]; then
44 echo "Less than $ok_min tests passed ($ok_count). Failing the build."
49 ${python.interpreter} tests/runtests.py -d ${normalization}/tests
53 description = "Python implementation of the JSON-LD API";
54 homepage = "https://github.com/digitalbazaar/pyld";
55 license = licenses.bsd3;
56 maintainers = with maintainers; [ apeschar ];