From takowl at gmail.com  Mon Apr  2 07:15:19 2018
From: takowl at gmail.com (Thomas Kluyver)
Date: Mon, 2 Apr 2018 13:15:19 +0200
Subject: [IPython-dev] IPython 6.3 and 5.6 released
Message-ID: <CAOvn4qjJfDwrLi5Ng1wsDKC6OF9+JrkLAB6MgP=0UF-zbvFqjQ@mail.gmail.com>

I've just released IPython version 6.3 and 5.6. You can find the release
notes here:

http://ipython.readthedocs.io/en/stable/whatsnew/version6.html#ipython-6-3
http://ipython.readthedocs.io/en/5.x/whatsnew/version5.html#ipython-5-6

These are both primarily bugfix releases, but there are a handful of minor
new features.

The master branch on Github is now heading towards 7.0. This will drop
support for Python 3.3, and hopefully include a reworking of the input
processing machinery.

Thanks to everyone who has contributed to these releases!

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20180402/a99cf4b3/attachment.html>

From damianavila at gmail.com  Mon Apr  9 08:18:28 2018
From: damianavila at gmail.com (=?UTF-8?Q?Dami=C3=A1n_Avila?=)
Date: Mon, 9 Apr 2018 09:18:28 -0300
Subject: [IPython-dev] IPython 6.3 and 5.6 released
In-Reply-To: <CAOvn4qjJfDwrLi5Ng1wsDKC6OF9+JrkLAB6MgP=0UF-zbvFqjQ@mail.gmail.com>
References: <CAOvn4qjJfDwrLi5Ng1wsDKC6OF9+JrkLAB6MgP=0UF-zbvFqjQ@mail.gmail.com>
Message-ID: <CAH+mRR2GYFN4DkvYUFQ5sFH=0naOyRaHJHtetpfFQSE48oaBaA@mail.gmail.com>

Congrats on the releases, Thomas! And thanks!

2018-04-02 8:15 GMT-03:00 Thomas Kluyver <takowl at gmail.com>:

> I've just released IPython version 6.3 and 5.6. You can find the release
> notes here:
>
> http://ipython.readthedocs.io/en/stable/whatsnew/version6.html#ipython-6-3
> http://ipython.readthedocs.io/en/5.x/whatsnew/version5.html#ipython-5-6
>
> These are both primarily bugfix releases, but there are a handful of minor
> new features.
>
> The master branch on Github is now heading towards 7.0. This will drop
> support for Python 3.3, and hopefully include a reworking of the input
> processing machinery.
>
> Thanks to everyone who has contributed to these releases!
>
> Thomas
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at python.org
> https://mail.python.org/mailman/listinfo/ipython-dev
>
>


-- 
*Dami?n Avila*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20180409/ed33f08f/attachment.html>

From jakevdp at cs.washington.edu  Tue Apr 10 01:41:58 2018
From: jakevdp at cs.washington.edu (Jacob Vanderplas)
Date: Tue, 10 Apr 2018 01:41:58 -0400
Subject: [IPython-dev] Accessing get_ipython() within an embedded shell
Message-ID: <CACpqBg3CiYqt=LqtgZrg_MJNsKOztA4ojYKcexOcfECJ8DMkQg@mail.gmail.com>

I'm trying to create automated tests for some magic functions within a
pytest framework. I've figured out how to do part of what I need using an
embedded interactive shell; briefly, I do something like this:

from IPython.terminal.embed import InteractiveShellEmbed
ipshell = InteractiveShellEmbed()
out = ipshell.run_cell("%my_magic_command")
assert out.result == expected_result

The problem I encounter is that my magic function optionally uses IPython
.get_ipython().user_ns to access variables in the user namespace, and
IPython.get_ipython() returns None when run within an embedded shell in
this way.

Is there a way to create a simple embedded shell like this one that will
behave as if it is an actual IPython shell, with IPython.get_ipython()
defined?

Thanks,

  Jake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20180410/b1e3d0cd/attachment.html>

From wes.turner at gmail.com  Tue Apr 10 02:22:12 2018
From: wes.turner at gmail.com (Wes Turner)
Date: Tue, 10 Apr 2018 02:22:12 -0400
Subject: [IPython-dev] Accessing get_ipython() within an embedded shell
In-Reply-To: <CACpqBg3CiYqt=LqtgZrg_MJNsKOztA4ojYKcexOcfECJ8DMkQg@mail.gmail.com>
References: <CACpqBg3CiYqt=LqtgZrg_MJNsKOztA4ojYKcexOcfECJ8DMkQg@mail.gmail.com>
Message-ID: <CACfEFw8YoSYJNVNSvGTJG4wYKvEMnpn2HOHZWWw1VWuFe3oqnw@mail.gmail.com>

ipdb or pytest-ipdb may have a helpful example?

https://github.com/gotcha/ipdb/blob/master/ipdb/__main__.py

https://github.com/mverteuil/pytest-ipdb/blob/master/pytestipdb/ptipdb.py

These all require nose:

https://github.com/ipython/ipython/blob/master/IPython/core/tests/test_magic_terminal.py

https://github.com/ipython/ipython/blob/master/IPython/core/tests/test_magic_arguments.py

https://github.com/ipython/ipython/blob/master/IPython/core/tests/test_interactiveshell.py

On Tuesday, April 10, 2018, Jacob Vanderplas <jakevdp at cs.washington.edu>
wrote:

> I'm trying to create automated tests for some magic functions within a
> pytest framework. I've figured out how to do part of what I need using an
> embedded interactive shell; briefly, I do something like this:
>
> from IPython.terminal.embed import InteractiveShellEmbed
> ipshell = InteractiveShellEmbed()
> out = ipshell.run_cell("%my_magic_command")
> assert out.result == expected_result
>
> The problem I encounter is that my magic function optionally uses IPython
> .get_ipython().user_ns to access variables in the user namespace, and
> IPython.get_ipython() returns None when run within an embedded shell in
> this way.
>
> Is there a way to create a simple embedded shell like this one that will
> behave as if it is an actual IPython shell, with IPython.get_ipython() def
> ined?
>
> Thanks,
>
>   Jake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20180410/df69a6f2/attachment.html>

From jakevdp at cs.washington.edu  Tue Apr 10 14:41:57 2018
From: jakevdp at cs.washington.edu (Jacob Vanderplas)
Date: Tue, 10 Apr 2018 14:41:57 -0400
Subject: [IPython-dev] Accessing get_ipython() within an embedded shell
In-Reply-To: <CACfEFw8YoSYJNVNSvGTJG4wYKvEMnpn2HOHZWWw1VWuFe3oqnw@mail.gmail.com>
References: <CACpqBg3CiYqt=LqtgZrg_MJNsKOztA4ojYKcexOcfECJ8DMkQg@mail.gmail.com>
 <CACfEFw8YoSYJNVNSvGTJG4wYKvEMnpn2HOHZWWw1VWuFe3oqnw@mail.gmail.com>
Message-ID: <CACpqBg0tQY54F5pOaVAwbXQotf2ehr2QNFkUo38KRXkmavdP7Q@mail.gmail.com>

Wes,
Thanks for the links! I found the clue I needed in the pytest-ipdb link.

Instead of using:

  from IPython.terminal.embed import InteractiveShellEmbed
  ipshell = InteractiveShellEmbed()

I used this:

  from IPython import InteractiveShell
  ipshell = InteractiveShell.instance()

And now calls to IPython.get_ipython() within the shell work properly.

Thanks,
    Jake

 Jake VanderPlas
 Senior Data Science Fellow
 Director of Open Software
 University of Washington eScience Institute

On Tue, Apr 10, 2018 at 2:22 AM, Wes Turner <wes.turner at gmail.com> wrote:

> ipdb or pytest-ipdb may have a helpful example?
>
> https://github.com/gotcha/ipdb/blob/master/ipdb/__main__.py
>
> https://github.com/mverteuil/pytest-ipdb/blob/master/pytestipdb/ptipdb.py
>
> These all require nose:
>
> https://github.com/ipython/ipython/blob/master/IPython/
> core/tests/test_magic_terminal.py
>
> https://github.com/ipython/ipython/blob/master/IPython/
> core/tests/test_magic_arguments.py
>
> https://github.com/ipython/ipython/blob/master/IPython/core/tests/test_
> interactiveshell.py
>
>
> On Tuesday, April 10, 2018, Jacob Vanderplas <jakevdp at cs.washington.edu>
> wrote:
>
>> I'm trying to create automated tests for some magic functions within a
>> pytest framework. I've figured out how to do part of what I need using
>> an embedded interactive shell; briefly, I do something like this:
>>
>> from IPython.terminal.embed import InteractiveShellEmbed
>> ipshell = InteractiveShellEmbed()
>> out = ipshell.run_cell("%my_magic_command")
>> assert out.result == expected_result
>>
>> The problem I encounter is that my magic function optionally uses IPython
>> .get_ipython().user_ns to access variables in the user namespace, and
>> IPython.get_ipython() returns None when run within an embedded shell in
>> this way.
>>
>> Is there a way to create a simple embedded shell like this one that will
>> behave as if it is an actual IPython shell, with IPython.get_ipython()
>> defined?
>>
>> Thanks,
>>
>>   Jake
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at python.org
> https://mail.python.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20180410/11f1ddcb/attachment.html>

From takowl at gmail.com  Tue Apr 10 15:18:04 2018
From: takowl at gmail.com (Thomas Kluyver)
Date: Tue, 10 Apr 2018 21:18:04 +0200
Subject: [IPython-dev] Accessing get_ipython() within an embedded shell
In-Reply-To: <CACpqBg0tQY54F5pOaVAwbXQotf2ehr2QNFkUo38KRXkmavdP7Q@mail.gmail.com>
References: <CACpqBg3CiYqt=LqtgZrg_MJNsKOztA4ojYKcexOcfECJ8DMkQg@mail.gmail.com>
 <CACfEFw8YoSYJNVNSvGTJG4wYKvEMnpn2HOHZWWw1VWuFe3oqnw@mail.gmail.com>
 <CACpqBg0tQY54F5pOaVAwbXQotf2ehr2QNFkUo38KRXkmavdP7Q@mail.gmail.com>
Message-ID: <CAOvn4qh59mJdQwRPj+o6TRTda84GQtMWdyNWohH7RcOE-K9tfA@mail.gmail.com>

On this topic, it bears reiterate that 'embedding' IPython has a specific
purpose: to run IPython with the namespace where it was called, like a
debugger with no stepping forwards.

If you want to run IPython programmatically with its own namespace, you
don't need to 'embed' it, and embedding has extra complexities that might
confuse things. You can still access the namespace of a regular IPython
shell object as ip.user_ns .

On 10 April 2018 at 20:41, Jacob Vanderplas <jakevdp at cs.washington.edu>
wrote:

> Wes,
> Thanks for the links! I found the clue I needed in the pytest-ipdb link.
>
> Instead of using:
>
>   from IPython.terminal.embed import InteractiveShellEmbed
>   ipshell = InteractiveShellEmbed()
>
> I used this:
>
>   from IPython import InteractiveShell
>   ipshell = InteractiveShell.instance()
>
> And now calls to IPython.get_ipython() within the shell work properly.
>
> Thanks,
>     Jake
>
>  Jake VanderPlas
>  Senior Data Science Fellow
>  Director of Open Software
>  University of Washington eScience Institute
>
> On Tue, Apr 10, 2018 at 2:22 AM, Wes Turner <wes.turner at gmail.com> wrote:
>
>> ipdb or pytest-ipdb may have a helpful example?
>>
>> https://github.com/gotcha/ipdb/blob/master/ipdb/__main__.py
>>
>> https://github.com/mverteuil/pytest-ipdb/blob/master/pytestipdb/ptipdb.py
>>
>> These all require nose:
>>
>> https://github.com/ipython/ipython/blob/master/IPython/core/
>> tests/test_magic_terminal.py
>>
>> https://github.com/ipython/ipython/blob/master/IPython/core/
>> tests/test_magic_arguments.py
>>
>> https://github.com/ipython/ipython/blob/master/IPython/core/
>> tests/test_interactiveshell.py
>>
>>
>> On Tuesday, April 10, 2018, Jacob Vanderplas <jakevdp at cs.washington.edu>
>> wrote:
>>
>>> I'm trying to create automated tests for some magic functions within a
>>> pytest framework. I've figured out how to do part of what I need using
>>> an embedded interactive shell; briefly, I do something like this:
>>>
>>> from IPython.terminal.embed import InteractiveShellEmbed
>>> ipshell = InteractiveShellEmbed()
>>> out = ipshell.run_cell("%my_magic_command")
>>> assert out.result == expected_result
>>>
>>> The problem I encounter is that my magic function optionally uses
>>> IPython.get_ipython().user_ns to access variables in the user
>>> namespace, and IPython.get_ipython() returns None when run within an
>>> embedded shell in this way.
>>>
>>> Is there a way to create a simple embedded shell like this one that will
>>> behave as if it is an actual IPython shell, with IPython.get_ipython()
>>> defined?
>>>
>>> Thanks,
>>>
>>>   Jake
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at python.org
>> https://mail.python.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at python.org
> https://mail.python.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20180410/d661ec85/attachment-0001.html>