unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements.
@ 2021-04-16  4:57 ` jgart via Guix-patches via
  2021-04-16 10:12   ` Maxime Devos
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: jgart via Guix-patches via @ 2021-04-16  4:57 UTC (permalink / raw)
  To: 47815; +Cc: Efraim Flashner

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

Hi Guix,

Below are some improvements to the python-abjad package that was merged the other day.

I changed the name to abjad, moved some inputs into their correct place, and improved its description.

best regards,

jgart

[-- Attachment #2: 0002-gnu-abjad-Move-python-ply-and-lilypond-to-propagated.patch --]
[-- Type: application/octet-stream, Size: 1675 bytes --]

From 8613de25b64604d7d6a4522e9961fb5a975abf54 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Fri, 16 Apr 2021 00:23:07 -0400
Subject: [PATCH 2/6] gnu: abjad: Move python-ply and lilypond to
 propagated-inputs.

    * gnu/packages/music.scm (abjad): python-ply is used by
    abjad's lilypond parsers and the lilypond executable is
    used by the show class method that compiles a pdf.
---
 gnu/packages/music.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index e138541f13..5c38c7ee66 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1532,20 +1532,20 @@ Guile.")
                (invoke "python" "-m" "pytest" "tests")
                #t))))))
     (native-inputs
-     `(("lilypond" ,lilypond)
-       ("python-black" ,python-black)
+     `(("python-black" ,python-black)
        ("python-flake8" ,python-flake8)
        ("python-iniconfig" ,python-iniconfig)
        ("python-isort" ,python-isort)
        ("python-mypy" ,python-mypy)
-       ("python-ply" ,python-ply)
        ("python-pytest" ,python-pytest-6)
        ("python-pytest-cov" ,python-pytest-cov)
        ("python-sphinx-autodoc-typehints" ,python-sphinx-autodoc-typehints)))
     (propagated-inputs
-     `(("python-quicktions" ,python-quicktions)
+     `(("lilypond" ,lilypond)
+       ("python-quicktions" ,python-quicktions)
        ("python-roman" ,python-roman)
        ("python-six" ,python-six)
+       ("python-ply" ,python-ply)
        ("python-uqbar" ,python-uqbar)))
     (home-page "https://abjad.github.io")
     (synopsis "Python API for building LilyPond files")
-- 
2.29.3


[-- Attachment #3: 0003-gnu-abjad-Improve-description.patch --]
[-- Type: application/octet-stream, Size: 1309 bytes --]

From 9ebcdd25a56e3e7e9eca414ef2c5964c185f8c16 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Fri, 16 Apr 2021 00:31:50 -0400
Subject: [PATCH 3/6] gnu: abjad: Improve description.

    * gnu/packages/music.scm (abjad)[description]: Improve abjad's
    description.
---
 gnu/packages/music.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 5c38c7ee66..f705d91cee 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1550,7 +1550,12 @@ Guile.")
     (home-page "https://abjad.github.io")
     (synopsis "Python API for building LilyPond files")
     (description
-     "This package provides a Python API for building LilyPond files.")
+     "Abjad helps composers build up complex pieces of music notation in iterative
+and incremental ways.  Use Abjad to create a symbolic representation of all the notes,
+rests, chords, tuplets, beams and slurs in any score.  Because Abjad extends the Python
+programming language, you can use Abjad to make systematic changes to music as you work.
+Because Abjad wraps the LilyPond music notation package, you can use Abjad to control the
+typographic detail of symbols on the page.")
     (license license:expat)))
 
 (define-public non-sequencer
-- 
2.29.3


[-- Attachment #4: 0001-gnu-Rename-python-abjad-to-abjad.patch --]
[-- Type: application/octet-stream, Size: 825 bytes --]

From 019e6c3a942078204b72aec2f75504cbac059073 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Fri, 16 Apr 2021 00:16:19 -0400
Subject: [PATCH 1/6] gnu: Rename "python-abjad" to "abjad".

    * gnu/packages/music.scm (python-abjad): Rename to abjad.
---
 gnu/packages/music.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 265b8fdccf..e138541f13 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1502,9 +1502,9 @@ Guile.")
     ;; more than an hour of silence, so double the max silent time.
     (properties `((max-silent-time . 7200)))))
 
-(define-public python-abjad
+(define-public abjad
   (package
-    (name "python-abjad")
+    (name "abjad")
     (version "3.3")
     (source
      (origin
-- 
2.29.3


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

* [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements.
  2021-04-16  4:57 ` [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements jgart via Guix-patches via
@ 2021-04-16 10:12   ` Maxime Devos
  2021-04-16 17:59   ` jgart via Guix-patches via
  2021-04-17 16:19   ` [bug#47815] Fwd: Re: [bug#47815] " Maxime Devos
  2 siblings, 0 replies; 7+ messages in thread
From: Maxime Devos @ 2021-04-16 10:12 UTC (permalink / raw)
  To: jgart, 47815; +Cc: Efraim Flashner

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

On Fri, 2021-04-16 at 04:57 +0000, jgart via Guix-patches via wrote:
> Hi Guix,
> 
> Below are some improvements to the python-abjad package that was merged the other day.
> 
> I changed the name to abjad, moved some inputs into their correct place,

Please move 'lilypond' from propagated-inputs to 'inputs', if sanely possible!
This avoids polluting the profile with packages the user did not
explicitely request.  Of course, abjad still somehow has to find
lilypond, so you might need to replace "lilypond" with

  (string-append (assoc-ref inputs "lilypond") "/bin/lilypond")

somewhere in python-abjad's source code.  You can use substitute*
for that.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements.
  2021-04-16  4:57 ` [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements jgart via Guix-patches via
  2021-04-16 10:12   ` Maxime Devos
@ 2021-04-16 17:59   ` jgart via Guix-patches via
  2021-04-17  9:12     ` Maxime Devos
                       ` (2 more replies)
  2021-04-17 16:19   ` [bug#47815] Fwd: Re: [bug#47815] " Maxime Devos
  2 siblings, 3 replies; 7+ messages in thread
From: jgart via Guix-patches via @ 2021-04-16 17:59 UTC (permalink / raw)
  To: Maxime Devos, 47815; +Cc: Bonface Munyoki K., Efraim Flashner, Bonface M. K.

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

Hi Maxime,

Thank you for the review! I attached a new patch set. 

I reverted to Bonface's original idea of having lilypond only as a native input in the package definition.

I prefer this solution in order to solve the problem since it follows upstream's instructions of installing lilypond separately (https://abjad.github.io/first_steps/linux.html), doesn't pollute a guix user's profile with lilypond as you mentioned, and seems a bit cleaner since I don't have to touch the python sources in order to make them find the lilypond input.

If the user wants to produce a pdf then they can just include lilypond in their profile.

What do you think?

best regards,

jgart

ps

This caused me to have to add lilypond as a native-input to abjad-ext-rmakers (47816), abjad-ext-nauert (47817), and abjad-ext-ipython (47818) since those where building successfully before because they had abjad as a propagated input and abjad had lilypond as a propagated input. The above mentioned packages require lilypond for the tests.




April 16, 2021 6:12 AM, "Maxime Devos" <maximedevos@telenet.be> wrote:

> On Fri, 2021-04-16 at 04:57 +0000, jgart via Guix-patches via wrote:
> 
>> Hi Guix,
>> 
>> Below are some improvements to the python-abjad package that was merged the other day.
>> 
>> I changed the name to abjad, moved some inputs into their correct place,
> 
> Please move 'lilypond' from propagated-inputs to 'inputs', if sanely possible!
> This avoids polluting the profile with packages the user did not
> explicitely request. Of course, abjad still somehow has to find
> lilypond, so you might need to replace "lilypond" with
> 
> (string-append (assoc-ref inputs "lilypond") "/bin/lilypond")
> 
> somewhere in python-abjad's source code. You can use substitute*
> for that.
> 
> Greetings,
> Maxime.

[-- Attachment #2: 0001-gnu-Rename-python-abjad-to-abjad.patch --]
[-- Type: application/octet-stream, Size: 825 bytes --]

From 019e6c3a942078204b72aec2f75504cbac059073 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Fri, 16 Apr 2021 00:16:19 -0400
Subject: [PATCH 1/6] gnu: Rename "python-abjad" to "abjad".

    * gnu/packages/music.scm (python-abjad): Rename to abjad.
---
 gnu/packages/music.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 265b8fdccf..e138541f13 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1502,9 +1502,9 @@ Guile.")
     ;; more than an hour of silence, so double the max silent time.
     (properties `((max-silent-time . 7200)))))
 
-(define-public python-abjad
+(define-public abjad
   (package
-    (name "python-abjad")
+    (name "abjad")
     (version "3.3")
     (source
      (origin
-- 
2.29.3


[-- Attachment #3: 0002-gnu-abjad-Move-python-ply-to-propagated-inputs.patch --]
[-- Type: application/octet-stream, Size: 1242 bytes --]

From 57f1e050afd7ab05cd93fbbe34b79f55be78da43 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Fri, 16 Apr 2021 00:23:07 -0400
Subject: [PATCH 2/6] gnu: abjad: Move python-ply to propagated-inputs.

    * gnu/packages/music.scm (abjad): python-ply is used by
    abjad's lilypond parsers.
---
 gnu/packages/music.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index e138541f13..2991bf8fa1 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1538,7 +1538,6 @@ Guile.")
        ("python-iniconfig" ,python-iniconfig)
        ("python-isort" ,python-isort)
        ("python-mypy" ,python-mypy)
-       ("python-ply" ,python-ply)
        ("python-pytest" ,python-pytest-6)
        ("python-pytest-cov" ,python-pytest-cov)
        ("python-sphinx-autodoc-typehints" ,python-sphinx-autodoc-typehints)))
@@ -1546,6 +1545,7 @@ Guile.")
      `(("python-quicktions" ,python-quicktions)
        ("python-roman" ,python-roman)
        ("python-six" ,python-six)
+       ("python-ply" ,python-ply)
        ("python-uqbar" ,python-uqbar)))
     (home-page "https://abjad.github.io")
     (synopsis "Python API for building LilyPond files")
-- 
2.29.3


[-- Attachment #4: 0003-gnu-abjad-Improve-description.patch --]
[-- Type: application/octet-stream, Size: 1309 bytes --]

From 7a482b515518cd1a5f555e41ca0a43feeada6cc8 Mon Sep 17 00:00:00 2001
From: jgart <jgart@dismail.de>
Date: Fri, 16 Apr 2021 00:31:50 -0400
Subject: [PATCH 3/6] gnu: abjad: Improve description.

    * gnu/packages/music.scm (abjad)[description]: Improve abjad's
    description.
---
 gnu/packages/music.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 2991bf8fa1..9d1375d6b3 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1550,7 +1550,12 @@ Guile.")
     (home-page "https://abjad.github.io")
     (synopsis "Python API for building LilyPond files")
     (description
-     "This package provides a Python API for building LilyPond files.")
+     "Abjad helps composers build up complex pieces of music notation in iterative
+and incremental ways.  Use Abjad to create a symbolic representation of all the notes,
+rests, chords, tuplets, beams and slurs in any score.  Because Abjad extends the Python
+programming language, you can use Abjad to make systematic changes to music as you work.
+Because Abjad wraps the LilyPond music notation package, you can use Abjad to control the
+typographic detail of symbols on the page.")
     (license license:expat)))
 
 (define-public non-sequencer
-- 
2.29.3


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

* [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements.
  2021-04-16 17:59   ` jgart via Guix-patches via
@ 2021-04-17  9:12     ` Maxime Devos
  2021-04-17 16:10     ` jgart via Guix-patches via
  2021-07-22  8:53     ` bug#47815: " Efraim Flashner
  2 siblings, 0 replies; 7+ messages in thread
From: Maxime Devos @ 2021-04-17  9:12 UTC (permalink / raw)
  To: jgart, 47815; +Cc: Bonface Munyoki K., Efraim Flashner, Bonface M. K.

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

jgart schreef op vr 16-04-2021 om 17:59 [+0000]:
> Hi Maxime,
> 
> Thank you for the review! I attached a new patch set. 
> 
> I reverted to Bonface's original idea of having lilypond only as a native input
> in the package definition.

If you do that, make sure "abjad" does not retain a reference to lilypond,
as otherwise when cross-compiling, "abjad" will use a lilypond built for the
incorrect architecture.  You can use #:disallowed-references ,lilypond for this.

(TODO: there should be a #:disallowed-refences/native variant.  But
#:disallowed-references will suffice for now.)

I'm currently occupied with some other things, so I can't review your revised
patches yet.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements.
  2021-04-16 17:59   ` jgart via Guix-patches via
  2021-04-17  9:12     ` Maxime Devos
@ 2021-04-17 16:10     ` jgart via Guix-patches via
  2021-07-22  8:53     ` bug#47815: " Efraim Flashner
  2 siblings, 0 replies; 7+ messages in thread
From: jgart via Guix-patches via @ 2021-04-17 16:10 UTC (permalink / raw)
  To: Maxime Devos, 47815; +Cc: Bonface Munyoki K., Efraim Flashner, Bonface M. K.

Hi Maxime,

I tried your suggestion but it fails with the following exception:

Backtrace:

...
In guix/build-system/python.scm:
    162:0  3 (python-build _ _ _ #:tests? _ #:test-target _ # _ # _ # …)
In ice-9/boot-9.scm:
  1669:16  2 (raise-exception _ #:continuable? _)
  1669:16  1 (raise-exception _ #:continuable? _)
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Unrecognized keyword: #:disallowed-references

It looks like python-build-system might not support #:disallowed-references.

Is that correct?

all the best,

jgart

ps

I did a quick search for it with ripgrep and it seems like only gnu, meson, and glib-or-gtk support it currently:

rg "\#:disallowed-references" -t lisp | rg build-system

guix/build-system/meson.scm:                              #:disallowed-references
guix/build-system/gnu.scm:                                #:disallowed-references
guix/build-system/gnu.scm:                                #:disallowed-references
guix/build-system/glib-or-gtk.scm:                        #:disallowed-references


April 17, 2021 5:12 AM, "Maxime Devos" <maximedevos@telenet.be> wrote:

> jgart schreef op vr 16-04-2021 om 17:59 [+0000]:
> 
>> Hi Maxime,
>> 
>> Thank you for the review! I attached a new patch set.
>> 
>> I reverted to Bonface's original idea of having lilypond only as a native input
>> in the package definition.
> 
> If you do that, make sure "abjad" does not retain a reference to lilypond,
> as otherwise when cross-compiling, "abjad" will use a lilypond built for the
> incorrect architecture. You can use #:disallowed-references ,lilypond for this.
> 
> (TODO: there should be a #:disallowed-refences/native variant. But
> #:disallowed-references will suffice for now.)
> 
> I'm currently occupied with some other things, so I can't review your revised
> patches yet.
> 
> Greetings,
> Maxime.




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

* [bug#47815] Fwd: Re: [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements.
  2021-04-16  4:57 ` [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements jgart via Guix-patches via
  2021-04-16 10:12   ` Maxime Devos
  2021-04-16 17:59   ` jgart via Guix-patches via
@ 2021-04-17 16:19   ` Maxime Devos
  2 siblings, 0 replies; 7+ messages in thread
From: Maxime Devos @ 2021-04-17 16:19 UTC (permalink / raw)
  To: 47815


[-- Attachment #1.1: Type: text/plain, Size: 61 bytes --]

I accidentally forgot to keep 47815@debbugs.gnu.org in To:.

[-- Attachment #1.2: Doorgestuurd bericht — Re: [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements. --]
[-- Type: message/rfc822, Size: 2314 bytes --]

[-- Attachment #1.2.1.1: Type: text/plain, Size: 945 bytes --]

jgart schreef op za 17-04-2021 om 16:10 [+0000]:
> Hi Maxime,
> 
> I tried your suggestion but it fails with the following exception:
> 
> Backtrace:
> 
> ...
> In guix/build-system/python.scm:
>     162:0  3 (python-build _ _ _ #:tests? _ #:test-target _ # _ # _ # …)
> In ice-9/boot-9.scm:
>   1669:16  2 (raise-exception _ #:continuable? _)
>   1669:16  1 (raise-exception _ #:continuable? _)
>   1669:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> Unrecognized keyword: #:disallowed-references
> 
> It looks like python-build-system might not support #:disallowed-references.
> 
> Is that correct?

That indeed seems to be the case.
For now, you can run ‘guix gc --references $(guix build abjad)’.
The output should not contain lilypond.
I'll see about adding #:disallowed-references and #:disallowed-native-references
later.

Greetings,
Maxime.

[-- Attachment #1.2.1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* bug#47815: [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements.
  2021-04-16 17:59   ` jgart via Guix-patches via
  2021-04-17  9:12     ` Maxime Devos
  2021-04-17 16:10     ` jgart via Guix-patches via
@ 2021-07-22  8:53     ` Efraim Flashner
  2 siblings, 0 replies; 7+ messages in thread
From: Efraim Flashner @ 2021-07-22  8:53 UTC (permalink / raw)
  To: jgart; +Cc: Bonface Munyoki K., 47815-done, Maxime Devos, Bonface M. K.

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

Sorry for the long delay! I made a couple of changes:
I added python-abjad as a deprecated package, so it won't break for
anyone who already has it installed.
I sorted python-ply alphabetically when moving it to propagated-inputs.

I also moved lilypond to inputs and removed the now unnecessary
'patch-source phase.

Thanks! Patches pushed.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

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

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

end of thread, other threads:[~2021-07-22  8:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <7988a3c09cc5efb9265b28483f036b1508514f67.camel@telenet.be>
2021-04-16  4:57 ` [bug#47815] [PATCH 1/3] gnu: music: python-abjad: Abjad Improvements jgart via Guix-patches via
2021-04-16 10:12   ` Maxime Devos
2021-04-16 17:59   ` jgart via Guix-patches via
2021-04-17  9:12     ` Maxime Devos
2021-04-17 16:10     ` jgart via Guix-patches via
2021-07-22  8:53     ` bug#47815: " Efraim Flashner
2021-04-17 16:19   ` [bug#47815] Fwd: Re: [bug#47815] " Maxime Devos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).