fastai / nbdev

Create delightful software with Jupyter Notebooks
https://nbdev.fast.ai/
Apache License 2.0
4.9k stars 487 forks source link

All Actions fail on initialization of new nbdev repo #1317

Closed nicole-brewer closed 1 year ago

nicole-brewer commented 1 year ago

I exactly followed the steps provided to initialize a new nbdev repo. All actions fail. To make sure I didn't do anything out of order, I deleted the repo and tried again. CI # 1 and # 2 fail with the same error reported in #1311. Deploy to GitHub Pages # 1 and # 2 fail with the same error reported in #1298. I left comments in both, but wanted to report these errors together since they happen on initialization of a new repo. I'm using nbdev version 2.2.10.

FerranC96 commented 1 year ago

Just chiming-in to say I've had similar issues and documented them on the fastai forums

deven-gqc commented 1 year ago

@nicole-brewer Can you try upgrading nbdev and fastcore to their latest versions? nbdev is currently at 2.3.11. fastcore is 1.5.28

iirc, this issue was fixed in #1200 and #1158

nicole-brewer commented 1 year ago

So I updated my conda environment to have these latest versions you listed, and the files created on nbdev_new are indeed different. So to make sure there wasn't any confusion, I deleted my repository and started from scratch, created the new files, and committed them without modification. "Deploy to Github pages" works now, I still get the following error for "CI":

+ echo 'Check we are starting with clean git checkout'
Check we are starting with clean git checkout
++ git status --porcelain -uno
+ [[ -n '' ]]
Trying to strip out notebooks
+ echo 'Trying to strip out notebooks'
+ nbdev_clean
+ echo 'Check that strip out was unnecessary'
Check that strip out was unnecessary
+ git status -s
 M nbs/00_core.ipynb
 M nbs/index.ipynb
++ git status --porcelain -uno
+ [[ -n  M nbs/00_core.ipynb
 M nbs/index.ipynb ]]
+ git status -uno
+ echo -e '!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_hooks'
+ false
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   nbs/00_core.ipynb
    modified:   nbs/index.ipynb

no changes added to commit (use "git add" and/or "git commit -a")
!!! Detected unstripped out notebooks
!!!Remember to run nbdev_install_hooks
Error: Process completed with exit code 1.

Seems to me to be related to #1311

deven-gqc commented 1 year ago

To fix this, you need to run the command, nbdev_install_hooks and then run nbdev_prepare, once that is done, push all the fiels to the repo and that should fix it.

A side question, did you install nbdev from conda or pypi?

nicole-brewer commented 1 year ago

I did this, deleted all the files in the repository and ran nbdev_new again. A few files were slightly different, but when I pushed, the action still produced the same error, since I only installed the hooks to my local machine and not whatever environment that action is set up with.

Btw, I'm using conda, and I create my environment from scratch every time I add a new requirement to environment.yml with conda env update --file environment.yml --prune.

FerranC96 commented 1 year ago

@nicole-brewer Can you try upgrading nbdev and fastcore to their latest versions? nbdev is currently at 2.3.11. fastcore is 1.5.28

iirc, this issue was fixed in #1200 and #1158

Like nicole-brewer, I'm also using conda and have nbdev 2.3.12 and fastcore 1.5.28. While I used to have her issue at some point last week, now I only have one of the CI actions failing due to a _path error in nbdev_readme (and subsequently nbdev_prepare).

This issue persists across clean installations and OSes (tested on macOS and fedora). Will try pip now and see if that fixes it (although I really don't want to use pip if possible)

deven-gqc commented 1 year ago

@FerranC96 you need to remove the ipynb-filter from your _quarto.yml. I've created a PR, that should fix the problem.

FerranC96 commented 1 year ago

Thanks a lot @deven-gqc ! Can confirm everything is working now!

seeM commented 1 year ago

Sorry about these confusing issues! We've made a couple fixes tracked in the other issues. See this forum post for an overview.