Skip to content

Accomodate nbdev v1 users #648

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
3 tasks done
Tracked by #647
hamelsmu opened this issue Jul 20, 2022 · 3 comments
Closed
3 tasks done
Tracked by #647

Accomodate nbdev v1 users #648

hamelsmu opened this issue Jul 20, 2022 · 3 comments
Labels

Comments

@hamelsmu
Copy link
Contributor

hamelsmu commented Jul 20, 2022

  • make sure on nbdev website there's a very clear indicator of how to upgrade, or how to keep using the old version, including the home page.
  • hide_input no longer works from nbdev v1, this has been replaced with #|echo: false
  • Throw an error message with clear instrutions when someone tries to use nbdev v2 on a v1 project. We anticipate many people it's will upgrade to nbdev2 and use it on their nbdev1 project

cc: @jph00

@hamelsmu hamelsmu mentioned this issue Jul 24, 2022
10 tasks
@jph00 jph00 transferred this issue from fastai/nbprocess-old Jul 24, 2022
@warner-benjamin
Copy link

warner-benjamin commented Jul 24, 2022

Per Hamel, adding more issues attempting to convert a nbdev1 project to nbdev2.

  • nbdev_new doesn't appear to respect the existing nbs_path and creates new notebooks in the root directory. It creates a _quarto.yml file in root and nbs_path. Unsure if both are needed.
  • nbdev_new doesn't convert tst_flags from nbdev1's pipe format slow|cuda to nbdev2 format slow cuda. The nbdev1 format can cause broken pool errors in addition to test errors.

@jph00
Copy link
Contributor

jph00 commented Jul 30, 2022

Per Hamel, adding more issues attempting to convert a nbdev1 project to nbdev2.

We're not planning to support using nbdev_new to upgrade an existing project. Instead we will endeavor to improve nbdev_migrate where possible -- although it won't be entirely automatic.

@jph00
Copy link
Contributor

jph00 commented Jul 30, 2022

Here's the basic steps I took to upgrade ghapi:

# export LIBNAME=...

git rm Makefile
nbdev_migrate_directives
nbdev_export
git add $LIBNAME/_modidx.py
rm -rf docs

[[ $SHELL = *bash ]] && shopt -s globstar

perl -pi -e 's/#\|\s*hide_input/#| echo: false/' **/*.ipynb
perl -pi -e 's/#\|\s*hide_output/#| output: false/' **/*.ipynb
perl -pi -e 's/#\|\s*skip/#| eval: false/' **/*.ipynb
perl -pi -e 's/from nbdev.export import notebook2script/from nbdev import nbdev_export/' **/*.ipynb
perl -pi -e 's/notebook2script/nbdev_export/' **/*.ipynb
perl -pi -e 's/#\|?\s*all_slow/#| nbflags skip_exec/' *.ipynb

rm -f .gitconfig 
rm -f .git/hooks/post-merge

cat >>.gitignore <<EOF
_docs/
sidebar.yml
EOF

# change gh pages to gh-pages branch root
# move CNAME file

# change doc_path in settings.ini
# cp styles.css

nbdev_preview

@jph00 jph00 closed this as completed Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants