about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDrew Risinger <drewrisinger@users.noreply.github.com>2020-01-21 13:19:01 -0500
committerJon <jonringer@users.noreply.github.com>2020-02-12 07:24:51 -0800
commit0a5108d00221a98a61a84dbf2c6f2aa86a1c9733 (patch)
treea3c9715ead21cf74f696c0ad318bc479dcee9517 /pkgs
parenta279b685718bb31af9e61697a1f4ff70aacdff14 (diff)
downloadnixlib-0a5108d00221a98a61a84dbf2c6f2aa86a1c9733.tar
nixlib-0a5108d00221a98a61a84dbf2c6f2aa86a1c9733.tar.gz
nixlib-0a5108d00221a98a61a84dbf2c6f2aa86a1c9733.tar.bz2
nixlib-0a5108d00221a98a61a84dbf2c6f2aa86a1c9733.tar.lz
nixlib-0a5108d00221a98a61a84dbf2c6f2aa86a1c9733.tar.xz
nixlib-0a5108d00221a98a61a84dbf2c6f2aa86a1c9733.tar.zst
nixlib-0a5108d00221a98a61a84dbf2c6f2aa86a1c9733.zip
pythonPackages.dlx: init at 1.0.4
Python implementation of Donald Knuth's Dancing Links (exact cover)
algorithm.

Requirement of qiskit-aqua.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/dlx/default.nix33
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/dlx/default.nix b/pkgs/development/python-modules/dlx/default.nix
new file mode 100644
index 000000000000..81ae3deda624
--- /dev/null
+++ b/pkgs/development/python-modules/dlx/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "dlx";
+  version = "1.0.4";
+
+  # untagged releases
+  src = fetchFromGitHub {
+    owner = "sraaphorst";
+    repo = "dlx_python";
+    rev = "02d1ed534df60513095633da07e67a6593b9e9b4";
+    sha256 = "0c6dblbypwmx6yrk9qxp157m3cd7lq3j411ifr3shscv1igxv5hk";
+  };
+
+  # No test suite, so just run an example
+  pythonImportsCheck = [ "dlx" ];
+  # ./examples/design.py requires pyncomb, not in tree
+  checkPhase = ''
+    # example sudoku board from ./examples/sudoku.py
+    ${python.interpreter} ./examples/sudoku.py 3 "070285010008903500000000000500010008010000090900040003000000000002408600090632080"
+  '';
+
+  meta = with lib; {
+    description = "Implementation of Donald Knuth's Dancing Links algorithm";
+    homepage = "https://github.com/sraaphorst/dlx_python";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ drewrisinger ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 07d88e411d39..9a8136a7032e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -2514,6 +2514,8 @@ in {
 
   discogs_client = callPackage ../development/python-modules/discogs_client { };
 
+  dlx = callPackage ../development/python-modules/dlx { };
+
   dmenu-python = callPackage ../development/python-modules/dmenu { };
 
   dnslib = callPackage ../development/python-modules/dnslib { };