hide_code icon indicating copy to clipboard operation
hide_code copied to clipboard

Support for recent nbconvert and traitlets

Open fdion opened this issue 3 years ago • 4 comments

Issue #92 raised the problem a few years back. The solution was to freeze nbconvert and traitlets. This is not practical anymore, and hide_code needs compatibility with more recent versions (at least 6.x for nbconvert)

#98 is also related.

fdion avatar Apr 14 '22 18:04 fdion

Same problem here!

Raudcu avatar May 03 '22 19:05 Raudcu

I've started working on a code base that includes a Jupyter Notebook setup to run in Binder and have encountered this issue too.

We have in our requirements.txt...

hide_code>=0.5.2
ipysheet>=0.4.4
ipywidgets>=7.6.3
jupyterlab>=3.0.15
jupyter_contrib_nbextensions

...which pulls in hide_code-0.6.0 which requires nbconvert<6 (from setup.py. traitlets-4.3.3 is also pulled in as a consequence which also seems a bit dated (current version on PyPi appears to be 5.2.2).

Install logs then go on to show that a bunch of packages are downgraded because of a conflict between nbclient-0.5.13...

 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
nbclient 0.5.13 requires traitlets>=5.0.0, but you have traitlets 4.3.3 which is incompatible.

So I figured I'd try out specifying a minimum version of nbclient>=0.6.4 and what do you know, it only goes and works!

My current requirements.txt for this are as follows, I hope others find it useful in the meantime.

hide_code>=0.5.2
ipysheet>=0.4.4
ipywidgets>=7.6.3
jupyterlab>=3.0.15
jupyter_contrib_nbextensions
nbclient>=0.6.4

ns-rse avatar Jun 14 '22 13:06 ns-rse

Im running into the same issue, thanks for the help here

canyon289 avatar Jun 18 '22 17:06 canyon289

Got it working for the newer versions of jupyter notebook Created a PR here https://github.com/kirbs-/hide_code/pull/102

Until its merged you folks can install off my fork

pip install git+https://github.com/canyon289/hide_code.git

canyon289 avatar Jun 23 '22 22:06 canyon289