1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cython
5, libyaml
6, isPy27
7, python
8}:
9
10buildPythonPackage rec {
11 pname = "PyYAML";
12 version = "5.4.1.1";
13
14 src = fetchFromGitHub {
15 owner = "yaml";
16 repo = "pyyaml";
17 rev = version;
18 sha256 = "1v386gzdvsjg0mgix6v03rd0cgs9dl81qvn3m547849jm8r41dx8";
19 };
20
21 nativeBuildInputs = [ cython ];
22
23 buildInputs = [ libyaml ];
24
25 checkPhase = ''
26 runHook preCheck
27 PYTHONPATH=""tests/lib":$PYTHONPATH" ${python.interpreter} -m test_all
28 runHook postCheck
29 '';
30
31 pythonImportsCheck = [ "yaml" ];
32
33 meta = with lib; {
34 description = "The next generation YAML parser and emitter for Python";
35 homepage = "https://github.com/yaml/pyyaml";
36 license = licenses.mit;
37 };
38}