diff mbox series

[bug#47593,6/6] gnu: python-xyz: Add python-abjad.

Message ID 20210404122005.33127-7-me@bonfacemunyoki.com
State Accepted
Headers show
Series *** Add Python Abjad v3.3 *** | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Munyoki Kilyungi April 4, 2021, 12:20 p.m. UTC
* gnu/packages/python-xyz.scm (python-abjad): New variable.

Co-authored-by: jgart <jgart@dismail.de>
---
 gnu/packages/python-xyz.scm | 52 +++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

Comments

Efraim Flashner April 13, 2021, 1:14 p.m. UTC | #1
I would put this in music.scm near lilypond.

On Sun, Apr 04, 2021 at 03:20:05PM +0300, BonfaceKilz wrote:
> * gnu/packages/python-xyz.scm (python-abjad): New variable.
> 
> Co-authored-by: jgart <jgart@dismail.de>
> ---
>  gnu/packages/python-xyz.scm | 52 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index e87ba6b6b6..baa8534d7a 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -162,6 +162,7 @@
>    #:use-module (gnu packages maths)
>    #:use-module (gnu packages monitoring)
>    #:use-module (gnu packages multiprecision)
> +  #:use-module (gnu packages music)
>    #:use-module (gnu packages networking)
>    #:use-module (gnu packages ncurses)
>    #:use-module (gnu packages openstack)
> @@ -24356,3 +24357,54 @@ iGoogle subscription lists.")
>      (description
>       "Fast fractions data type for rational numbers. Cythonized version of 'fractions.Fraction'.")
>      (license license:psfl)))
> +

If this is a package that would be installed then you can change the
name to abjad, no need to keep the python prefix.

> +(define-public python-abjad
> +  (package
> +    (name "python-abjad")
> +    (version "3.3")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri
> +        (string-append
> +         "https://github.com/Abjad/abjad/archive/refs/tags/v"
> +         version ".tar.gz"))

This should be a pypi URI or be downloaded using git-fetch

> +       (sha256
> +        (base32
> +         "0dvj40g8kq1jdp09gb2chxxb7959vxv5h4m8ywg4qigsw3f11xnx"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch-source
> +           (lambda _
> +             (substitute* "setup.py"
> +               (("uqbar>=0.4.4, <0.5.0") "uqbar>=0.4.4, <=0.5.1")

I would just take off the <0.5.0 and not try to make it just high enough
to include the version packaged.

> +               (("pytest>=5.4.3") "pytest>=5.3"))

We also have pytest-6. Of course this is also fine.

> +             #t))
> +         (replace 'check
> +           (lambda _

(lambda* (#:key tests? #:allow-other-keys)
  (when tests?

> +             ;; See: https://stackoverflow.com/a/34140498
> +             (invoke "python" "-m" "pytest" "tests")
> +             #t)))))

I'm sure that not all of these need to be propagated. The source should
be patched to refer to lilypond and I'm guessing most of the rest can
either be inputs (they'll get wrapped with the python wrapper) or
native-inputs if they're only needed for tests.

> +    (propagated-inputs
> +     `(("lilypond" ,lilypond) ;; Required for tests to pass!
> +       ("python-black" ,python-black)
> +       ("python-flake8" ,python-flake8)
> +       ("python-isort" ,python-isort)
> +       ("python-mypy" ,python-mypy)
> +       ("python-ply" ,python-ply)
> +       ("python-pytest" ,python-pytest)
> +       ("python-pytest-cov" ,python-pytest-cov)
> +       ("python-quicktions" ,python-quicktions)
> +       ("python-roman" ,python-roman)
> +       ("python-six" ,python-six)
> +       ("python-sphinx-autodoc-typehints"
> +        ,python-sphinx-autodoc-typehints)
> +       ("python-uqbar" ,python-uqbar)))
> +    (home-page "https://abjad.github.io")
> +    (synopsis
> +     "Abjad is a Python API for building LilyPond files.")

I'd shorten this to "Python API for building LilyPind files"

> +    (description
> +     "Abjad is a Python API for building LilyPond files.")
> +    (license license:expat)))
> -- 
> 2.31.0
> 
> 
> 
>
Munyoki Kilyungi April 13, 2021, 9 p.m. UTC | #2
Efraim Flashner <efraim@flashner.co.il> writes:

> I would put this in music.scm near lilypond.
>

Makes sense.

[...]
>
> If this is a package that would be installed then you can change the
> name to abjad, no need to keep the python prefix.
>

I don't quite get this. Do you mean a package that
would be installed and run as some executable as
opposed to a library?

>> +(define-public python-abjad
>> +  (package
>> +    (name "python-abjad")
>> +    (version "3.3")
>> +    (source
>> +     (origin
>> +       (method url-fetch)
>> +       (uri
>> +        (string-append
>> +         "https://github.com/Abjad/abjad/archive/refs/tags/v"
>> +         version ".tar.gz"))
>
> This should be a pypi URI or be downloaded using git-fetch
>
Noted.

>> +       (sha256
>> +        (base32
>> +         "0dvj40g8kq1jdp09gb2chxxb7959vxv5h4m8ywg4qigsw3f11xnx"))))
>> +    (build-system python-build-system)
>> +    (arguments
>> +     `(#:phases
>> +       (modify-phases %standard-phases
>> +         (add-after 'unpack 'patch-source
>> +           (lambda _
>> +             (substitute* "setup.py"
>> +               (("uqbar>=0.4.4, <0.5.0") "uqbar>=0.4.4, <=0.5.1")
>
> I would just take off the <0.5.0 and not try to make it just high enough
> to include the version packaged.
>
Makes sense!
>> +               (("pytest>=5.4.3") "pytest>=5.3"))
>
> We also have pytest-6. Of course this is also fine.
>
Sure!
>> +             #t))
>> +         (replace 'check
>> +           (lambda _
>
> (lambda* (#:key tests? #:allow-other-keys)
>   (when tests?
>
Noted.
>> +             ;; See: https://stackoverflow.com/a/34140498
>> +             (invoke "python" "-m" "pytest" "tests")
>> +             #t)))))
>
> I'm sure that not all of these need to be propagated. The source should
> be patched to refer to lilypond and I'm guessing most of the rest can
> either be inputs (they'll get wrapped with the python wrapper) or
> native-inputs if they're only needed for tests.
>

Makes a lot of sense!

>> +    (propagated-inputs
>> +     `(("lilypond" ,lilypond) ;; Required for tests to pass!
>> +       ("python-black" ,python-black)
>> +       ("python-flake8" ,python-flake8)
>> +       ("python-isort" ,python-isort)
>> +       ("python-mypy" ,python-mypy)
>> +       ("python-ply" ,python-ply)
>> +       ("python-pytest" ,python-pytest)
>> +       ("python-pytest-cov" ,python-pytest-cov)
>> +       ("python-quicktions" ,python-quicktions)
>> +       ("python-roman" ,python-roman)
>> +       ("python-six" ,python-six)
>> +       ("python-sphinx-autodoc-typehints"
>> +        ,python-sphinx-autodoc-typehints)
>> +       ("python-uqbar" ,python-uqbar)))
>> +    (home-page "https://abjad.github.io")
>> +    (synopsis
>> +     "Abjad is a Python API for building LilyPond files.")
>
> I'd shorten this to "Python API for building LilyPind files"
>

Thanks for the suggestions!

>> +    (description
>> +     "Abjad is a Python API for building LilyPond files.")
>> +    (license license:expat)))
>> -- 
>> 2.31.0
>> 
>> 
>> 
>>
Efraim Flashner April 14, 2021, 3:19 p.m. UTC | #3
On Wed, Apr 14, 2021 at 12:00:47AM +0300, Bonface Munyoki K. wrote:
> Efraim Flashner <efraim@flashner.co.il> writes:
> 
> > I would put this in music.scm near lilypond.
> >
> 
> Makes sense.
> 
> [...]
> >
> > If this is a package that would be installed then you can change the
> > name to abjad, no need to keep the python prefix.
> >
> 
> I don't quite get this. Do you mean a package that
> would be installed and run as some executable as
> opposed to a library?

The first package I can think of is offlineimap. 'guix import pypi
offlineimap' tries to name it python-offlineimap, but it's more likely
to be used as an actual executable rather than as a library for another
package, so we rename it back to offlineimap and put the python packages
which would have normally been in propagated-inputs in inputs instead.

> >> +(define-public python-abjad
> >> +  (package
> >> +    (name "python-abjad")
> >> +    (version "3.3")
> >> +    (source
> >> +     (origin
> >> +       (method url-fetch)
> >> +       (uri
> >> +        (string-append
> >> +         "https://github.com/Abjad/abjad/archive/refs/tags/v"
> >> +         version ".tar.gz"))
> >
> > This should be a pypi URI or be downloaded using git-fetch
> >
> Noted.
> 
> >> +       (sha256
> >> +        (base32
> >> +         "0dvj40g8kq1jdp09gb2chxxb7959vxv5h4m8ywg4qigsw3f11xnx"))))
> >> +    (build-system python-build-system)
> >> +    (arguments
> >> +     `(#:phases
> >> +       (modify-phases %standard-phases
> >> +         (add-after 'unpack 'patch-source
> >> +           (lambda _
> >> +             (substitute* "setup.py"
> >> +               (("uqbar>=0.4.4, <0.5.0") "uqbar>=0.4.4, <=0.5.1")
> >
> > I would just take off the <0.5.0 and not try to make it just high enough
> > to include the version packaged.
> >
> Makes sense!
> >> +               (("pytest>=5.4.3") "pytest>=5.3"))
> >
> > We also have pytest-6. Of course this is also fine.
> >
> Sure!
> >> +             #t))
> >> +         (replace 'check
> >> +           (lambda _
> >
> > (lambda* (#:key tests? #:allow-other-keys)
> >   (when tests?
> >
> Noted.
> >> +             ;; See: https://stackoverflow.com/a/34140498
> >> +             (invoke "python" "-m" "pytest" "tests")
> >> +             #t)))))
> >
> > I'm sure that not all of these need to be propagated. The source should
> > be patched to refer to lilypond and I'm guessing most of the rest can
> > either be inputs (they'll get wrapped with the python wrapper) or
> > native-inputs if they're only needed for tests.
> >
> 
> Makes a lot of sense!
> 
> >> +    (propagated-inputs
> >> +     `(("lilypond" ,lilypond) ;; Required for tests to pass!
> >> +       ("python-black" ,python-black)
> >> +       ("python-flake8" ,python-flake8)
> >> +       ("python-isort" ,python-isort)
> >> +       ("python-mypy" ,python-mypy)
> >> +       ("python-ply" ,python-ply)
> >> +       ("python-pytest" ,python-pytest)
> >> +       ("python-pytest-cov" ,python-pytest-cov)
> >> +       ("python-quicktions" ,python-quicktions)
> >> +       ("python-roman" ,python-roman)
> >> +       ("python-six" ,python-six)
> >> +       ("python-sphinx-autodoc-typehints"
> >> +        ,python-sphinx-autodoc-typehints)
> >> +       ("python-uqbar" ,python-uqbar)))
> >> +    (home-page "https://abjad.github.io")
> >> +    (synopsis
> >> +     "Abjad is a Python API for building LilyPond files.")
> >
> > I'd shorten this to "Python API for building LilyPind files"
> >
> 
> Thanks for the suggestions!
> 
> >> +    (description
> >> +     "Abjad is a Python API for building LilyPond files.")
> >> +    (license license:expat)))
> >> -- 
> >> 2.31.0
> >> 
> >> 
> >> 
> >> 
> 
> -- 
> Bonface M. K. D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
> Humble GNU Emacs User / Bearer of scheme-y parens
> Curator: <https://upbookclub.com> / Twitter: @BonfaceKilz
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e87ba6b6b6..baa8534d7a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -162,6 +162,7 @@ 
   #:use-module (gnu packages maths)
   #:use-module (gnu packages monitoring)
   #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages music)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages openstack)
@@ -24356,3 +24357,54 @@  iGoogle subscription lists.")
     (description
      "Fast fractions data type for rational numbers. Cythonized version of 'fractions.Fraction'.")
     (license license:psfl)))
+
+(define-public python-abjad
+  (package
+    (name "python-abjad")
+    (version "3.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/Abjad/abjad/archive/refs/tags/v"
+         version ".tar.gz"))
+       (sha256
+        (base32
+         "0dvj40g8kq1jdp09gb2chxxb7959vxv5h4m8ywg4qigsw3f11xnx"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda _
+             (substitute* "setup.py"
+               (("uqbar>=0.4.4, <0.5.0") "uqbar>=0.4.4, <=0.5.1")
+               (("pytest>=5.4.3") "pytest>=5.3"))
+             #t))
+         (replace 'check
+           (lambda _
+             ;; See: https://stackoverflow.com/a/34140498
+             (invoke "python" "-m" "pytest" "tests")
+             #t)))))
+    (propagated-inputs
+     `(("lilypond" ,lilypond) ;; Required for tests to pass!
+       ("python-black" ,python-black)
+       ("python-flake8" ,python-flake8)
+       ("python-isort" ,python-isort)
+       ("python-mypy" ,python-mypy)
+       ("python-ply" ,python-ply)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-quicktions" ,python-quicktions)
+       ("python-roman" ,python-roman)
+       ("python-six" ,python-six)
+       ("python-sphinx-autodoc-typehints"
+        ,python-sphinx-autodoc-typehints)
+       ("python-uqbar" ,python-uqbar)))
+    (home-page "https://abjad.github.io")
+    (synopsis
+     "Abjad is a Python API for building LilyPond files.")
+    (description
+     "Abjad is a Python API for building LilyPond files.")
+    (license license:expat)))