[PATCH] gnu: Add python-ruamel.yaml

  • Done
  • quality assurance status badge
Details
2 participants
  • Muriithi Frederick Muriuki
  • Marius Bakke
Owner
unassigned
Submitted by
Muriithi Frederick Muriuki
Severity
normal
M
M
Muriithi Frederick Muriuki wrote on 3 Jul 2017 05:47
(address . guix-patches@gnu.org)
20170703034703.9668-1-fredmanglis@gmail.com
* gnu/packages/python.scm (python-ruamel.yaml, python2-ruamel.yaml):
New variables.
---
gnu/packages/python.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 3e71a23bc..1ad5b146e 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -15512,3 +15512,35 @@ pure Python module.")
(define-public python2-rencode
(package-with-python2 python-rencode))
+
+(define-public python-ruamel.yaml
+ (package
+ (name "python-ruamel.yaml")
+ (version "0.15.16")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "ruamel.yaml" version))
+ (sha256
+ (base32
+ "0yx1a1yqgm1phrmyvqzag5jwivn25ndlnwh2mgwgr7m8skn2h045"))))
+ (build-system python-build-system)
+ (arguments
+ `(;; Tests fail with message:
+ ;; ImportError: Failed to import test module: .ruamel
+ ;; but the directory .ruamel exists in the environment
+ ;; left when the package is built with --keep-failed
+ #:tests? #f))
+ (home-page "https://bitbucket.org/ruamel/yaml")
+ (synopsis
+ "A YAML 1.2 parser/emitter")
+ (description
+ "This package provides YAML parser/emitter that supports roundtrip
+preservation of comments, seq/map flow style, and map key order. It
+is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
+and has round-trip loaders and dumpers. It supports comments. Block
+style and key ordering are kept, so you can diff the source.")
+ (license license:expat)))
+
+(define-public python2-ruamel.yaml
+ (package-with-python2 python-ruamel.yaml))
--
2.13.2
M
M
Marius Bakke wrote on 11 Jul 2017 21:21
874luilqyl.fsf@fastmail.com
Muriithi Frederick Muriuki <fredmanglis@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/python.scm (python-ruamel.yaml, python2-ruamel.yaml):
> New variables.

[...]

Toggle quote (5 lines)
> +(define-public python-ruamel.yaml
> + (package
> + (name "python-ruamel.yaml")
> + (version "0.15.16")

0.15.18 is out already, sorry for the slow review! Can you try updating
to it?

Toggle quote (15 lines)
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "ruamel.yaml" version))
> + (sha256
> + (base32
> + "0yx1a1yqgm1phrmyvqzag5jwivn25ndlnwh2mgwgr7m8skn2h045"))))
> + (build-system python-build-system)
> + (arguments
> + `(;; Tests fail with message:
> + ;; ImportError: Failed to import test module: .ruamel
> + ;; but the directory .ruamel exists in the environment
> + ;; left when the package is built with --keep-failed
> + #:tests? #f))

'python setup.py test' does not work for all packages and may return
bogus errors like these. Often you can find hints for how upstream runs
their tests in "tox.ini", or CI configuration files like ".travis.yml".

tox.ini in this case runs "bash -c 'pytest _test/test_*.py'". Can you
try replacing the check phase with a phase that invokes this command?

Apart from that looks good!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlllJUIACgkQoqBt8qM6
VPq04AgAjp0Jo457umCb9bMEiP3PYq7LlSQ4NJr2vg/+c0eKV3heq5cqjH9rgBtr
LMZso1wpy0i6zpNmIm539Ele1txE4O5Mcqa6lwsjsyVaVtaNpK6AP/VCE8bDIphK
eF4v0oTtlUZEur6ObbAGvbu/mM31SEd99g7zpnJ2wnBnRG/URcVfOcnpZqS891jS
rzGZTrUzzvvn+bQe8TNcSKRlKypUfQ2bYoNKmGM2e7zkQgv0U5BwgaI7Qrkg2SGt
y0auZNqjvb4o/Bf1243ywrBT26Ih8O+UAGNZAq9d7rVtV4B2rn+IVI5uTh3IQSHg
cnuBZfmb9prgBp7zv/Sb++o8S6Jnqw==
=ZdbD
-----END PGP SIGNATURE-----

M
M
Muriithi Frederick Muriuki wrote on 12 Jul 2017 01:17
[PATCH] gnu: Add python-ruamel.yaml
(address . 27558@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170711231701.14368-1-fredmanglis@gmail.com
* gnu/packages/python.scm (python-ruamel.yaml, python2-ruamel.yaml) New
* variables.
---
gnu/packages/python.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index d110a1cb3..161812ac9 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -15549,3 +15549,35 @@ pure Python module.")
(define-public python2-rencode
(package-with-python2 python-rencode))
+
+(define-public python-ruamel.yaml
+ (package
+ (name "python-ruamel.yaml")
+ (version "0.15.18")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "ruamel.yaml" version))
+ (sha256
+ (base32
+ "1mg8zgc2f45fh7hfy2hdfb8cxq503jqjb7v1gzd9am4bqgkrqp1l"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* _
+ (zero? (system* "bash" "-c" "py.test" "_test/test_*.py")))))))
+ (home-page "https://bitbucket.org/ruamel/yaml")
+ (synopsis "This is a YAML 1.2 parser/emitter")
+ (description "This package provides YAML parser/emitter that supports
+roundtrip preservation of comments, seq/map flow style, and map key order. It
+is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2 and has
+round-trip loaders and dumpers. It supports comments. Block style and key
+ordering are kept, so you can diff the source.")
+ (license license:expat)))
+
+(define-public python2-ruamel.yaml
+ (package-with-python2 python-ruamel.yaml))
--
2.13.2
M
M
Marius Bakke wrote on 13 Jul 2017 21:47
87bmoojezg.fsf@fastmail.com
Muriithi Frederick Muriuki <fredmanglis@gmail.com> writes:

Toggle quote (3 lines)
> * gnu/packages/python.scm (python-ruamel.yaml, python2-ruamel.yaml) New
> * variables.

Ugh, I'm afraid I have to bother you one more time on this one!

First, we're trying to reduce the amount of packages in python.scm. So I
think we should add it to "serialization.scm" instead, sorry for missing
that the first time around.

Toggle quote (4 lines)
> + (replace 'check
> + (lambda* _
> + (zero? (system* "bash" "-c" "py.test" "_test/test_*.py")))))))

This prints "collected 0 items...", which indicates it doesn't actually
run any tests. Looking closer, it seems tests are missing altogether
from the PyPi archive. Could you try downloading the tarball straight
from BitBucket instead?

Toggle quote (3 lines)
> + (synopsis "This is a YAML 1.2 parser/emitter")

s/This is a //

Again, sorry for the slow and incomplete feedback. I can try to do this
last improvement over the weekend if you're already tired of this patch.

Thanks for your contribution and patience! :-)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAllnzmMACgkQoqBt8qM6
VPoiWAgAhK5XHEj9lHkaJNZHd4F+8wi0rHplinJgU6or2Vyou9pUlwaq0Yg6I1mj
pjSyVnQOOspMY7kTRAzEJlLO8Bieq38GR05teKIAByyt8vFrgMrWYhzw/DrMB6nO
IwuGMHLzlBYG7MRNw729V00Yw9aET2JL/3ZjZB+BVtGNlGx6+dkl47dmWt2PFofb
giMs1JfOUH25F+xvJEtYWkDAcNIoreAsXTUyJtI1mPcAUhMRi6c4cgEu7au4ps1s
hoLquSx6Z7G93N3VZC+/ewgOmDk0Nk31go5KvhC3I3JoaQ8iLK70YGwgFVTNQBv6
gRbodumgRnOlKgm4NkMFzK7mfRlt4w==
=W2RN
-----END PGP SIGNATURE-----

F
F
Frederick Muriithi wrote on 13 Jul 2017 21:53
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27558@debbugs.gnu.org)
CALjrZwY5De6Zb0_xahoRNub1ZruvghKp6expcc4DeqsMSRaj0g@mail.gmail.com
Okay. I'll try and fix that and send you the patch.
Attachment: file
M
M
Muriithi Frederick Muriuki wrote on 14 Jul 2017 15:22
[PATCH] gnu: Add python-ruamel.yaml
(address . 27558@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170714132249.8724-1-fredmanglis@gmail.com
* gnu/packages/serialization.scm (python-ruamel.yaml, python-ruamel2.yaml):
* New variables.
* Use module (guix build-system python)
---
gnu/packages/serialization.scm | 43 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)

Toggle diff (60 lines)
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 6b7461e62..dc030758b 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -38,7 +38,8 @@
#:use-module (gnu packages lua)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
- #:use-module (gnu packages perl))
+ #:use-module (gnu packages perl)
+ #:use-module (guix build-system python))
(define-public cereal
(package
@@ -351,3 +352,43 @@ it is comparable to protobuf.")
“Trivial integration”, and “Serious testing”.
However, “Memory efficiency” and “Speed” have not been primary goals.")
(license license:expat)))
+
+(define-public python-ruamel.yaml
+ (package
+ (name "python-ruamel.yaml")
+ (version "0.15.19")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "ruamel.yaml" version))
+ (sha256
+ (base32
+ "0qx779avw8d1vsjqyi7z21h1g5ykp8paqavgj0lzbp8h7bw9vpgv"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (arguments
+ `(;; The 'check phase defined below seems to be correct, but the code on
+ ;; pypi comes with no tests, and the code fetched directly from
+ ;; bitbucket (https://bitbucket.org/ruamel/yaml/get/<version>.tar.gz)
+ ;; fails the tests with "ImportError: No module named 'ruamel.yaml'"
+ ;; or "ImportError: No module named 'ruamel'".
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (zero? (system* "bash" "-c" "py.test" "_test/test_*.py")))))
+ #:tests? #f))
+ (home-page "https://bitbucket.org/ruamel/yaml")
+ (synopsis
+ "A YAML 1.2 parser/emitter")
+ (description
+ "This package provides YAML parser/emitter that supports roundtrip
+preservation of comments, seq/map flow style, and map key order. It
+is a derivative of Kirill Simonov’s PyYAML 3.11. It supports YAML 1.2
+and has round-trip loaders and dumpers. It supports comments. Block
+style and key ordering are kept, so you can diff the source.")
+ (license license:expat)))
+
+(define-public python2-ruamel.yaml
+ (package-with-python2 python-ruamel.yaml))
--
2.13.2
M
M
Marius Bakke wrote on 16 Jul 2017 22:38
87inis6rtg.fsf@fastmail.com
Muriithi Frederick Muriuki <fredmanglis@gmail.com> writes:

Toggle quote (4 lines)
> * gnu/packages/serialization.scm (python-ruamel.yaml, python-ruamel2.yaml):
> * New variables.
> * Use module (guix build-system python)

[...]

Toggle quote (7 lines)
> + (arguments
> + `(;; The 'check phase defined below seems to be correct, but the code on
> + ;; pypi comes with no tests, and the code fetched directly from
> + ;; bitbucket (https://bitbucket.org/ruamel/yaml/get/<version>.tar.gz)
> + ;; fails the tests with "ImportError: No module named 'ruamel.yaml'"
> + ;; or "ImportError: No module named 'ruamel'".

I looked into this, and it requires an additional library
"ruamel.std.pathlib" for tests. It would be great to have it, but I've
applied this for now with minor cosmetics fixes to make `guix lint`
happy. Also added a copyright line for you.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAllrzqwACgkQoqBt8qM6
VPoxXggAuDvSg0cBkHTVTwh3KU6A0ab2QgAAqisz94/G59GIQtHuZEHuBjQ8qqtn
uCYtVEcqrhMMYdR2OfbpGJKW6tj5AaHh5ogUkwyk0f+tW/OG/ZGJFQsZtmxJqgCY
iGXQ9cGrf1UWvN10JJ7zVvXq/Nxkp2CFOhGRTozOFYMHa9jIm3IX3X7YgHjp7QKT
vfOzXhxJuRjOpjZtCHWYJFZ//eo4JlI+UQqICUaqbaXIhR+8eOBNeLJNdiDq20US
lC7imxny49Vrh9b+3YCjedKp8XOlbeI/Sy/qb1g1XMIFSHgY3JCLsR69E3us78QP
ZVu6N6s3qFCEjUkIu5Rxg4oPc8zpHQ==
=QWri
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 16 Jul 2017 22:39
bah
(address . control@debbugs.gnu.org)
87fudw6rrs.fsf@fastmail.com
close 27558
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAllrzucACgkQoqBt8qM6
VPpxhwf+JeOTI+sDYUOK25UqiLST7+82P9H6n9PXvNjWWpzXqpZIGRcYuSeVB5We
3V11t6B0bhbh8OUkKS9oLDEnZACWRZjIWaUT+bL6L6pAaKLSEEOTyxOLrlazveEU
2PUjCD0cDGc172iIkvE94rrR2hF+9BKWdhjzemkMtWs5n24bR6I92b/b8p2O6pwW
dlvKYJIGDP5PFXV03+D9rqp60v+CT/SfDAfEiQg0Wui4L8pk8+kOAQnm9QHTg+6q
y2scUYc6Fyi9mtU9JbjOKsKulLhfNEppwW/eYnZ9jDeQWIMXNOgup2d4eCktikDe
aplZWrbf9RV1hCJ7/i/jhBL9oU7Qlg==
=+Hse
-----END PGP SIGNATURE-----

F
F
Frederick Muriithi wrote on 16 Jul 2017 22:39
Re: [PATCH] gnu: Add python-ruamel.yaml
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27558@debbugs.gnu.org)
CALjrZwbu64aOc=z51NYLP9n57iKsk2ykwD6DROpAzxfkCWQZxw@mail.gmail.com
Awesome, thanks!
Attachment: file
?