Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/source/upcoming_release_notes/404-mnt_enable_jedi.rst
Original file line number Diff line number Diff line change
@@ -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
15 changes: 13 additions & 2 deletions hutch_python/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions hutch_python/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading