[PATCH 0/2] gnu: python-pyamg: Regenerate bundled files.

  • Done
  • quality assurance status badge
Details
One participant
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Sharlatan Hellseher
Severity
normal

Debbugs page

Sharlatan Hellseher wrote 1 years ago
(address . guix-patches@gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
cover.1705876473.git.sharlatanus@gmail.com
Hi Guix,

It's follow up patch series to cover review suggestion pointed by Vinicius in

Sharlatan Hellseher (2):
gnu: Add python-cppheaderparser.
gnu: python-pyamg: Regenerate bundled files.

gnu/packages/python-science.scm | 50 +++++++++++++++++++++++++++------
gnu/packages/python-xyz.scm | 25 ++++++++++++++++-
2 files changed, 65 insertions(+), 10 deletions(-)


base-commit: d3c3922a8f5d50855165941e19a204d32469006f
--
2.41.0
Sharlatan Hellseher wrote 1 years ago
[PATCH 2/2] gnu: python-pyamg: Regenerate bundled files.
(address . 68650@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
7767b2be009f37b60aa711e089bb5f80828aff25.1705876473.git.sharlatanus@gmail.com
* gnu/packages/python-science.scm (python-pyamg)[source]: Delete
auto-generated files.
[arguments]<#:phases>: Add 'amg-core-bind-them phase to
re-generate *_bind.cpp files deleted in snippet.
[desciption]: Improve style, commit implementation details.

Change-Id: I6f68914cd912e6f4592e51c21b129847e73be847
---
gnu/packages/python-science.scm | 50 +++++++++++++++++++++++++++------
1 file changed, 41 insertions(+), 9 deletions(-)

Toggle diff (80 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index c1be6cde23..4183bd2ea2 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -465,32 +465,64 @@ (define-public python-pyamg
(source (origin
(method url-fetch)
(uri (pypi-uri "pyamg" version))
+ (modules '((guix build utils)))
+ (snippet
+ ;; Delete autogenerated files, regenerate in a phase.
+ #~(begin
+ (for-each
+ (lambda (file)
+ (delete-file (string-append "pyamg/amg_core/" file)))
+ '("air_bind.cpp"
+ "evolution_strength_bind.cpp"
+ "graph_bind.cpp"
+ "krylov_bind.cpp"
+ "linalg_bind.cpp"
+ "relaxation_bind.cpp"
+ "ruge_stuben_bind.cpp"
+ "smoothed_aggregation_bind.cpp"
+ "tests/bind_examples_bind.cpp"))))
(sha256
(base32
"0l3dliwynxyjvbgpmi2k8jqvkkw6fc00c8w69h6swhrkfh0ql12z"))))
- (build-system pyproject-build-system)
(arguments
(list
#:test-flags
;; Test installed package in order to find C++ modules.
- #~(list "--pyargs" "pyamg.tests")))
- (native-inputs (list pybind11 python-pytest python-setuptools-scm))
+ #~(list "--pyargs" "pyamg.tests")
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Regenerate the autogenerated files.
+ (add-after 'unpack 'amg-core-bind-them
+ (lambda _
+ ;; bindthem.py heavily depends on location to produce *_bind.cpp
+ ;; file, make it available in tests as well.
+ (copy-file "pyamg/amg_core/bindthem.py"
+ "pyamg/amg_core/tests/bindthem.py")
+ (with-directory-excursion "pyamg/amg_core"
+ (substitute* "bindthem.py"
+ (("/usr/bin/env python3") (which "python3")))
+ (invoke "sh" "generate.sh"))
+ (with-directory-excursion "pyamg/amg_core/tests"
+ (invoke "python" "bindthem.py" "bind_examples.h")))))))
+ (build-system pyproject-build-system)
+ (native-inputs
+ (list pybind11
+ python-cppheaderparser
+ python-pytest
+ python-pyyaml
+ python-setuptools-scm))
(propagated-inputs (list python-numpy python-scipy))
(home-page "https://github.com/pyamg/pyamg")
(synopsis "Algebraic Multigrid Solvers in Python")
(description "PyAMG is a Python library of Algebraic Multigrid
-(AMG) solvers.
-
-PyAMG features implementations of:
+(AMG) solvers. It features implementations of:
@itemize
@item Ruge-Stuben (RS) or Classical AMG
@item AMG based on Smoothed Aggregation (SA)
@item Adaptive Smoothed Aggregation (αSA)
@item Compatible Relaxation (CR)
@item Krylov methods such as CG, GMRES, FGMRES, BiCGStab, MINRES, etc.
-@end itemize
-PyAMG is primarily written in Python with supporting C++ code for
-performance critical operations.")
+@end itemize")
(license license:expat)))
(define-public python-tspex
--
2.41.0
Sharlatan Hellseher wrote 1 years ago
[PATCH 1/2] gnu: Add python-cppheaderparser.
(address . 68650@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
60563736b8f8580da7beaf156128c13057e4e3f8.1705876473.git.sharlatanus@gmail.com
* gnu/packages/python-xyz.scm (python-cppheaderparser): New variable.

Change-Id: I3c57c31a0b63212e43e1ab387b5d329c04ed0e31
---
gnu/packages/python-xyz.scm | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b23108fbf4..93e7571f78 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -94,7 +94,7 @@
;;; Copyright © 2020, 2021 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2020 EuAndreh <eu@euandre.org>
;;; Copyright © 2021, 2022 Morgan Smith <Morgan.J.Smith@outlook.com>
-;;; Copyright © 2021-2023 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2021-2024 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2021 Ellis Kenyő <me@elken.dev>
;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
@@ -8810,6 +8810,29 @@ (define-public python-cplot
complex-valued functions.")
(license license:gpl3+)))
+(define-public python-cppheaderparser
+ (package
+ (name "python-cppheaderparser")
+ (version "2.7.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "CppHeaderParser" version))
+ (sha256
+ (base32 "0hncwd9y5ayk8wa6bqhp551mcamcvh84h89ba3labc4mdm0k0arq"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:tests? #f)) ;test suite not included in the release
+ (propagated-inputs (list python-ply))
+ (home-page "http://senexcanis.com/open-source/cppheaderparser/")
+ (synopsis
+ "Parse C++ header files and generate a data structure representing the class")
+ (description
+ "CppHeaderParser is a pure python module that will parse C++ header files
+and generate a data structure representing the class.")
+ (license license:bsd-3)))
+
(define-public python-cppy
(package
(name "python-cppy")
--
2.41.0
Sharlatan Hellseher wrote 1 years ago
[PATCH v2 2/2] gnu: python-pyamg: Regenerate bundled files.
(address . 68650@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
45dea5104e4c21d970f4ca6366376062e2d95a0d.1706005796.git.sharlatanus@gmail.com
* gnu/packages/python-science.scm (python-pyamg)[source]: Delete
auto-generated files.
[arguments]<#:phases>: Add 'amg-core-bind-them phase to
re-generate *_bind.cpp files deleted in snippet.
[native-inputs]: Add python-cppheaderparser and python-pyyaml.
[description]: Improve style, omit implementation details.

Change-Id: I6f68914cd912e6f4592e51c21b129847e73be847
---
gnu/packages/python-science.scm | 50 +++++++++++++++++++++++++++------
1 file changed, 41 insertions(+), 9 deletions(-)

Toggle diff (80 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index c1be6cde23..4183bd2ea2 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -465,32 +465,64 @@ (define-public python-pyamg
(source (origin
(method url-fetch)
(uri (pypi-uri "pyamg" version))
+ (modules '((guix build utils)))
+ (snippet
+ ;; Delete autogenerated files, regenerate in a phase.
+ #~(begin
+ (for-each
+ (lambda (file)
+ (delete-file (string-append "pyamg/amg_core/" file)))
+ '("air_bind.cpp"
+ "evolution_strength_bind.cpp"
+ "graph_bind.cpp"
+ "krylov_bind.cpp"
+ "linalg_bind.cpp"
+ "relaxation_bind.cpp"
+ "ruge_stuben_bind.cpp"
+ "smoothed_aggregation_bind.cpp"
+ "tests/bind_examples_bind.cpp"))))
(sha256
(base32
"0l3dliwynxyjvbgpmi2k8jqvkkw6fc00c8w69h6swhrkfh0ql12z"))))
- (build-system pyproject-build-system)
(arguments
(list
#:test-flags
;; Test installed package in order to find C++ modules.
- #~(list "--pyargs" "pyamg.tests")))
- (native-inputs (list pybind11 python-pytest python-setuptools-scm))
+ #~(list "--pyargs" "pyamg.tests")
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Regenerate the autogenerated files.
+ (add-after 'unpack 'amg-core-bind-them
+ (lambda _
+ ;; bindthem.py heavily depends on location to produce *_bind.cpp
+ ;; file, make it available in tests as well.
+ (copy-file "pyamg/amg_core/bindthem.py"
+ "pyamg/amg_core/tests/bindthem.py")
+ (with-directory-excursion "pyamg/amg_core"
+ (substitute* "bindthem.py"
+ (("/usr/bin/env python3") (which "python3")))
+ (invoke "sh" "generate.sh"))
+ (with-directory-excursion "pyamg/amg_core/tests"
+ (invoke "python" "bindthem.py" "bind_examples.h")))))))
+ (build-system pyproject-build-system)
+ (native-inputs
+ (list pybind11
+ python-cppheaderparser
+ python-pytest
+ python-pyyaml
+ python-setuptools-scm))
(propagated-inputs (list python-numpy python-scipy))
(home-page "https://github.com/pyamg/pyamg")
(synopsis "Algebraic Multigrid Solvers in Python")
(description "PyAMG is a Python library of Algebraic Multigrid
-(AMG) solvers.
-
-PyAMG features implementations of:
+(AMG) solvers. It features implementations of:
@itemize
@item Ruge-Stuben (RS) or Classical AMG
@item AMG based on Smoothed Aggregation (SA)
@item Adaptive Smoothed Aggregation (αSA)
@item Compatible Relaxation (CR)
@item Krylov methods such as CG, GMRES, FGMRES, BiCGStab, MINRES, etc.
-@end itemize
-PyAMG is primarily written in Python with supporting C++ code for
-performance critical operations.")
+@end itemize")
(license license:expat)))
(define-public python-tspex
--
2.41.0
Sharlatan Hellseher wrote 1 years ago
[PATCH v2 1/2] gnu: Add python-cppheaderparser.
(address . 68650@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
9894a20af993d2e79aabba9e05bc0d47d333c3c4.1706005796.git.sharlatanus@gmail.com
* gnu/packages/python-xyz.scm (python-cppheaderparser): New variable.

Change-Id: I3c57c31a0b63212e43e1ab387b5d329c04ed0e31
---
gnu/packages/python-xyz.scm | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b23108fbf4..93e7571f78 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -94,7 +94,7 @@
;;; Copyright © 2020, 2021 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2020 EuAndreh <eu@euandre.org>
;;; Copyright © 2021, 2022 Morgan Smith <Morgan.J.Smith@outlook.com>
-;;; Copyright © 2021-2023 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2021-2024 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2021 Ellis Kenyő <me@elken.dev>
;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
@@ -8810,6 +8810,29 @@ (define-public python-cplot
complex-valued functions.")
(license license:gpl3+)))
+(define-public python-cppheaderparser
+ (package
+ (name "python-cppheaderparser")
+ (version "2.7.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "CppHeaderParser" version))
+ (sha256
+ (base32 "0hncwd9y5ayk8wa6bqhp551mcamcvh84h89ba3labc4mdm0k0arq"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:tests? #f)) ;test suite not included in the release
+ (propagated-inputs (list python-ply))
+ (home-page "http://senexcanis.com/open-source/cppheaderparser/")
+ (synopsis
+ "Parse C++ header files and generate a data structure representing the class")
+ (description
+ "CppHeaderParser is a pure python module that will parse C++ header files
+and generate a data structure representing the class.")
+ (license license:bsd-3)))
+
(define-public python-cppy
(package
(name "python-cppy")

base-commit: ffc5fefce370f5fc01091869e13fdf525be1e0c0
--
2.41.0
Sharlatan Hellseher wrote 1 years ago
[PATCH 0/2] gnu: python-pyamg: Regenerate bundled files.
(address . 68650-done@debbugs.gnu.org)
87o7d5hx3p.fsf@gmail.com
Pushed as ae77d94839...77a07a968f to master.

Thanks,
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmW23yoACgkQdtcnv/Ys
0rUhIg//bIqvTHj9QX3N5mQTepUsG5bYcZCUcoT0mCf3iLIrKYZzQbqAH6oAFPTm
JPDAMTr4tytAhl24YRpU7SIiT8REhGiw0mc7CNotF9TI4RDjWPbmJzqSJyI5T8lW
Os3NLUiJ2N7b2xCiktNOn2c3y4C48/RGiy61g2E+pwP7LJ0wbXiwOfqWuUHX/Zxt
QwuKQyYnH88fHHpyjUxAC5g7YNuDmt+zFgZUnli0EOfFaOtpJMEEbGbAxZOSD6dB
bvV4/ltU79i5r7qs1WAf5Nin55gOqDwFBOvMmwOLh2Qxnmw5VwGC5lfrdxdEIhJv
RzJQ4do2XA1FitAKFBu9+NhamY5+Ipsc597GvLq5yJL2tD5pQ+0QyThYY53W6P9p
D7snGju6i9Zk8DVXkcBMvG7M5E26cTnOT3i+x7KlwAEO97JoBQae23pFJuTT3WPq
W9hImScp0Q/bux/UIYFcHh8c7akVJ8lRUsHk08ybOaSDLGUZNekHBM/uQaCOIglK
opFRCIoU/ikCT2VQFbSX6g6r0BY2UCuobMAtHsJpbzajNcWttj4j5ZGbYL6E8NJq
jZEx2GeF67K03Tdv1rzrZIlskgFCadqFj5UXjpT2g8WDCqPkw8W6rqBebRCACxDk
gfP8u3EsWVwRamcNDDhqKXDkZsdAUyUkhjat6VuobDbHr1fNonA=
=1GT4
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 68650@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68650
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help