-
Notifications
You must be signed in to change notification settings - Fork 391
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
Running isort on Jupytext notebooks represented as scripts break some cells #553
Comments
@timothycrosley implemented two new options in
See this commit: a73f386 |
Hi @rijobro , thank you for reporting this. Could you share the |
Hi, yes it seems that the cell containing the imports had the following metadata:
And changing it to the following solved the problem
|
This is related to #446 - It would be great to be able to run
isort
easily on a Jupytext notebook, however ATM it does not work that well.Indeed,
isort
seems to move the comments preceding animport
together with the import. Thus, when we runisort
on a.py
notebook, imports at the top of the cell are moved along the preceding cell marker (# %%
or# +
), breaking the corresponding cell.Possibly one way to fix this is to insert one blank line between the cell marker and the cell content. I'll see if we can add an option to do that, and if
isort
works better, then. Does this option work well withblack
? If so, it should be made the default for when a notebook is piped into an other command.The text was updated successfully, but these errors were encountered: