GNU bug report logs - #70976
[PATCH] gnu: Add python-augeas.

Previous Next

Package: guix-patches;

Reported by: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>

Date: Thu, 16 May 2024 10:37:02 UTC

Severity: normal

Tags: patch

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

To reply to this bug, email your comments to 70976 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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

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


Report forwarded to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, tanguy <at> bioneland.org, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#70976; Package guix-patches. (Thu, 16 May 2024 10:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>:
New bug report received and forwarded. Copy sent to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, tanguy <at> bioneland.org, jgart <at> dismail.de, guix-patches <at> gnu.org. (Thu, 16 May 2024 10:37:02 GMT) Full text and rfc822 format available.

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

From: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>
Subject: [PATCH] gnu: Add python-augeas.
Date: Thu, 16 May 2024 13:35:53 +0300
* gnu/packages/python-xyz.scm (python-augeas): New variable.

Change-Id: Id1c1b87c9f5897583560f70243ef060b10eac4d4
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ddc697f71b..da0edd47bd 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -414,6 +414,32 @@ (define-public python-awkward-cpp
 package.  It is not useful on its own, only as a dependency for awkward.")
     (license license:bsd-3)))
 
+(define-public python-augeas
+  (package
+    (name "python-augeas")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-augeas" version))
+       (sha256
+        (base32 "131vzy7bnnqdglz6hd79zkkdqfbyz0rxhwsz0mbzq3xlhsga952i"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'build 'configure-environment
+                     (lambda _
+                       (setenv "LD_LIBRARY_PATH"
+                               (string-append #$(this-package-input "augeas")
+                                              "/lib")))))))
+    (propagated-inputs (list augeas python-cffi))
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/hercules-team/python-augeas")
+    (synopsis "Python bindings for Augeas")
+    (description "Pure Python bindings for @url{https://augeas.net, Augeas}.")
+    (license license:lgpl2.1)))
+
 (define-public python-awkward
   (package
     (name "python-awkward")

base-commit: 5a624adfd7b14c3717237d137bd0766c77f0f570
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70976; Package guix-patches. (Thu, 16 May 2024 19:58:02 GMT) Full text and rfc822 format available.

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

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 70976 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add python-augeas.
Date: Thu, 16 May 2024 20:55:54 +0100
[Message part 1 (text/plain, inline)]
Hi,

Thank you for the patch.

I've got some review points.

Try to avoid to modify LD_LIBRARY_PATH
--8<---------------cut here---------------start------------->8---
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'build 'configure-environment
+                     (lambda _
+                       (setenv "LD_LIBRARY_PATH"
+                               (string-append #$(this-package-input "augeas")
+                                              "/lib")))))))
--8<---------------cut here---------------end--------------->8---

As you may check, the project silently uses pkg-config, xml2-config
which provide library search:
https://github.com/hercules-team/python-augeas/blob/a1e84a7e58e535658f681731b66eca7b71c095a2/augeas/ffi.py#L6C1-L8C60
--8<---------------cut here---------------start------------->8--- def
get_include_dirs(): XML2_CONFIG = os.environ.get('XML2_CONFIG',
'xml2-config') PKG_CONFIG = os.environ.get('PKG_CONFIG', 'pkg-config')
--8<---------------cut here---------------end--------------->8---

In that light, augeas needs to be placed in inputs and 2 packages need
to be added to native-inputs (pkg-config, and maybe libxml2):
--8<---------------cut here---------------start------------->8---
+    (propagated-inputs (list augeas python-cffi))
--8<---------------cut here---------------end--------------->8---

In general for the python packages, similar like for the golang -
propagated-inputs is a place for any modules (they are just sources and)
requuring during runtime of the project you may check it like this:
--8<---------------cut here---------------start------------->8---
guix shell python-<name> python -- python3 'import <nmae>'
--8<---------------cut here---------------end--------------->8---

Nix has 100k packages, and may provide some insight on which inputs and
where the package expects ;-)
https://github.com/NixOS/nixpkgs/blob/nixos-23.11/pkgs/development/python-modules/augeas/default.nix#L34


--
Oleg
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#70976; Package guix-patches. (Fri, 17 May 2024 12:26:02 GMT) Full text and rfc822 format available.

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

From: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>
To: 70976 <at> debbugs.gnu.org
Cc: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>
Subject: [PATCH v2 1/2] gnu: augeas: Update to 1.14.1.
Date: Fri, 17 May 2024 15:24:04 +0300
* gnu/packages/augeas.scm (augeas): Update to 1.14.1.
  [source]: Use tarballs from GitHub.
  [inputs]: Change to "native-inputs".  Add readline.

Change-Id: I9ca46b8a50d11c75ff6d816f2f15e1f005877244
---
 gnu/packages/augeas.scm | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/augeas.scm b/gnu/packages/augeas.scm
index 2fd933604c..edea5e19c3 100644
--- a/gnu/packages/augeas.scm
+++ b/gnu/packages/augeas.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017, 2018 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2017 Eric Bavier <bavier <at> member.fsf.org>
 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +22,7 @@
 
 (define-module (gnu packages augeas)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix utils)
@@ -33,22 +35,24 @@ (define-module (gnu packages augeas)
 (define-public augeas
   (package
     (name "augeas")
-    (version "1.12.0")
+    (version "1.14.1")
     (source (origin
+              ;; XXX: Released archives have pre-generated "configure" script that
+              ;;      allows to simplify the package definition.
               (method url-fetch)
-              (uri (string-append "http://download.augeas.net/augeas-"
-                                  version ".tar.gz"))
+              (uri
+               (string-append
+                "https://github.com/hercules-team/augeas/releases/download/"
+                "release-" version
+                "/augeas-" version ".tar.gz"))
               (sha256
                (base32
-                "11ybhb13wkkilsn7b416a1dn61m1xrq0lbdpkhp5w61jrk4l469j"))))
+                "1zzdp5bwnszza5q6cjw66hkicay8b49n5pda7cbcgfg4hbbzv2rn"))))
     (build-system gnu-build-system)
-    ;; Marked as "required" in augeas.pc.
     (propagated-inputs
      (list libxml2))
-    (inputs
-     (list readline))
     (native-inputs
-     (list pkg-config))
+     (list readline pkg-config))
     (home-page "https://augeas.net")
     (synopsis "Edit configuration files programmatically")
     (description

base-commit: 5a624adfd7b14c3717237d137bd0766c77f0f570
-- 
2.41.0





Information forwarded to lars <at> 6xq.net, marius <at> gnu.org, me <at> bonfacemunyoki.com, sharlatanus <at> gmail.com, tanguy <at> bioneland.org, jgart <at> dismail.de, guix-patches <at> gnu.org:
bug#70976; Package guix-patches. (Fri, 17 May 2024 12:26:02 GMT) Full text and rfc822 format available.

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

From: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>
To: 70976 <at> debbugs.gnu.org
Cc: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>
Subject: [PATCH v2 2/2] gnu: Add python-augeas.
Date: Fri, 17 May 2024 15:24:05 +0300
* gnu/packages/python-xyz.scm (python-augeas): New variable.

Change-Id: I46d409debfbc358f0ff27c505fba089ceab4e195
---
 gnu/packages/python-xyz.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ddc697f71b..1e259724ae 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -176,6 +176,7 @@ (define-module (gnu packages python-xyz)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages astronomy)
   #:use-module (gnu packages attr)
+  #:use-module (gnu packages augeas)
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
@@ -414,6 +415,36 @@ (define-public python-awkward-cpp
 package.  It is not useful on its own, only as a dependency for awkward.")
     (license license:bsd-3)))
 
+(define-public python-augeas
+  (package
+    (name "python-augeas")
+    (version "1.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/hercules-team/python-augeas")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1l17gl23f5naram1jaab7gjr9bhjdj97fd9sydvs7cmpns91rbrf"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'wrap)
+                   (add-before 'check 'configure-environment
+                     (lambda _
+                       (setenv "LD_LIBRARY_PATH"
+                               (string-append #$(this-package-input "augeas")
+                                              "/lib")))))))
+    (native-inputs (list python-pytest python-cffi pkg-config))
+    (inputs (list augeas libxml2))
+    (home-page "https://github.com/hercules-team/python-augeas")
+    (synopsis "Python bindings for Augeas")
+    (description "Pure Python bindings for @url{https://augeas.net, Augeas}.")
+    (license license:lgpl2.1)))
+
 (define-public python-awkward
   (package
     (name "python-awkward")
-- 
2.41.0





Reply sent to Sharlatan Hellseher <sharlatanus <at> gmail.com>:
You have taken responsibility. (Wed, 22 May 2024 23:52:01 GMT) Full text and rfc822 format available.

Notification sent to "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com>:
bug acknowledged by developer. (Wed, 22 May 2024 23:52:02 GMT) Full text and rfc822 format available.

Message #19 received at 70976-done <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 70976-done <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add python-augeas.
Date: Thu, 23 May 2024 00:50:14 +0100
[Message part 1 (text/plain, inline)]
Hi,

I've placed python-augeas to (gnu packages augeas)  module next to
augeas package and slightly adjust it to make it pass the tests.

Pushed as ee86a504e9..8f0b5e35f3 to master.

--
Oleg
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 9 days ago.

Previous Next


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