From c126c9e3734143f21866f67e41de6d265c0c9d85 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Fri, 27 Mar 2026 10:16:51 -0700 Subject: [PATCH 1/4] MNT: re-enable jedi completion for environments that use newer IPython builds --- hutch_python/cli.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hutch_python/cli.py b/hutch_python/cli.py index c36f51b6..2e6772bc 100644 --- a/hutch_python/cli.py +++ b/hutch_python/cli.py @@ -85,6 +85,14 @@ def configure_tab_completion(ipy_config): """ Disable Jedi and tweak IPython tab completion. + At some IPython version this became no longer needed due to fixed performance issues + stemming from no longer by default executing properties. + + At some IPython version this became counterproductive because the non-jedi + completer no longer works properly for us. + + This change happend somewhere between 8.4.0 and 8.36.0 + Parameters ---------- ipy_config : traitlets.config.Config @@ -135,8 +143,11 @@ def configure_ipython_session(args: HutchPythonArgs): # Disable reformatting input with black ipy_config.TerminalInteractiveShell.autoformatter = None - # Set up tab completion modifications - configure_tab_completion(ipy_config) + + if IPython.version_info < (8, 5, 0): + # Set up tab completion modifications + # The last version we deployed that needed this is 8.4.0 + configure_tab_completion(ipy_config) # disable default banner ipy_config.TerminalIPythonApp.display_banner = False From 1e015418f805d5ecb6c05fb209b672e255997cca Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Fri, 27 Mar 2026 11:15:19 -0700 Subject: [PATCH 2/4] TST: give up on this test after an hour ipy completer api is too unstable to bother, and this test didn't even catch our issue last time --- hutch_python/tests/test_cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hutch_python/tests/test_cli.py b/hutch_python/tests/test_cli.py index 779cd5e7..8bb70737 100644 --- a/hutch_python/tests/test_cli.py +++ b/hutch_python/tests/test_cli.py @@ -156,6 +156,7 @@ def test_run_script(): main() +@pytest.mark.skipif(IPython.version_info[:3] > (8, 4, 0), reason="IPython completer API too unstable to test against") def test_ipython_tab_completion(): class MyTest: THIS_SHOULD_NOT_BE_THERE = None From 59481288ca100e6e324308748ddcb8d6e8738889 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Fri, 27 Mar 2026 11:15:44 -0700 Subject: [PATCH 3/4] MNT: compare tuples of equal size for more understandable comparisons --- hutch_python/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hutch_python/cli.py b/hutch_python/cli.py index 2e6772bc..9ac9b5e2 100644 --- a/hutch_python/cli.py +++ b/hutch_python/cli.py @@ -144,9 +144,9 @@ def configure_ipython_session(args: HutchPythonArgs): # Disable reformatting input with black ipy_config.TerminalInteractiveShell.autoformatter = None - if IPython.version_info < (8, 5, 0): + if IPython.version_info[:3] <= (8, 4, 0): # Set up tab completion modifications - # The last version we deployed that needed this is 8.4.0 + # The last IPython version we deployed that needed this is 8.4.0 configure_tab_completion(ipy_config) # disable default banner From 8caad82c5cd864b528310b82efed0b7055ad782c Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Fri, 27 Mar 2026 11:17:40 -0700 Subject: [PATCH 4/4] DOC: pre-release notes --- .../404-mnt_enable_jedi.rst | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst diff --git a/docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst b/docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst new file mode 100644 index 00000000..f7a6eaa6 --- /dev/null +++ b/docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst @@ -0,0 +1,23 @@ +404 mnt_enable_jedi +################### + +API Changes +----------- +- N/A + +Features +-------- +- N/A + +Bugfixes +-------- +- Work around an issue where non-jedi completions were broken for pcdsdevices + in certain IPython ranges by re-enabling jedi completions in those ranges. + +Maintenance +----------- +- N/A + +Contributors +------------ +- zllentz