diff mbox series

[bug#41395,1/2] gnu: python-prompt-toolkit: Update to 3.0.5

Message ID 87sgfwcklx.fsf@alice.lan
State Accepted
Headers show
Series gnu: Add python-questionary | expand

Checks

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

Commit Message

Edouard Klein May 19, 2020, 9:58 a.m. UTC
* /gnu/packages/python-xyz.scm (python-widgetsnbextension): Pin python-prompt-toolkit to version 2
* /gnu/packages/python-xyz.scm (python-ipywidgets): Pin python-prompt-toolkit to version 2
* /gnu/packages/python-xyz.scm (python-jupyter-console): Pin python-prompt-toolkit to version 2
* /gnu/packages/python-xyz.scm (python-prompt-toolkit): Update to 3.0.5
* /gnu/packages/python-xyz.scm (python-prompt-toolkit-2): New variable
* /gnu/packages/python-xyz.scm (python-prompt-toolkit-2-instead-of-prompt-toolkit): New variable
* /gnu/packages/machine-learning.scm (python-iml): Pin ipython to python-prompt-toolkit-2 variant
---
 gnu/packages/machine-learning.scm |  9 ++++--
 gnu/packages/python-xyz.scm       | 48 +++++++++++++++++++++++++++++--
 2 files changed, 52 insertions(+), 5 deletions(-)

Comments

Marius Bakke May 23, 2020, 6:35 p.m. UTC | #1
Edouard Klein <edk@beaver-labs.com> writes:

> * /gnu/packages/python-xyz.scm (python-widgetsnbextension): Pin python-prompt-toolkit to version 2
> * /gnu/packages/python-xyz.scm (python-ipywidgets): Pin python-prompt-toolkit to version 2
> * /gnu/packages/python-xyz.scm (python-jupyter-console): Pin python-prompt-toolkit to version 2
> * /gnu/packages/python-xyz.scm (python-prompt-toolkit): Update to 3.0.5
> * /gnu/packages/python-xyz.scm (python-prompt-toolkit-2): New variable
> * /gnu/packages/python-xyz.scm (python-prompt-toolkit-2-instead-of-prompt-toolkit): New variable
> * /gnu/packages/machine-learning.scm (python-iml): Pin ipython to python-prompt-toolkit-2 variant

You only need to mention the file name once.

> @@ -1803,12 +1804,14 @@ advanced research.")
>           "1k8szlpm19rcwcxdny9qdm3gmaqq8akb4xlvrzyz8c2d679aak6l"))))
>      (build-system python-build-system)
>      (propagated-inputs
> -     `(("ipython" ,python-ipython)
> -       ("nose" ,python-nose)
> +     `(("ipython" ,(prompt-toolkit-2-instead-of-prompt-toolkit
> +                    python-ipython))
>         ("numpy" ,python-numpy)
>         ("pandas" ,python-pandas)
>         ("scipy" ,python-scipy)))
> -    (home-page "http://github.com/interpretable-ml/iml")
> +    (native-inputs
> +     `(("nose" ,python-nose)))
> +    (home-page "https://github.com/interpretable-ml/iml")

Can you submit the home page and inputs change of this package as two
separate patches?

>      (synopsis "Interpretable Machine Learning (iML) package")
>      (description "Interpretable ML (iML) is a set of data type objects,
>  visualizations, and interfaces that can be used by any method designed to
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index b8a51570c3..5fd7e274e9 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -8922,6 +8922,7 @@ interactive computing.")
>      (build-system python-build-system)
>      (propagated-inputs
>       `(("python-ipykernel" ,python-ipykernel)
> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>         ("python-notebook" ,python-notebook)))
>      (native-inputs
>       `(("python-certifi" ,python-certifi)
> @@ -8950,6 +8951,7 @@ notebooks.")
>      (propagated-inputs
>       `(("python-ipython" ,python-ipython)
>         ("python-traitlets" ,python-traitlets)
> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>         ("python-widgetsnbextension" ,python-widgetsnbextension)))
>      (native-inputs
>       `(("python-nose" ,python-nose)
> @@ -8980,7 +8982,7 @@ in the data.")
>      (propagated-inputs
>       `(("python-ipykernel" ,python-ipykernel)
>         ("python-jupyter-client" ,python-jupyter-client)
> -       ("python-prompt-toolkit" ,python-prompt-toolkit)
> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>         ("python-pygments" ,python-pygments)))
>      (native-inputs
>       `(("python-nose" ,python-nose)))
> @@ -12049,6 +12051,44 @@ collections of data.")
>    (package-with-python2 python-backpack))

It would be great to update these packages instead of pinning to the old
version.  I won't blame you if you don't feel like embarking on that
journey though.

>  (define-public python-prompt-toolkit
> +  (package
> +    (name "python-prompt-toolkit")
> +    (version "3.0.5")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri "prompt_toolkit" version))
> +       (sha256
> +        (base32
> +         "1j3x5s4gp4ih73sbcni0a0vffbzvrxbrbnkvb3fzjgxn810ilgan"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'check)
> +         (add-after 'install 'post-install-check
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             ;; HOME is needed for the test
> +             ;; "test_pathcompleter_can_expanduser".
> +             (setenv "HOME" "/tmp")
> +             (add-installed-pythonpath inputs outputs)
> +             (invoke "py.test"))))))
> +    (propagated-inputs
> +     `(("python-wcwidth" ,python-wcwidth)))
> +    (native-inputs
> +     `(("python-pytest" ,python-pytest)))
> +    (home-page
> +     "https://github.com/prompt-toolkit/python-prompt-toolkit")
> +    (synopsis "Library for building command line interfaces in Python")
> +    (description
> +     "Prompt-Toolkit is a library for building interactive command line
> +interfaces in Python.  It's like GNU Readline but it also features syntax
> +highlighting while typing, out-of-the-box multi-line input editing, advanced
> +code completion, incremental search, support for Chinese double-width
> +characters, mouse support, and auto suggestions.")
> +    (license license:bsd-3)))

Can you make python-prompt-toolkit-2 inherit from this package to avoid
duplicating the entire expression?

> +(define-public python-prompt-toolkit-2
>    (package
>      (name "python-prompt-toolkit")
>      (version "2.0.7")
> @@ -12077,7 +12117,7 @@ collections of data.")
>         ("python-pygments" ,python-pygments)))
>      (native-inputs
>       `(("python-pytest" ,python-pytest)))
> -    (home-page "https://github.com/jonathanslenders/python-prompt-toolkit")
> +    (home-page "https://github.com/prompt-toolkit/python-prompt-toolkit")
>      (synopsis "Library for building command line interfaces in Python")
>      (description
>       "Prompt-Toolkit is a library for building interactive command line
> @@ -12104,6 +12144,10 @@ characters, mouse support, and auto suggestions.")
>  (define-public python2-prompt-toolkit-1
>    (package-with-python2 python-prompt-toolkit-1))
>  
> +(define-public prompt-toolkit-2-instead-of-prompt-toolkit
> +  (package-input-rewriting/spec
> +   `(("python-prompt-toolkit" . ,(const python-prompt-toolkit-2)))))

Is this actually necessary?  Just changing the inputs as you did above
should be sufficient I think.
Edouard Klein May 25, 2020, 10:52 a.m. UTC | #2
Thank you for your comments :)

Marius Bakke writes:

> Edouard Klein <edk@beaver-labs.com> writes:
>
>> * /gnu/packages/python-xyz.scm (python-widgetsnbextension): Pin python-prompt-toolkit to version 2
>> * /gnu/packages/python-xyz.scm (python-ipywidgets): Pin python-prompt-toolkit to version 2
>> * /gnu/packages/python-xyz.scm (python-jupyter-console): Pin python-prompt-toolkit to version 2
>> * /gnu/packages/python-xyz.scm (python-prompt-toolkit): Update to 3.0.5
>> * /gnu/packages/python-xyz.scm (python-prompt-toolkit-2): New variable
>> * /gnu/packages/python-xyz.scm (python-prompt-toolkit-2-instead-of-prompt-toolkit): New variable
>> * /gnu/packages/machine-learning.scm (python-iml): Pin ipython to python-prompt-toolkit-2 variant
>
> You only need to mention the file name once.

OK :)

>
>> @@ -1803,12 +1804,14 @@ advanced research.")
>>           "1k8szlpm19rcwcxdny9qdm3gmaqq8akb4xlvrzyz8c2d679aak6l"))))
>>      (build-system python-build-system)
>>      (propagated-inputs
>> -     `(("ipython" ,python-ipython)
>> -       ("nose" ,python-nose)
>> +     `(("ipython" ,(prompt-toolkit-2-instead-of-prompt-toolkit
>> +                    python-ipython))
>>         ("numpy" ,python-numpy)
>>         ("pandas" ,python-pandas)
>>         ("scipy" ,python-scipy)))
>> -    (home-page "http://github.com/interpretable-ml/iml")
>> +    (native-inputs
>> +     `(("nose" ,python-nose)))
>> +    (home-page "https://github.com/interpretable-ml/iml")
>
> Can you submit the home page and inputs change of this package as two
> separate patches?
>

Done

>>      (synopsis "Interpretable Machine Learning (iML) package")
>>      (description "Interpretable ML (iML) is a set of data type objects,
>>  visualizations, and interfaces that can be used by any method designed to
>> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
>> index b8a51570c3..5fd7e274e9 100644
>> --- a/gnu/packages/python-xyz.scm
>> +++ b/gnu/packages/python-xyz.scm
>> @@ -8922,6 +8922,7 @@ interactive computing.")
>>      (build-system python-build-system)
>>      (propagated-inputs
>>       `(("python-ipykernel" ,python-ipykernel)
>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>         ("python-notebook" ,python-notebook)))
>>      (native-inputs
>>       `(("python-certifi" ,python-certifi)
>> @@ -8950,6 +8951,7 @@ notebooks.")
>>      (propagated-inputs
>>       `(("python-ipython" ,python-ipython)
>>         ("python-traitlets" ,python-traitlets)
>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>         ("python-widgetsnbextension" ,python-widgetsnbextension)))
>>      (native-inputs
>>       `(("python-nose" ,python-nose)
>> @@ -8980,7 +8982,7 @@ in the data.")
>>      (propagated-inputs
>>       `(("python-ipykernel" ,python-ipykernel)
>>         ("python-jupyter-client" ,python-jupyter-client)
>> -       ("python-prompt-toolkit" ,python-prompt-toolkit)
>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>         ("python-pygments" ,python-pygments)))
>>      (native-inputs
>>       `(("python-nose" ,python-nose)))
>> @@ -12049,6 +12051,44 @@ collections of data.")
>>    (package-with-python2 python-backpack))
>
> It would be great to update these packages instead of pinning to the old
> version.  I won't blame you if you don't feel like embarking on that
> journey though.
>

In the new patches I'm about to send, I updated them. Alas even their
latest versions still require python-prompt-toolkit <=2.1, so I had to
pin the dependencies. I did it in a cleaner way, though.


>>  (define-public python-prompt-toolkit
>> +  (package
>> +    (name "python-prompt-toolkit")
>> +    (version "3.0.5")
>> +    (source
>> +     (origin
>> +       (method url-fetch)
>> +       (uri (pypi-uri "prompt_toolkit" version))
>> +       (sha256
>> +        (base32
>> +         "1j3x5s4gp4ih73sbcni0a0vffbzvrxbrbnkvb3fzjgxn810ilgan"))))
>> +    (build-system python-build-system)
>> +    (arguments
>> +     `(#:phases
>> +       (modify-phases %standard-phases
>> +         (delete 'check)
>> +         (add-after 'install 'post-install-check
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             ;; HOME is needed for the test
>> +             ;; "test_pathcompleter_can_expanduser".
>> +             (setenv "HOME" "/tmp")
>> +             (add-installed-pythonpath inputs outputs)
>> +             (invoke "py.test"))))))
>> +    (propagated-inputs
>> +     `(("python-wcwidth" ,python-wcwidth)))
>> +    (native-inputs
>> +     `(("python-pytest" ,python-pytest)))
>> +    (home-page
>> +     "https://github.com/prompt-toolkit/python-prompt-toolkit")
>> +    (synopsis "Library for building command line interfaces in Python")
>> +    (description
>> +     "Prompt-Toolkit is a library for building interactive command line
>> +interfaces in Python.  It's like GNU Readline but it also features syntax
>> +highlighting while typing, out-of-the-box multi-line input editing, advanced
>> +code completion, incremental search, support for Chinese double-width
>> +characters, mouse support, and auto suggestions.")
>> +    (license license:bsd-3)))
>
> Can you make python-prompt-toolkit-2 inherit from this package to avoid
> duplicating the entire expression?
>
Done

>> +(define-public python-prompt-toolkit-2
>>    (package
>>      (name "python-prompt-toolkit")
>>      (version "2.0.7")
>> @@ -12077,7 +12117,7 @@ collections of data.")
>>         ("python-pygments" ,python-pygments)))
>>      (native-inputs
>>       `(("python-pytest" ,python-pytest)))
>> -    (home-page "https://github.com/jonathanslenders/python-prompt-toolkit")
>> +    (home-page "https://github.com/prompt-toolkit/python-prompt-toolkit")
>>      (synopsis "Library for building command line interfaces in Python")
>>      (description
>>       "Prompt-Toolkit is a library for building interactive command line
>> @@ -12104,6 +12144,10 @@ characters, mouse support, and auto suggestions.")
>>  (define-public python2-prompt-toolkit-1
>>    (package-with-python2 python-prompt-toolkit-1))
>>  
>> +(define-public prompt-toolkit-2-instead-of-prompt-toolkit
>> +  (package-input-rewriting/spec
>> +   `(("python-prompt-toolkit" . ,(const python-prompt-toolkit-2)))))
>
> Is this actually necessary?  Just changing the inputs as you did above
> should be sufficient I think.

If one dependency is OK with python-prompt-toolkit in version 3, but a
package has an implicit dependency on python-prompt-toolkit in version
2, then we either have to pin them all to version 2, and the OK
dependency does not get to envoy the update, or we have to resort to this.

I did it because python-ipython (19 dependents) is OK with
the update, and I did not want to pin it (and all its dependents) to python-prompt-toolkit-2.

This is my first time making such an involved update, so I'm open to
suggestions as to alternative ways of doing this.
Marius Bakke May 25, 2020, 10:21 p.m. UTC | #3
Edouard Klein <edou@rdklein.fr> writes:

>>>      (synopsis "Interpretable Machine Learning (iML) package")
>>>      (description "Interpretable ML (iML) is a set of data type objects,
>>>  visualizations, and interfaces that can be used by any method designed to
>>> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
>>> index b8a51570c3..5fd7e274e9 100644
>>> --- a/gnu/packages/python-xyz.scm
>>> +++ b/gnu/packages/python-xyz.scm
>>> @@ -8922,6 +8922,7 @@ interactive computing.")
>>>      (build-system python-build-system)
>>>      (propagated-inputs
>>>       `(("python-ipykernel" ,python-ipykernel)
>>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>>         ("python-notebook" ,python-notebook)))
>>>      (native-inputs
>>>       `(("python-certifi" ,python-certifi)
>>> @@ -8950,6 +8951,7 @@ notebooks.")
>>>      (propagated-inputs
>>>       `(("python-ipython" ,python-ipython)
>>>         ("python-traitlets" ,python-traitlets)
>>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>>         ("python-widgetsnbextension" ,python-widgetsnbextension)))
>>>      (native-inputs
>>>       `(("python-nose" ,python-nose)
>>> @@ -8980,7 +8982,7 @@ in the data.")
>>>      (propagated-inputs
>>>       `(("python-ipykernel" ,python-ipykernel)
>>>         ("python-jupyter-client" ,python-jupyter-client)
>>> -       ("python-prompt-toolkit" ,python-prompt-toolkit)
>>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>>         ("python-pygments" ,python-pygments)))
>>>      (native-inputs
>>>       `(("python-nose" ,python-nose)))
>>> @@ -12049,6 +12051,44 @@ collections of data.")
>>>    (package-with-python2 python-backpack))
>>
>> It would be great to update these packages instead of pinning to the old
>> version.  I won't blame you if you don't feel like embarking on that
>> journey though.
>>
>
> In the new patches I'm about to send, I updated them. Alas even their
> latest versions still require python-prompt-toolkit <=2.1, so I had to
> pin the dependencies. I did it in a cleaner way, though.

Oh too bad that updating did not work.  Terrible that these are so tied
to the version of python-prompt-toolkit.  Can you split those updates
out to separate patches, preceding the prompt-toolkit patch?  Then they
can be reverted and tested individually without having to revert the
whole thing in case there are problems.

>>> +(define-public python-prompt-toolkit-2
>>>    (package
>>>      (name "python-prompt-toolkit")
>>>      (version "2.0.7")
>>> @@ -12077,7 +12117,7 @@ collections of data.")
>>>         ("python-pygments" ,python-pygments)))
>>>      (native-inputs
>>>       `(("python-pytest" ,python-pytest)))
>>> -    (home-page "https://github.com/jonathanslenders/python-prompt-toolkit")
>>> +    (home-page "https://github.com/prompt-toolkit/python-prompt-toolkit")
>>>      (synopsis "Library for building command line interfaces in Python")
>>>      (description
>>>       "Prompt-Toolkit is a library for building interactive command line
>>> @@ -12104,6 +12144,10 @@ characters, mouse support, and auto suggestions.")
>>>  (define-public python2-prompt-toolkit-1
>>>    (package-with-python2 python-prompt-toolkit-1))
>>>  
>>> +(define-public prompt-toolkit-2-instead-of-prompt-toolkit
>>> +  (package-input-rewriting/spec
>>> +   `(("python-prompt-toolkit" . ,(const python-prompt-toolkit-2)))))
>>
>> Is this actually necessary?  Just changing the inputs as you did above
>> should be sufficient I think.
>
> If one dependency is OK with python-prompt-toolkit in version 3, but a
> package has an implicit dependency on python-prompt-toolkit in version
> 2, then we either have to pin them all to version 2, and the OK
> dependency does not get to envoy the update, or we have to resort to this.
>
> I did it because python-ipython (19 dependents) is OK with
> the update, and I did not want to pin it (and all its dependents) to python-prompt-toolkit-2.
>
> This is my first time making such an involved update, so I'm open to
> suggestions as to alternative ways of doing this.

Oh I see, makes sense.  The new patch is much clearer.  I will send a
separate reply with further comments.
Edouard Klein May 26, 2020, 9:28 a.m. UTC | #4
Marius Bakke writes:

> Edouard Klein <edou@rdklein.fr> writes:
>
>>>>      (synopsis "Interpretable Machine Learning (iML) package")
>>>>      (description "Interpretable ML (iML) is a set of data type objects,
>>>>  visualizations, and interfaces that can be used by any method designed to
>>>> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
>>>> index b8a51570c3..5fd7e274e9 100644
>>>> --- a/gnu/packages/python-xyz.scm
>>>> +++ b/gnu/packages/python-xyz.scm
>>>> @@ -8922,6 +8922,7 @@ interactive computing.")
>>>>      (build-system python-build-system)
>>>>      (propagated-inputs
>>>>       `(("python-ipykernel" ,python-ipykernel)
>>>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>>>         ("python-notebook" ,python-notebook)))
>>>>      (native-inputs
>>>>       `(("python-certifi" ,python-certifi)
>>>> @@ -8950,6 +8951,7 @@ notebooks.")
>>>>      (propagated-inputs
>>>>       `(("python-ipython" ,python-ipython)
>>>>         ("python-traitlets" ,python-traitlets)
>>>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>>>         ("python-widgetsnbextension" ,python-widgetsnbextension)))
>>>>      (native-inputs
>>>>       `(("python-nose" ,python-nose)
>>>> @@ -8980,7 +8982,7 @@ in the data.")
>>>>      (propagated-inputs
>>>>       `(("python-ipykernel" ,python-ipykernel)
>>>>         ("python-jupyter-client" ,python-jupyter-client)
>>>> -       ("python-prompt-toolkit" ,python-prompt-toolkit)
>>>> +       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
>>>>         ("python-pygments" ,python-pygments)))
>>>>      (native-inputs
>>>>       `(("python-nose" ,python-nose)))
>>>> @@ -12049,6 +12051,44 @@ collections of data.")
>>>>    (package-with-python2 python-backpack))
>>>
>>> It would be great to update these packages instead of pinning to the old
>>> version.  I won't blame you if you don't feel like embarking on that
>>> journey though.
>>>
>>
>> In the new patches I'm about to send, I updated them. Alas even their
>> latest versions still require python-prompt-toolkit <=2.1, so I had to
>> pin the dependencies. I did it in a cleaner way, though.
>
> Oh too bad that updating did not work.  Terrible that these are so tied
> to the version of python-prompt-toolkit.  Can you split those updates
> out to separate patches, preceding the prompt-toolkit patch?  Then they
> can be reverted and tested individually without having to revert the
> whole thing in case there are problems.
>

Of course :) I should have thought about it, sorry.


>>>> +(define-public python-prompt-toolkit-2
>>>>    (package
>>>>      (name "python-prompt-toolkit")
>>>>      (version "2.0.7")
>>>> @@ -12077,7 +12117,7 @@ collections of data.")
>>>>         ("python-pygments" ,python-pygments)))
>>>>      (native-inputs
>>>>       `(("python-pytest" ,python-pytest)))
>>>> -    (home-page "https://github.com/jonathanslenders/python-prompt-toolkit")
>>>> +    (home-page "https://github.com/prompt-toolkit/python-prompt-toolkit")
>>>>      (synopsis "Library for building command line interfaces in Python")
>>>>      (description
>>>>       "Prompt-Toolkit is a library for building interactive command line
>>>> @@ -12104,6 +12144,10 @@ characters, mouse support, and auto suggestions.")
>>>>  (define-public python2-prompt-toolkit-1
>>>>    (package-with-python2 python-prompt-toolkit-1))
>>>>  
>>>> +(define-public prompt-toolkit-2-instead-of-prompt-toolkit
>>>> +  (package-input-rewriting/spec
>>>> +   `(("python-prompt-toolkit" . ,(const python-prompt-toolkit-2)))))
>>>
>>> Is this actually necessary?  Just changing the inputs as you did above
>>> should be sufficient I think.
>>
>> If one dependency is OK with python-prompt-toolkit in version 3, but a
>> package has an implicit dependency on python-prompt-toolkit in version
>> 2, then we either have to pin them all to version 2, and the OK
>> dependency does not get to envoy the update, or we have to resort to this.
>>
>> I did it because python-ipython (19 dependents) is OK with
>> the update, and I did not want to pin it (and all its dependents) to python-prompt-toolkit-2.
>>
>> This is my first time making such an involved update, so I'm open to
>> suggestions as to alternative ways of doing this.
>
> Oh I see, makes sense.  The new patch is much clearer.  I will send a
> separate reply with further comments.
diff mbox series

Patch

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 6552d171bf..5553b31bb5 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -14,6 +14,7 @@ 
 ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
 ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
+;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1803,12 +1804,14 @@  advanced research.")
          "1k8szlpm19rcwcxdny9qdm3gmaqq8akb4xlvrzyz8c2d679aak6l"))))
     (build-system python-build-system)
     (propagated-inputs
-     `(("ipython" ,python-ipython)
-       ("nose" ,python-nose)
+     `(("ipython" ,(prompt-toolkit-2-instead-of-prompt-toolkit
+                    python-ipython))
        ("numpy" ,python-numpy)
        ("pandas" ,python-pandas)
        ("scipy" ,python-scipy)))
-    (home-page "http://github.com/interpretable-ml/iml")
+    (native-inputs
+     `(("nose" ,python-nose)))
+    (home-page "https://github.com/interpretable-ml/iml")
     (synopsis "Interpretable Machine Learning (iML) package")
     (description "Interpretable ML (iML) is a set of data type objects,
 visualizations, and interfaces that can be used by any method designed to
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b8a51570c3..5fd7e274e9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8922,6 +8922,7 @@  interactive computing.")
     (build-system python-build-system)
     (propagated-inputs
      `(("python-ipykernel" ,python-ipykernel)
+       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
        ("python-notebook" ,python-notebook)))
     (native-inputs
      `(("python-certifi" ,python-certifi)
@@ -8950,6 +8951,7 @@  notebooks.")
     (propagated-inputs
      `(("python-ipython" ,python-ipython)
        ("python-traitlets" ,python-traitlets)
+       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
        ("python-widgetsnbextension" ,python-widgetsnbextension)))
     (native-inputs
      `(("python-nose" ,python-nose)
@@ -8980,7 +8982,7 @@  in the data.")
     (propagated-inputs
      `(("python-ipykernel" ,python-ipykernel)
        ("python-jupyter-client" ,python-jupyter-client)
-       ("python-prompt-toolkit" ,python-prompt-toolkit)
+       ("python-prompt-toolkit" ,python-prompt-toolkit-2)
        ("python-pygments" ,python-pygments)))
     (native-inputs
      `(("python-nose" ,python-nose)))
@@ -12049,6 +12051,44 @@  collections of data.")
   (package-with-python2 python-backpack))
 
 (define-public python-prompt-toolkit
+  (package
+    (name "python-prompt-toolkit")
+    (version "3.0.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "prompt_toolkit" version))
+       (sha256
+        (base32
+         "1j3x5s4gp4ih73sbcni0a0vffbzvrxbrbnkvb3fzjgxn810ilgan"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'install 'post-install-check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; HOME is needed for the test
+             ;; "test_pathcompleter_can_expanduser".
+             (setenv "HOME" "/tmp")
+             (add-installed-pythonpath inputs outputs)
+             (invoke "py.test"))))))
+    (propagated-inputs
+     `(("python-wcwidth" ,python-wcwidth)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page
+     "https://github.com/prompt-toolkit/python-prompt-toolkit")
+    (synopsis "Library for building command line interfaces in Python")
+    (description
+     "Prompt-Toolkit is a library for building interactive command line
+interfaces in Python.  It's like GNU Readline but it also features syntax
+highlighting while typing, out-of-the-box multi-line input editing, advanced
+code completion, incremental search, support for Chinese double-width
+characters, mouse support, and auto suggestions.")
+    (license license:bsd-3)))
+
+(define-public python-prompt-toolkit-2
   (package
     (name "python-prompt-toolkit")
     (version "2.0.7")
@@ -12077,7 +12117,7 @@  collections of data.")
        ("python-pygments" ,python-pygments)))
     (native-inputs
      `(("python-pytest" ,python-pytest)))
-    (home-page "https://github.com/jonathanslenders/python-prompt-toolkit")
+    (home-page "https://github.com/prompt-toolkit/python-prompt-toolkit")
     (synopsis "Library for building command line interfaces in Python")
     (description
      "Prompt-Toolkit is a library for building interactive command line
@@ -12104,6 +12144,10 @@  characters, mouse support, and auto suggestions.")
 (define-public python2-prompt-toolkit-1
   (package-with-python2 python-prompt-toolkit-1))
 
+(define-public prompt-toolkit-2-instead-of-prompt-toolkit
+  (package-input-rewriting/spec
+   `(("python-prompt-toolkit" . ,(const python-prompt-toolkit-2)))))
+
 (define-public python-jedi
   (package
     (name "python-jedi")