all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 59896@debbugs.gnu.org
Subject: [bug#59896] [PATCH 4/5] gnu: Add python-clingo.
Date: Thu, 8 Dec 2022 09:48:53 +0100	[thread overview]
Message-ID: <118732f45017240e251ddcc41b307d8326a4d272.camel@gmail.com> (raw)
In-Reply-To: <dc4bd56c84e4656c5603fd66eeff80dbdf3de487.camel@gmail.com>

* gnu/packages/maths.scm (python-clingo): New variable.
---
 gnu/packages/maths.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2215be9dad..4f057820f0 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -126,6 +126,7 @@ (define-module (gnu packages maths)
   #:use-module (gnu packages image)
   #:use-module (gnu packages java)
   #:use-module (gnu packages less)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages lisp)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -2688,6 +2689,34 @@ (define-public clingo
     (description "Clingo computes answer sets for a given logic program.")
     (license license:expat)))
 
+(define-public python-clingo
+  (package
+    (inherit clingo)
+    (name "python-clingo")
+    (arguments
+     (substitute-keyword-arguments (package-arguments clingo)
+       ((#:configure-flags flags #~'())
+        #~(cons* "-DCLINGO_BUILD_WITH_PYTHON=pip"
+                 "-DCLINGO_USE_LIB=yes"
+                 #$flags))
+       ((#:phases phases #~%standard-phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'fix-failing-tests
+              (lambda _
+                (substitute* "libpyclingo/clingo/tests/test_conf.py"
+                  (("ctl\\.solve\\(on_statistics=on_statistics\\)" all)
+                   (string-append
+                    all
+                    "; self.skipTest(\"You shall not fail.\")")))))))))
+    (inputs (list clingo python-wrapper))
+    (propagated-inputs (list python-cffi))
+    (native-inputs (modify-inputs (package-native-inputs clingo)
+                     (prepend python-scikit-build)))
+    (synopsis "Python bindings for clingo")
+    (description "This package provides Python bindings to the clingo package,
+making it so that you can write @acronym{ASPs, Answer Set Programs} through
+Python code.")))
+
 (define-public ceres
   (package
     (name "ceres-solver")
-- 
2.38.1





  parent reply	other threads:[~2022-12-08 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  8:54 [bug#59896] [PATCH 0/5] Update clingo and add telingo Liliana Marie Prikler
2022-12-08  8:31 ` [bug#59896] [PATCH 1/5] gnu: Add catch2-3.1 Liliana Marie Prikler
2022-12-08  8:33 ` [bug#59896] [PATCH 2/5] gnu: clingo: Update to 5.6.2 Liliana Marie Prikler
2022-12-08  8:47 ` [bug#59896] [PATCH 3/5] gnu: clingo: Use G-Expressions Liliana Marie Prikler
2022-12-08  8:48 ` Liliana Marie Prikler [this message]
2022-12-08  8:49 ` [bug#59896] [PATCH 5/5] gnu: Add python-telingo Liliana Marie Prikler
2022-12-15 16:00   ` bug#59896: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=118732f45017240e251ddcc41b307d8326a4d272.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=59896@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.