[PATCH] gnu: Add python-pybare.

  • Open
  • quality assurance status badge
Details
3 participants
  • jgart
  • Maxim Cournoyer
  • Maxime Devos
Owner
unassigned
Submitted by
jgart
Severity
normal
J
(address . guix-patches@gnu.org)(name . jgart)(address . jgart@dismail.de)
20220611042737.15082-1-jgart@dismail.de
* gnu/packages/python-xyz.scm (python-pybare): New variable.
---
gnu/packages/python-xyz.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4104472848..ceedacd714 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -29418,6 +29418,38 @@ (define-public python-gatt
Currently, Linux is the only platform supported by this library.")
(license license:expat)))
+(define-public python-pybare
+ (package
+ (name "python-pybare")
+ (version "0.1.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://git.sr.ht/~chiefnoah/pybare")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1ibmwwf1rdxlwyxlzhv3v1i0ybsqg0kppim90sm8rsbns86yy4by"))))
+ (build-system python-build-system)
+ (native-inputs
+ (list python-pytest))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (chdir "bare")
+ (invoke "pytest" "."))))))
+ (home-page "https://sr.ht/~chiefnoah/PyBARE/")
+ (synopsis "Declarative implementation of BARE for Python")
+ (description
+"@code{python-pybare} is a general purpose library for strongly
+typed primitives in Python that supports serializing to and from BARE
+messages.")
+ (license license:expat)))
+
(define-public python-musical-scales
(package
(name "python-musical-scales")
--
2.36.1
M
M
Maxime Devos wrote on 11 Jun 2022 10:21
31595048a784bc8cefeb42951c790cf8a654cd05.camel@telenet.be
jgart via Guix-patches via schreef op vr 10-06-2022 om 23:27 [-0500]:
Toggle quote (8 lines)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (replace 'check
> +           (lambda _
> +             (chdir "bare")
> +             (invoke "pytest" "."))))))

"./pre-inst-env guix lint python-pybare" will have a warning about
this. Also, apparently 'list' is considered more readable than
quasiquote/unquote, see [1], so maybe eliminate the quasiquote in
favour of 'list'?

Toggle quote (2 lines)
> BARE

Looks like a not well-known acronym, maybe use @acronym?


Otherwise the package definition LGTM, but I haven't built or tested it
or read the source code.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqRQkBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qCgAP9Q1yU1khgacVHShcqnMkyEpRZe
DCB78jXtC+fDz4BtiAEAvBkNC+ZvQWuq2j9pokBQFanJ7fhXWJo7+7QKbhIPYwQ=
=TnDM
-----END PGP SIGNATURE-----


J
[PATCH v2] gnu: Add python-pybare.
(address . 55896@debbugs.gnu.org)
20220611202700.5655-1-jgart@dismail.de
* gnu/packages/python-xyz.scm (python-pybare): New variable.

Hi Maxime,

Thanks for the review. It is much appreciated.

Here is version 2 with your requested changes.

all best,

jgart
---
gnu/packages/python-xyz.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4104472848..5109434cbf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -29418,6 +29418,39 @@ (define-public python-gatt
Currently, Linux is the only platform supported by this library.")
(license license:expat)))
+(define-public python-pybare
+ (package
+ (name "python-pybare")
+ (version "0.1.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://git.sr.ht/~chiefnoah/pybare")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1ibmwwf1rdxlwyxlzhv3v1i0ybsqg0kppim90sm8rsbns86yy4by"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "bare")
+ (invoke "pytest" "-vv" ".")))))))
+ (native-inputs
+ (list python-pytest))
+ (home-page "https://sr.ht/~chiefnoah/PyBARE/")
+ (synopsis "Declarative implementation of BARE for Python")
+ (description
+"@code{python-pybare} is a general purpose library for strongly typed
+primitives in Python that supports serializing to and from @acronym{BARE,
+Binary Application Record Encoding} messages.")
+ (license license:expat)))
+
(define-public python-musical-scales
(package
(name "python-musical-scales")
--
2.36.1
M
M
Maxime Devos wrote on 12 Jun 2022 17:41
fa829031dd0a11841914052a5277b3852e99db82.camel@telenet.be
jgart schreef op za 11-06-2022 om 15:27 [-0500]:
Toggle quote (34 lines)
> +(define-public python-pybare
> +  (package
> +    (name "python-pybare")
> +    (version "0.1.1")
> +    (source
> +      (origin
> +        (method git-fetch)
> +        (uri
> +         (git-reference
> +          (url "https://git.sr.ht/~chiefnoah/pybare")
> +          (commit (string-append "v" version))))
> +        (file-name (git-file-name name version))
> +        (sha256
> +         (base32 "1ibmwwf1rdxlwyxlzhv3v1i0ybsqg0kppim90sm8rsbns86yy4by"))))
> +    (build-system python-build-system)
> +    (arguments
> +      (list #:phases
> +            #~(modify-phases %standard-phases
> +                (replace 'check
> +                  (lambda* (#:key tests? #:allow-other-keys)
> +                    (when tests?
> +                      (chdir "bare")
> +                      (invoke "pytest" "-vv" ".")))))))
> +    (native-inputs
> +      (list python-pytest))
> +    (home-page "https://sr.ht/~chiefnoah/PyBARE/")
> +    (synopsis "Declarative implementation of BARE for Python")
> +    (description
> +"@code{python-pybare} is a general purpose library for strongly typed
> +primitives in Python that supports serializing to and from @acronym{BARE,
> +Binary Application Record Encoding} messages.")
> +    (license license:expat


Package definition LGTM, but I have only looked at the definition, not
the sources etc.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqYJRRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hezAQC/XkoJAQOnNwntQeQW7BPAW0uh
m+pBIO5wvQlbGj2oFQEAgBOkupg9vagjuCGaLg8ObX/IT74Xp1xeUAtyGFCYwAY=
=Dqgi
-----END PGP SIGNATURE-----


J
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 55896@debbugs.gnu.org)
20220612155418.GC1648@gac
On Sun, 12 Jun 2022 17:41:57 +0200 Maxime Devos <maximedevos@telenet.be> wrote:
Toggle quote (38 lines)
> jgart schreef op za 11-06-2022 om 15:27 [-0500]:
> > +(define-public python-pybare
> > +  (package
> > +    (name "python-pybare")
> > +    (version "0.1.1")
> > +    (source
> > +      (origin
> > +        (method git-fetch)
> > +        (uri
> > +         (git-reference
> > +          (url "https://git.sr.ht/~chiefnoah/pybare")
> > +          (commit (string-append "v" version))))
> > +        (file-name (git-file-name name version))
> > +        (sha256
> > +         (base32 "1ibmwwf1rdxlwyxlzhv3v1i0ybsqg0kppim90sm8rsbns86yy4by"))))
> > +    (build-system python-build-system)
> > +    (arguments
> > +      (list #:phases
> > +            #~(modify-phases %standard-phases
> > +                (replace 'check
> > +                  (lambda* (#:key tests? #:allow-other-keys)
> > +                    (when tests?
> > +                      (chdir "bare")
> > +                      (invoke "pytest" "-vv" ".")))))))
> > +    (native-inputs
> > +      (list python-pytest))
> > +    (home-page "https://sr.ht/~chiefnoah/PyBARE/")
> > +    (synopsis "Declarative implementation of BARE for Python")
> > +    (description
> > +"@code{python-pybare} is a general purpose library for strongly typed
> > +primitives in Python that supports serializing to and from @acronym{BARE,
> > +Binary Application Record Encoding} messages.")
> > +    (license license:expat
>
>
> Package definition LGTM, but I have only looked at the definition, not
> the sources etc.

Hi Maxime, no worries. Take your time. The review is much appreciated.

I just looked at the sources again myself and noticed that the tests
use pre-generated BARE binaries to test against.

See here:


and here:


Should I ask the author if they can provide a way to generate those
binaries for testing instead of vendoring the pre-compiled binaries
without their sources?

all best,

jgart
M
M
Maxim Cournoyer wrote on 7 Jul 2022 22:33
Re: bug#55896: [PATCH] gnu: Add python-pybare.
(name . jgart)(address . jgart@dismail.de)
87h73swtm7.fsf_-_@gmail.com
Hello,

jgart <jgart@dismail.de> writes:

[...]

Toggle quote (17 lines)
> Hi Maxime, no worries. Take your time. The review is much appreciated.
>
> I just looked at the sources again myself and noticed that the tests
> use pre-generated BARE binaries to test against.
>
> See here:
>
> https://git.sr.ht/~chiefnoah/pybare/tree/master/item/bare/test_encoder.py#L225
>
> and here:
>
> https://git.sr.ht/~chiefnoah/pybare/tree/master/item/bare/_examples
>
> Should I ask the author if they can provide a way to generate those
> binaries for testing instead of vendoring the pre-compiled binaries
> without their sources?

Yes, please ask. Otherwise, we'll have to delete the binaries from
unknown source in a source snippet and not run the test suite...

Thank you!

Maxim
M
M
Maxim Cournoyer wrote on 7 Jul 2022 22:33
control message for bug #55896
(address . control@debbugs.gnu.org)
87fsjcwtm1.fsf@gmail.com
tags 55896 + moreinfo
quit
J
J
jgart wrote on 8 Jul 2022 01:59
Re: bug#55896: [PATCH] gnu: Add python-pybare.
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
20220707185923.GD1675@gac
On Thu, 07 Jul 2022 16:33:20 -0400 Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
Toggle quote (26 lines)
> Hello,
>
> jgart <jgart@dismail.de> writes:
>
> [...]
>
> > Hi Maxime, no worries. Take your time. The review is much appreciated.
> >
> > I just looked at the sources again myself and noticed that the tests
> > use pre-generated BARE binaries to test against.
> >
> > See here:
> >
> > https://git.sr.ht/~chiefnoah/pybare/tree/master/item/bare/test_encoder.py#L225
> >
> > and here:
> >
> > https://git.sr.ht/~chiefnoah/pybare/tree/master/item/bare/_examples
> >
> > Should I ask the author if they can provide a way to generate those
> > binaries for testing instead of vendoring the pre-compiled binaries
> > without their sources?
>
> Yes, please ask. Otherwise, we'll have to delete the binaries from
> unknown source in a source snippet and not run the test suite...

I asked already. But I'll have to do some more research.

The author mentioned that they go the binaries from Drew Devault's implementation of the same library in golang.

I think Drew Devault is also vendoring the binaries iirc.

TODO:

So, I'll have to contact Drew and ask him if he can generate the binaries instead of vendoring them in.

all best,

jgart
?