test_pylab fails
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- testing-qa
調査の方向性
tests/inprocess/test_kernel.py とその test_pylab の失敗から始め、次に traceback 内の InProcessInteractiveShell.enable_pylab と enable_matplotlib を調べます。IPython 8.29 の非推奨の pylabtools API との相互作用を確認します。in-process pylab テストが報告された例外なしに完了してパスすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi,
Running the test suite of ipykernel 6.29.5 using Pthon 3.10 and Ipython 8.29.0, I see this test failure:
__________________________________ test_pylab __________________________________
kc = <ipykernel.inprocess.blocking.BlockingInProcessKernelClient object at 0x7ffff3446980>
def test_pylab(kc):
"""Does %pylab work in the in-process kernel?"""
_ = pytest.importorskip("matplotlib", reason="This test requires matplotlib")
kc.execute("%pylab")
out, err = assemble_output(kc.get_iopub_msg)
> assert "matplotlib" in out
E AssertionError: assert 'matplotlib' in ''
_ = <module 'matplotlib' from '/gnu/store/wbwcw9vpg32mxkasl19k7h6y1dfvv8an-python-matplotlib-3.8.2/lib/python3.10/site-packages/matplotlib/__init__.py'>
err = ''
kc = <ipykernel.inprocess.blocking.BlockingInProcessKernelClient object at 0x7ffff3446980>
out = ''
tests/inprocess/test_kernel.py:61: AssertionError
---------------------------- Captured stdout setup -----------------------------
status
------------------------------ Captured log call -------------------------------
INFO ipykernel.inprocess.ipkernel:ipkernel.py:483 Exception in execute request:
---------------------------------------------------------------------------
DeprecationWarning Traceback (most recent call last)
Cell In[2], line 1
----> 1 get_ipython().run_line_magic('pylab', '')
File /gnu/store/62qx5jgqg1sz496jkvcpvlkg42qc3zzp-python-ipython-8.29.0/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2480, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
2478 kwargs['local_ns'] = self.get_local_scope(stack_depth)
2479 with self.builtin_trap:
-> 2480 result = fn(*args, **kwargs)
2482 # The code below prevents the output from being displayed
2483 # when using magics with decorator @output_can_be_silenced
2484 # when the last Python token in the expression is a ';'.
2485 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):
File /gnu/store/62qx5jgqg1sz496jkvcpvlkg42qc3zzp-python-ipython-8.29.0/lib/python3.10/site-packages/IPython/core/magics/pylab.py:159, in PylabMagics.pylab(self, line)
155 else:
156 # invert no-import flag
157 import_all = not args.no_import_all
--> 159 gui, backend, clobbered = self.shell.enable_pylab(args.gui, import_all=import_all)
160 self._show_matplotlib_backend(args.gui, backend)
161 print(
162 "%pylab is deprecated, use %matplotlib inline and import the required libraries."
163 )
File ~/guix-build-python-ipykernel-6.29.5.drv-0/ipykernel-6.29.5/ipykernel/inprocess/ipkernel.py:200, in InProcessInteractiveShell.enable_pylab(self, gui, import_all, welcome_message)
198 if not gui:
199 gui = self.kernel.gui
--> 200 return super().enable_pylab(gui, import_all, welcome_message)
File /gnu/store/62qx5jgqg1sz496jkvcpvlkg42qc3zzp-python-ipython-8.29.0/lib/python3.10/site-packages/IPython/core/interactiveshell.py:3719, in InteractiveShell.enable_pylab(self, gui, import_all, welcome_message)
3692 """Activate pylab support at runtime.
3693
3694 This turns on support for matplotlib, preloads into the interactive
(...)
3715 This argument is ignored, no welcome message will be displayed.
3716 """
3717 from IPython.core.pylabtools import import_pylab
-> 3719 gui, backend = self.enable_matplotlib(gui)
3721 # We want to prevent the loading of pylab to pollute the user's
3722 # namespace as shown by the %who* magics, so we execute the activation
3723 # code in an empty namespace, and we update *both* user_ns and
3724 # user_ns_hidden with this information.
3725 ns = {}
File ~/guix-build-python-ipykernel-6.29.5.drv-0/ipykernel-6.29.5/ipykernel/inprocess/ipkernel.py:194, in InProcessInteractiveShell.enable_matplotlib(self, gui)
192 if not gui:
193 gui = self.kernel.gui
--> 194 return super().enable_matplotlib(gui)
File /gnu/store/62qx5jgqg1sz496jkvcpvlkg42qc3zzp-python-ipython-8.29.0/lib/python3.10/site-packages/IPython/core/interactiveshell.py:3665, in InteractiveShell.enable_matplotlib(self, gui)
3662 import matplotlib_inline.backend_inline
3664 from IPython.core import pylabtools as pt
-> 3665 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)
3667 if gui != None:
3668 # If we have our first gui selection, store it
3669 if self.pylab_gui_select is None:
File /gnu/store/62qx5jgqg1sz496jkvcpvlkg42qc3zzp-python-ipython-8.29.0/lib/python3.10/site-packages/IPython/core/pylabtools.py:358, in find_gui_and_backend(gui, gui_select)
355 mpl_version_info = getattr(matplotlib, "__version_info__", (0, 0))
356 has_unified_qt_backend = mpl_version_info >= (3, 5)
--> 358 from IPython.core.pylabtools import backends
360 backends_ = dict(backends)
361 if not has_unified_qt_backend:
File /gnu/store/62qx5jgqg1sz496jkvcpvlkg42qc3zzp-python-ipython-8.29.0/lib/python3.10/site-packages/IPython/core/pylabtools.py:77, in __getattr__(name)
75 def __getattr__(name):
76 if name in ("backends", "backend2gui"):
---> 77 warnings.warn(
78 f"{name} is deprecated since IPython 8.24, backends are managed "
79 "in matplotlib and can be externally registered.",
80 DeprecationWarning,
81 )
82 return globals()[f"_deprecated_{name}"]
83 raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
DeprecationWarning: backends is deprecated since IPython 8.24, backends are managed in matplotlib and can be externally registered.
It seems caused by the use of a deprecated IPython API.
- 主要言語
- Python
- スター
- 734
- フォーク
- 411
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 9
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ipython/ipykernel のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
ipython/ipykernel の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
learningequality/ricecooker#747 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
run-llama/llama_index#23199 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
KhronosGroup/glTF-Blender-IO#2769 ·