diff mbox series

[bug#44275] gnu: Add python-pydub.

Message ID 20201028085654.18295-1-tanguy@bioneland.org
State Accepted
Headers show
Series [bug#44275] gnu: Add python-pydub. | expand

Checks

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

Commit Message

Tanguy LE CARROUR Oct. 28, 2020, 8:56 a.m. UTC
* gnu/packages/python-xyz.scm (python-pydub): New variable.
---
 gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Leo Famulari Oct. 28, 2020, 4:34 p.m. UTC | #1
On Wed, Oct 28, 2020 at 09:56:54AM +0100, Tanguy Le Carrour wrote:
> * gnu/packages/python-xyz.scm (python-pydub): New variable.

> +    (propagated-inputs
> +     `(("ffmpeg" ,ffmpeg)
> +       ("python-scipy" ,python-scipy)))

It would be good if store references to these programs could be "baked in" to
the pydub code, rather than propagated. Can you take a look at how they
are called and see if that is feasible? Often there is only one location
that must be patched.
Tanguy LE CARROUR Oct. 29, 2020, 8:26 a.m. UTC | #2
Hi Leo,

Thanks for taking the time to review this!

Le 10/28, Leo Famulari a écrit :
> On Wed, Oct 28, 2020 at 09:56:54AM +0100, Tanguy Le Carrour wrote:
> > * gnu/packages/python-xyz.scm (python-pydub): New variable.
> 
> > +    (propagated-inputs
> > +     `(("ffmpeg" ,ffmpeg)
> > +       ("python-scipy" ,python-scipy)))
> 
> It would be good if store references to these programs could be "baked in" to
> the pydub code, rather than propagated. Can you take a look at how they
> are called and see if that is feasible? Often there is only one location
> that must be patched.

mmm… haven't done that so far, it would be my first time! Always good to
learn new tricks! :-)
I'll try to patch the call to `ffmpeg` and let you know.

`python-scipy` is a different problem, though. This module is not listed
as a requirement, but… it's required at run time. Event if I don't see the
point of having SciPy loaded when you want to manipulate audio. But that's
a different matter!

Regards,
Leo Famulari Oct. 29, 2020, 2:14 p.m. UTC | #3
On Thu, Oct 29, 2020 at 09:26:57AM +0100, Tanguy Le Carrour wrote:
> Hi Leo,
> 
> Thanks for taking the time to review this!
> 
> Le 10/28, Leo Famulari a écrit :
> > On Wed, Oct 28, 2020 at 09:56:54AM +0100, Tanguy Le Carrour wrote:
> > > * gnu/packages/python-xyz.scm (python-pydub): New variable.
> > 
> > > +    (propagated-inputs
> > > +     `(("ffmpeg" ,ffmpeg)
> > > +       ("python-scipy" ,python-scipy)))
> > 
> > It would be good if store references to these programs could be "baked in" to
> > the pydub code, rather than propagated. Can you take a look at how they
> > are called and see if that is feasible? Often there is only one location
> > that must be patched.
> 
> mmm… haven't done that so far, it would be my first time! Always good to
> learn new tricks! :-)
> I'll try to patch the call to `ffmpeg` and let you know.
> 
> `python-scipy` is a different problem, though. This module is not listed
> as a requirement, but… it's required at run time. Event if I don't see the
> point of having SciPy loaded when you want to manipulate audio. But that's
> a different matter!

Okay, I will take a look at the scipy thing today.
Tanguy LE CARROUR Oct. 29, 2020, 2:39 p.m. UTC | #4
Le 10/29, Leo Famulari a écrit :
> On Thu, Oct 29, 2020 at 09:26:57AM +0100, Tanguy Le Carrour wrote:
> > […]
> > > It would be good if store references to these programs could be "baked in" to
> > > the pydub code, rather than propagated. Can you take a look at how they
> > > are called and see if that is feasible? Often there is only one location
> > > that must be patched.
> > […]
> > `python-scipy` is a different problem, though. This module is not listed
> > as a requirement, but… it's required at run time. Event if I don't see the
> > point of having SciPy loaded when you want to manipulate audio. But that's
> > a different matter!
> 
> Okay, I will take a look at the scipy thing today.

Great, thanks!

If it was up to me, I would remove altogether everything that is
related to `scipy`, meaning the `pydub/scipy_effects.py` file. But it
wouldn't be the same software any more, would it? ^_^'

Regards,
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6c5ccac647..55580a251b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16659,6 +16659,28 @@  ignoring formatting changes.")
 (define-public python2-pydiff
   (package-with-python2 python-pydiff))
 
+(define-public python-pydub
+  (package
+    (name "python-pydub")
+    (version "0.24.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pydub" version))
+       (sha256
+        (base32
+         "0sfwfq7yjv4bl3yqbmizszscafvwf4zr40hzbsy7rclvzyznh333"))))
+    (build-system python-build-system)
+    (home-page "http://pydub.com")
+    (propagated-inputs
+     `(("ffmpeg" ,ffmpeg)
+       ("python-scipy" ,python-scipy)))
+    (synopsis "Manipulate audio with an simple and easy high level interface")
+    (description
+     "@code{pydub} makes it easy to manipulate audio.  It relies on
+@code{ffmpeg} to open various audio formats.")
+    (license license:expat))) ; MIT license
+
 (define-public python-tqdm
   (package
     (name "python-tqdm")