Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: test suite fails with latest ipython #357

Open
ZLLentz opened this issue Feb 15, 2023 · 1 comment
Open

BLD: test suite fails with latest ipython #357

ZLLentz opened this issue Feb 15, 2023 · 1 comment

Comments

@ZLLentz
Copy link
Member

ZLLentz commented Feb 15, 2023

Expected Behavior

tests should pass

Current Behavior

with the latest ipython, there have been enough api or functional changes that the test suite no longer passes

Possible Solution

  • investigate what these tests represent and if the failure represents a real issue or a testing issue
  • revise the package and/or tests as appropriate for compatibility

Context

#356

@tangkong
Copy link
Contributor

From my brief investigations, hutch-python sets a couple of attributes on the ipython Completer, and aside from that doesn't interact with it much.

def configure_tab_completion(ipy_config):
"""
Disable Jedi and tweak IPython tab completion.
Parameters
----------
ipy_config : traitlets.config.Config
IPython configuration.
"""
# Old API for disabling Jedi. Keep in just in case API changes back.
ipy_config.InteractiveShellApp.Completer.use_jedi = False
# New API for disabling Jedi (two access points documented, use both)
ipy_config.Completer.use_jedi = False
ipy_config.IPCompleter.use_jedi = False
try:
# Monkeypatch IPython completion - we need it to respect __dir__
# when Jedi is disabled.
# Details: https://github.com/pcdshub/pcdsdevices/issues/709
# First, access it to see that the internals have not changed:
IPython.core.completer.dir2
except AttributeError:
logger.debug('Looks like the IPython API changed!')
else:
# Then monkeypatch it in:
IPython.core.completer.dir2 = dir

The test suite dove deeper into the internals (?), hitting upon an attribute that got deprecated. The line_buffer attribute is not guaranteed to exist (gh), so calling the attr_matches (gh) independently can lead to the attribute error as observed.

I'm not sure what ipython wants the public API to be here, it's not been annotated very clearly from the code itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants