Skip to content

Make stack_data optional, defer to old_ultratb if not present #12054

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

Closed
wants to merge 11 commits into from

Conversation

alexmojaki
Copy link
Contributor

No description provided.

@alexmojaki
Copy link
Contributor Author

alexmojaki commented Dec 21, 2019

Oops, this was meant to be a PR into my PR, as in: alexmojaki#1

I'll delete this if you prefer.

Anyway, you can see the idea either way. ultratb.py now only contains:

try:
    import stack_data
except ImportError:
    from .ultratb_old import *
else:
    from .ultratb_new import *

while ultratb_old.py is the same as ultratb.py on master and ultratb_new.py is the new version as per my PR.

This is in response to @Carreau saying:

I'm happy to have an opt-in flag in IPython to use those if installed and see how it feels as a user for a couple of releases; and then switch to default once deemed good enough.

and I'm trying to figure out the best way to implement that.

I thought this would be pretty neat as it makes the switch seamless and keeps all imports of ultratb the same, but it completely destroys the git history and I don't see a way around that. I can't seem to get git to recognise any of this as a rename:

$ git mv ultratb.py ultratb_new.py
$ git status
On branch stack-data-optional
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        renamed:    ultratb.py -> ultratb_new.py

$ touch ultratb.py     
$ git status
On branch stack-data-optional
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        renamed:    ultratb.py -> ultratb_new.py

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        ultratb.py

$ git add ultratb.py 
$ git status        
On branch stack-data-optional
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   ultratb.py
        new file:   ultratb_new.py

So maybe if we want to preserve history and git blame the three files should be:

Any thoughts?

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

Successfully merging this pull request may close these issues.

2 participants