all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#70976] [PATCH] gnu: Add python-augeas.
@ 2024-05-16 10:35 Artyom V. Poptsov
  2024-05-16 19:55 ` Sharlatan Hellseher
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Artyom V. Poptsov @ 2024-05-16 10:35 UTC (permalink / raw)
  To: 70976
  Cc: Artyom V. Poptsov, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* 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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#70976] [PATCH] gnu: Add python-augeas.
  2024-05-16 10:35 [bug#70976] [PATCH] gnu: Add python-augeas Artyom V. Poptsov
@ 2024-05-16 19:55 ` Sharlatan Hellseher
  2024-05-17 12:24 ` [bug#70976] [PATCH v2 1/2] gnu: augeas: Update to 1.14.1 Artyom V. Poptsov
  2024-05-22 23:50 ` bug#70976: [PATCH] " Sharlatan Hellseher
  2 siblings, 0 replies; 5+ messages in thread
From: Sharlatan Hellseher @ 2024-05-16 19:55 UTC (permalink / raw)
  To: 70976

[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]


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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#70976] [PATCH v2 1/2] gnu: augeas: Update to 1.14.1.
  2024-05-16 10:35 [bug#70976] [PATCH] gnu: Add python-augeas Artyom V. Poptsov
  2024-05-16 19:55 ` Sharlatan Hellseher
@ 2024-05-17 12:24 ` Artyom V. Poptsov
  2024-05-17 12:24   ` [bug#70976] [PATCH v2 2/2] gnu: Add python-augeas Artyom V. Poptsov
  2024-05-22 23:50 ` bug#70976: [PATCH] " Sharlatan Hellseher
  2 siblings, 1 reply; 5+ messages in thread
From: Artyom V. Poptsov @ 2024-05-17 12:24 UTC (permalink / raw)
  To: 70976; +Cc: Artyom V. Poptsov

* 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@flashner.co.il>
 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#70976] [PATCH v2 2/2] gnu: Add python-augeas.
  2024-05-17 12:24 ` [bug#70976] [PATCH v2 1/2] gnu: augeas: Update to 1.14.1 Artyom V. Poptsov
@ 2024-05-17 12:24   ` Artyom V. Poptsov
  0 siblings, 0 replies; 5+ messages in thread
From: Artyom V. Poptsov @ 2024-05-17 12:24 UTC (permalink / raw)
  To: 70976
  Cc: Artyom V. Poptsov, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* 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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#70976: [PATCH] gnu: Add python-augeas.
  2024-05-16 10:35 [bug#70976] [PATCH] gnu: Add python-augeas Artyom V. Poptsov
  2024-05-16 19:55 ` Sharlatan Hellseher
  2024-05-17 12:24 ` [bug#70976] [PATCH v2 1/2] gnu: augeas: Update to 1.14.1 Artyom V. Poptsov
@ 2024-05-22 23:50 ` Sharlatan Hellseher
  2 siblings, 0 replies; 5+ messages in thread
From: Sharlatan Hellseher @ 2024-05-22 23:50 UTC (permalink / raw)
  To: 70976-done

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]


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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-22 23:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16 10:35 [bug#70976] [PATCH] gnu: Add python-augeas Artyom V. Poptsov
2024-05-16 19:55 ` Sharlatan Hellseher
2024-05-17 12:24 ` [bug#70976] [PATCH v2 1/2] gnu: augeas: Update to 1.14.1 Artyom V. Poptsov
2024-05-17 12:24   ` [bug#70976] [PATCH v2 2/2] gnu: Add python-augeas Artyom V. Poptsov
2024-05-22 23:50 ` bug#70976: [PATCH] " Sharlatan Hellseher

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.