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 diff --git a/hutch_python/cli.py b/hutch_python/cli.py index c36f51b6..9ac9b5e2 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[:3] <= (8, 4, 0): + # Set up tab completion modifications + # The last IPython version we deployed that needed this is 8.4.0 + configure_tab_completion(ipy_config) # disable default banner ipy_config.TerminalIPythonApp.display_banner = False 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