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

Allow setting cell name #652

Merged
merged 1 commit into from
Apr 27, 2021
Merged

Conversation

davidbrochart
Copy link
Collaborator

The cell name is now of the form /tmp/ipykernel_1789/2216019953.py, which makes it hard to compare error outputs with a traceback, because the cell name is embedded in it:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/tmp/ipykernel_1789/2216019953.py in <module>
----> 1 foo

NameError: name 'foo' is not defined

For instance in nbclient, the new ipykernel will require rewriting our tests because we check strict output equality.
It would be nice to allow setting the cell name by passing it in an environment variable, e.g.:

export IPYKERNEL_CELL_NAME="<IPY-INPUT>"

This should be enough for tests not involving the debugger.

@blink1073 blink1073 added this to the 6.0 milestone Apr 27, 2021
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@blink1073 blink1073 merged commit b83a08c into ipython:master Apr 27, 2021
@davidbrochart davidbrochart deleted the cell_name branch April 27, 2021 12:25
@SylvainCorlay
Copy link
Member

cc @JohanMabille does this have an impact on debugger filenames.

@JohanMabille
Copy link
Contributor

Setting IPYKERNEL_CELL_NAME will definitely breaks the debugger since the computed filenames in the frontend and the backend will not be the same anymore.

@davidbrochart
Copy link
Collaborator Author

Yes, it's a convenience for testing when the debugger is not involved.

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

Successfully merging this pull request may close these issues.

4 participants