laminlabs / nbproject

Light-weight Jupyter notebook tracker.
https://lamin.ai/docs/nbproject
Apache License 2.0
34 stars 0 forks source link

Dependency tracking requires save / inconsistent version display between header output and nbproject.__version__ #128

Open sunnyosun opened 2 years ago

sunnyosun commented 2 years ago

See here:

Screen Shot 2022-07-10 at 15 48 54
Koncopd commented 2 years ago

Hi, thanks, this should be fixed on master.

sunnyosun commented 2 years ago

I think the issue was because vscode doesn't immediately autosave the notebook.

If I run Header() twice it displays the new dependencies.

sunnyosun commented 2 years ago

@Koncopd I'm already using the latest version 0.1.6, but somehow the header still says 0.0.3... Is this a bug?

Screen Shot 2022-07-10 at 18 03 18
falexwolf commented 2 years ago

The auto-inference of dependencies only works if the current notebook buffer is saved on disk.

Jupyter Lab automatically saves, hence there is no quirks. VS Code requires to hit save before re-running.

I think we have to spell this out in the tutorial or print a logging warning or something like this. 🤔 Otherwise, users will probably get confused.

falexwolf commented 2 years ago

@sunnyosun , I think that also Jupyter Lab doesn't auto-save. I needed to hit save before pandas is detected as a dependency also on Jupyter Lab.

image

I think that's OK to expect people to hit save. Let's just document it.

sunnyosun commented 2 years ago

Looks like nbproject also didn't detect bionty version correctly. Did I do something wrong?

Screen Shot 2022-07-11 at 18 58 01
Koncopd commented 2 years ago

@sunnyosun and what do you have in conda list and pip freeze? I think this happens when you use develop install (for example flit install -s or pip install -e), it freezes the version then in the environment and doesn't update it when the package code changes. The version is updated only when you reinstall the package.

From my conda env image But from python it shows 0.2.0.

sunnyosun commented 2 years ago

Hmm, I have 0.2.0 in both conda and pip, also I've tried to reinstall the package 🤔

Koncopd commented 2 years ago

Hm, interesting, i need to check with bionty.