summary refs log tree commit diff
path: root/pkgs/development/python2-modules/pyyaml/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python2-modules/pyyaml/default.nix')
-rw-r--r--pkgs/development/python2-modules/pyyaml/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/development/python2-modules/pyyaml/default.nix b/pkgs/development/python2-modules/pyyaml/default.nix
new file mode 100644
index 00000000000..3edfae90e66
--- /dev/null
+++ b/pkgs/development/python2-modules/pyyaml/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, cython
+, libyaml
+, isPy27
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "PyYAML";
+  version = "5.4.1.1";
+
+  src = fetchFromGitHub {
+    owner = "yaml";
+    repo = "pyyaml";
+    rev = version;
+    sha256 = "1v386gzdvsjg0mgix6v03rd0cgs9dl81qvn3m547849jm8r41dx8";
+  };
+
+  nativeBuildInputs = [ cython ];
+
+  buildInputs = [ libyaml ];
+
+  checkPhase = ''
+    runHook preCheck
+    PYTHONPATH=""tests/lib":$PYTHONPATH" ${python.interpreter} -m test_all
+    runHook postCheck
+  '';
+
+  pythonImportsCheck = [ "yaml" ];
+
+  meta = with lib; {
+    description = "The next generation YAML parser and emitter for Python";
+    homepage = "https://github.com/yaml/pyyaml";
+    license = licenses.mit;
+  };
+}