Skip to content

Decrease cost of ipynb code path when unneeded#3748

Merged
JelleZijlstra merged 6 commits into
psf:mainfrom
hauntsaninja:jupy
Jun 27, 2023
Merged

Decrease cost of ipynb code path when unneeded#3748
JelleZijlstra merged 6 commits into
psf:mainfrom
hauntsaninja:jupy

Conversation

@hauntsaninja

Copy link
Copy Markdown
Collaborator

IPython is a very expensive import, like, at least 300ms. I'd also venture that it's much more common than tokenize-rt, which is like 30ms. I work in a repo where I use black, have IPython installed and there happen to be a couple notebooks (that we don't want formatted). I know I can force exclude ipynb, but this change doesn't really have a cost.

IPython is a very expensive import, like, at least 300ms. I'd also
venture that it's much more common than tokenize-rt, which is like 30ms.
I work in a repo where I use black, have IPython installed and there
happen to be a couple notebooks (that we don't want formatted). I know I
can force exclude ipynb, but this change doesn't really have a cost.
@github-actions

github-actions Bot commented Jun 24, 2023

Copy link
Copy Markdown
Contributor

diff-shades reports zero changes comparing this PR (467a2c9) to main (93989e9).


What is this? | Workflow run | diff-shades documentation

Comment thread src/black/handle_ipynb_magics.py
@JelleZijlstra JelleZijlstra merged commit 31b3b67 into psf:main Jun 27, 2023
@hauntsaninja hauntsaninja deleted the jupy branch June 27, 2023 00:53
SWHL pushed a commit to SWHL/black that referenced this pull request Jun 27, 2023
IPython is a very expensive import, like, at least 300ms. I'd also
venture that it's much more common than tokenize-rt, which is like 30ms.
I work in a repo where I use black, have IPython installed and there
happen to be a couple notebooks (that we don't want formatted). I know I
can force exclude ipynb, but this change doesn't really have a cost.
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