nbdev icon indicating copy to clipboard operation
nbdev copied to clipboard

Throw a warning when imports and code are mixed in a cell

Open hamelsmu opened this issue 1 year ago • 1 comments

Right now we don't have good error messages when imports & code are mixed in a cell and things can hang leaving the user confused. We should catch this and throw a warning

hamelsmu avatar Aug 01 '22 22:08 hamelsmu

Note: it's fine to mix in an exported cell

jph00 avatar Aug 01 '22 22:08 jph00

@jph00 I am not sure if this is true. I have a simple notebook with constants.ipynb and it has basically

#export
import os, inspect
__file = inspect.getfile(lambda: None)
ROOT_DIR = 'here'

running nbdev_preview yields

Preparing to preview
[ 1/13] constants.ipynb
ERROR: No language set for Jupyter notebook

dsm-72 avatar Oct 24 '22 19:10 dsm-72