Skip to content

Commit 6c3f360

Browse files
authored
Merge pull request #404 from ZLLentz/mnt_enable_jedi
MNT: re-enable jedi completion for environments that use newer IPython builds
2 parents b705967 + 8caad82 commit 6c3f360

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
404 mnt_enable_jedi
2+
###################
3+
4+
API Changes
5+
-----------
6+
- N/A
7+
8+
Features
9+
--------
10+
- N/A
11+
12+
Bugfixes
13+
--------
14+
- Work around an issue where non-jedi completions were broken for pcdsdevices
15+
in certain IPython ranges by re-enabling jedi completions in those ranges.
16+
17+
Maintenance
18+
-----------
19+
- N/A
20+
21+
Contributors
22+
------------
23+
- zllentz

hutch_python/cli.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ def configure_tab_completion(ipy_config):
8585
"""
8686
Disable Jedi and tweak IPython tab completion.
8787
88+
At some IPython version this became no longer needed due to fixed performance issues
89+
stemming from no longer by default executing properties.
90+
91+
At some IPython version this became counterproductive because the non-jedi
92+
completer no longer works properly for us.
93+
94+
This change happend somewhere between 8.4.0 and 8.36.0
95+
8896
Parameters
8997
----------
9098
ipy_config : traitlets.config.Config
@@ -135,8 +143,11 @@ def configure_ipython_session(args: HutchPythonArgs):
135143

136144
# Disable reformatting input with black
137145
ipy_config.TerminalInteractiveShell.autoformatter = None
138-
# Set up tab completion modifications
139-
configure_tab_completion(ipy_config)
146+
147+
if IPython.version_info[:3] <= (8, 4, 0):
148+
# Set up tab completion modifications
149+
# The last IPython version we deployed that needed this is 8.4.0
150+
configure_tab_completion(ipy_config)
140151

141152
# disable default banner
142153
ipy_config.TerminalIPythonApp.display_banner = False

hutch_python/tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def test_run_script():
156156
main()
157157

158158

159+
@pytest.mark.skipif(IPython.version_info[:3] > (8, 4, 0), reason="IPython completer API too unstable to test against")
159160
def test_ipython_tab_completion():
160161
class MyTest:
161162
THIS_SHOULD_NOT_BE_THERE = None

0 commit comments

Comments
 (0)