GNU bug report logs - #68713
[PATCH 0/4] More clingo stuff.

Previous Next

Package: guix-patches;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Thu, 25 Jan 2024 10:28:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 68713 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#68713; Package guix-patches. (Thu, 25 Jan 2024 10:28:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 25 Jan 2024 10:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/4] More clingo stuff.
Date: Thu, 25 Jan 2024 11:25:50 +0100
Hi Guix,

this series adds Lua bindings for clingo and some more python-based
extensions.

Cheers

Liliana Marie Prikler (4):
  gnu: Add python-clingo-dl.
  gnu: python-clorm: Reindent with emacs.
  gnu: Add python-plingo.
  gnu: Add lua-clingo.

 gnu/packages/potassco.scm | 156 ++++++++++++++++++++++++++++++--------
 1 file changed, 126 insertions(+), 30 deletions(-)


base-commit: 2266754382bce43789976aec65181cb5085c8bc4
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68713; Package guix-patches. (Fri, 26 Jan 2024 05:21:02 GMT) Full text and rfc822 format available.

Message #8 received at 68713 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 68713 <at> debbugs.gnu.org
Subject: [PATCH 1/4] gnu: Add python-clingo-dl.
Date: Thu, 25 Jan 2024 10:42:06 +0100
* gnu/packages/potassco.scm (python-clingo-dl): New variable.
---
 gnu/packages/potassco.scm | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index f2ee27db99..afc4c4d513 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2022, 2023 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
+;;; Copyright © 2022–2024 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;; Copyright © 2023 David Elsing <david.elsing <at> posteo.net>
 ;;; Copyright © 2024 Ricardo Wurmus <rekado <at> elephly.net>
@@ -370,6 +370,40 @@ (define-public python-clingo
 making it so that you can write @acronym{ASPs, Answer Set Programs} through
 Python code.")))
 
+(define-public python-clingo-dl
+  (package
+    (inherit clingo-dl)
+    (name "python-clingo-dl")
+    (version (package-version clingo-dl))
+    (arguments
+     (list
+      #:configure-flags #~'("-DPYCLINGODL_ENABLE=pip")
+      #:tests? #f
+      #:imported-modules  `(,@%cmake-build-system-modules
+                            (guix build python-build-system))
+      #:modules '((guix build cmake-build-system)
+                  ((guix build python-build-system) #:prefix python:)
+                  (guix build utils))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'install 'install-distinfo
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (with-directory-excursion (python:site-packages inputs outputs)
+                (let ((dir (string-append "clingodl-" #$version ".dist-info")))
+                  (mkdir-p dir)
+                  (call-with-output-file (string-append dir "/METADATA")
+                    (lambda (port)
+                      (format port "Metadata-Version: 1.1~%")
+                      (format port "Name: clingodl~%")
+                      (format port "Version: ~a~%" #$version))))))))))
+    (inputs (modify-inputs (package-inputs clingo-dl)
+              (prepend python-wrapper)))
+    (propagated-inputs (list python-clingo python-cffi))
+    (synopsis "Python bindings for clingo-dl")
+    (description "This package allows users to add the clingo-dl propagator
+as a theory to clingo from Python code.  It also supports running clingo-dl
+directly from the python command line.")))
+
 (define-public python-clorm
   (package
    (name "python-clorm")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68713; Package guix-patches. (Fri, 26 Jan 2024 05:21:03 GMT) Full text and rfc822 format available.

Message #11 received at 68713 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 68713 <at> debbugs.gnu.org
Subject: [PATCH 2/4] gnu: python-clorm: Reindent with emacs.
Date: Thu, 25 Jan 2024 10:44:44 +0100
* gnu/packages/potassco.scm (python-clorm): Reindent with emacs.
---
 gnu/packages/potassco.scm | 58 +++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index afc4c4d513..0ec6253099 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -406,38 +406,38 @@ (define-public python-clingo-dl
 
 (define-public python-clorm
   (package
-   (name "python-clorm")
-   (version "1.4.1")
-   (source (origin
-            (method git-fetch)
-            (uri (git-reference
-                  (url "https://github.com/potassco/clorm")
-                  (commit (string-append "v" version))))
-            (file-name (git-file-name name version))
-            (sha256
-             (base32
-              "0jx99y71mrgdicn1da5dwz5nzgvvpabrikff783sg4shbv2cf0b5"))))
-   (build-system pyproject-build-system)
-   (arguments
-    (list #:phases
-          #~(modify-phases %standard-phases
-              (add-before 'check 'fix-breaking-tests
-                (lambda _
-                  ;; noclingo tests rely on this being set
-                  (setenv "CLORM_NOCLINGO" "1")
-                  (delete-file "tests/test_mypy_query.py")
-                  (substitute* "tests/test_clingo.py"
-                    (("self\\.assertTrue\\(os_called\\)" all)
-                     (string-append "# " all))))))))
-   (propagated-inputs (list python-clingo))
-   (native-inputs (list python-typing-extensions))
-   (home-page "https://potassco.org")
-   (synopsis "Object relational mapping to clingo")
-   (description "@acronym{Clorm, Clingo ORM} provides an @acronym{ORM,
+    (name "python-clorm")
+    (version "1.4.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/potassco/clorm")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0jx99y71mrgdicn1da5dwz5nzgvvpabrikff783sg4shbv2cf0b5"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'check 'fix-breaking-tests
+                 (lambda _
+                   ;; noclingo tests rely on this being set
+                   (setenv "CLORM_NOCLINGO" "1")
+                   (delete-file "tests/test_mypy_query.py")
+                   (substitute* "tests/test_clingo.py"
+                     (("self\\.assertTrue\\(os_called\\)" all)
+                      (string-append "# " all))))))))
+    (propagated-inputs (list python-clingo))
+    (native-inputs (list python-typing-extensions))
+    (home-page "https://potassco.org")
+    (synopsis "Object relational mapping to clingo")
+    (description "@acronym{Clorm, Clingo ORM} provides an @acronym{ORM,
 Object Relational Mapping} interface to the @acronym{ASP, answer set
 programming} solver clingo.  Its goal is to make integration of clingo
 into Python programs easier.")
-   (license license:expat)))
+    (license license:expat)))
 
 (define-public python-telingo
   (package
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68713; Package guix-patches. (Fri, 26 Jan 2024 05:21:03 GMT) Full text and rfc822 format available.

Message #14 received at 68713 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 68713 <at> debbugs.gnu.org
Subject: [PATCH 3/4] gnu: Add python-plingo.
Date: Thu, 25 Jan 2024 10:46:07 +0100
* gnu/packages/potassco.scm (python-plingo): New variable.
---
 gnu/packages/potassco.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index 0ec6253099..81d7cfa7e2 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -439,6 +439,44 @@ (define-public python-clorm
 into Python programs easier.")
     (license license:expat)))
 
+(define-public python-plingo
+  (package
+    (name "python-plingo")
+    (version "1.0.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/potassco/plingo")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1mp0pdjzwpl7bpba20iwszx9x49gsyl2rhrp7w7xpwjqdjrp23r8"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'install 'install-script
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let ((script (string-append (assoc-ref outputs "out")
+                                                "/bin/plingo")))
+                     (mkdir-p (dirname script))
+                     (call-with-output-file script
+                       (lambda (port)
+                         (display "#!/usr/bin/env python\n" port)
+                         (display "from plingo import main\n" port)
+                         (display "main()\n" port)))
+                     (chmod script #o755)
+                     ;; XXX: Does this cross-compile?
+                     (patch-shebang script)))))))
+    (propagated-inputs (list python-clingo))
+    (home-page "https://potassco.org/")
+    (synopsis "Solve probabilistic logic programs")
+    (description "This package provides a system to solve probabilistic
+logic programs with clingo.  It can solve the reasoning tasks of finding
+the most probable model as well as finding all models and their probabilities.")
+    (license license:expat)))
+
 (define-public python-telingo
   (package
     (name "python-telingo")
-- 
2.41.0





This bug report was last modified 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.