Skip to content
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

add floor on nbformat #84

Merged
merged 2 commits into from
Mar 22, 2022
Merged

add floor on nbformat #84

merged 2 commits into from
Mar 22, 2022

Conversation

jameslamb
Copy link
Member

@jameslamb jameslamb commented Mar 22, 2022

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

Proposed changes

  • adds a floor of nbformat>=5.2.0

Impact

Without these changes, it's possible to get into a situation with incompatible jupyter_server and nbformat versions, which prevents creation of notebooks (at least in Jupyter Lab).

Reproducible example

output of 'conda info'
     active environment : None
       user config file : /Users/James.Lamb/.condarc
 populated config files : 
          conda version : 4.12.0
    conda-build version : not installed
         python version : 3.8.5.final.0
       virtual packages : __osx=10.16=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/James.Lamb/miniconda3  (writable)
      conda av data dir : /Users/James.Lamb/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/James.Lamb/miniconda3/pkgs
                          /Users/James.Lamb/.conda/pkgs
       envs directories : /Users/James.Lamb/miniconda3/envs
                          /Users/James.Lamb/.conda/envs
               platform : osx-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.8.5 Darwin/20.5.0 OSX/10.16
                UID:GID : 504:20
             netrc file : None
           offline mode : False

First, create an environment with older versions of jupyter_server and nbformat

conda config --add channels conda-forge
conda config --set channel_priority strict
conda create --name example --yes \
    python=3.9 \
    nbformat==5.1.3 \
    jupyterlab==3.3.2 \
    jupyter_server==1.13.5

Start up Jupyter Lab, then create and save notebook.

mkdir -p ${HOME}/sandbox/jserver-example
cd ${HOME}/sandbox/jserver-example
source activate example
jupyter lab

image

Exit Jupyter Lab, then update ONLY jupyter_server in that conda environment.

conda update --name example --yes \
    jupyter_server

Next, run JupyterLab and try to create and save a notebook.

jupyter lab

On loading, you'll see an error from the existing notebook.

File Load Error for test.ipynb
Unreadable Notebook: /Users/James.Lamb/sandbox/jserver-example/test.ipynb TypeError("init() got an unexpected keyword argument 'capture_validation_error'")

image

Try to create a new notebook in Jupyter Lab, you'll see a different error.

Error
Unexpected error while saving file: Untitled.ipynb [Errno 2] No such file or directory: '/Users/James.Lamb/sandbox/jserver-example/.~Untitled.ipynb' -> '/Users/James.Lamb/sandbox/jserver-example/Untitled.ipynb'

image

Exit Jupyter Lab, then update to a newer nbformat in the environment.

conda update --name example --yes \
    nbformat

The following packages will be UPDATED:
nbformat 5.1.3-pyhd8ed1ab_0 --> 5.2.0-pyhd8ed1ab_0

Run Jupyter Lab again...now notebooks load successfully and it's possible to create and save new ones.

Notes

Today, I updated a conda environment with jupyter_server in it, and found that I got the newest jupyter_server (v1.15.6) but that my nbformat version wasn't upgraded (I had 5.1.3, and the newest is 5.2.0).

As a result, I wasn't able to create notebooks in Jupyter Lab...saw the following error when creating a new notebook

File Load Error for explore.ipynb
Unreadable Notebook: /usr/local/src/notebooks/explore.ipynb TypeError("init() got an unexpected keyword argument 'capture_validation_error'")

After some investigation, I determined that this is because jupyter_server>=1.15.0 is incompatible with nbformat<5.2.0.

Notes for Reviewers

Thanks for your time and consideration!

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • requirements: run: nbformat >= 5.2.0 should not contain a space between relational operator and the version, i.e. nbformat >=5.2.0

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@jameslamb
Copy link
Member Author

@conda-forge-admin, please rerender

@github-actions
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.

This message was generated by GitHub actions workflow run https://github.com/conda-forge/jupyter_server-feedstock/actions/runs/2019986930.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 merged commit 2ebf287 into conda-forge:main Mar 22, 2022
@jameslamb jameslamb deleted the nbformat-floor branch March 22, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants