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

The CI is broken because some of the sample notebooks are not normalized #1002

Closed
mwouts opened this issue Oct 29, 2022 · 2 comments · Fixed by #1003
Closed

The CI is broken because some of the sample notebooks are not normalized #1002

mwouts opened this issue Oct 29, 2022 · 2 comments · Fixed by #1003

Comments

@mwouts
Copy link
Owner

mwouts commented Oct 29, 2022

The CI fails because some of the sample notebooks have additional properties, with errors like e.g.

>           raise error
E           nbformat.validator.NotebookValidationError: Additional properties are not allowed ('execution_count', 'outputs' were unexpected)
E           
E           Failed validating 'additionalProperties' in raw_cell:
E           
E           On instance['cells'][0]:
E           {'cell_type': 'raw',
E            'execution_count': None,
E            'metadata': {},
E            'outputs': ['...0 outputs...'],
E            'source': '---\n'
E                      'title: "Quick test"\n'
E                      'output:\n'
E                      '  ioslides_presentation:\n'
E                      '    wid...'}

/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbformat/validator.py:505: NotebookValidationError

For more similar errors, see the CI logs

@mwouts
Copy link
Owner Author

mwouts commented Oct 29, 2022

Obviously this is due to the way the collection of sample notebooks was built... many notebooks from many distinct languages, collected over a long period of time. I will follow the suggestion to call normalize.

@mwouts
Copy link
Owner Author

mwouts commented Oct 29, 2022

I cannot reproduce locally with nbformat==5.7.0 from conda... but once I remove it and install nbformat==5.7.0 (i.e. same version) from pip then I do get the same error as on the CI 😄

mwouts added a commit that referenced this issue Oct 31, 2022
* Version 1.14.2-dev

* Normalize the sample notebooks (#1002)

* Fix issues that `normalize` did not fix

* Remove outputs and metadata when they exist

* Use Path rather than path

* Test that text notebooks are normalized

* Regenerate mirror text notebooks
Following the normalization of ipynb notebooks

* Skip test if recent nbformat is not available

* Add Python 3.11 + Use Py3.9 for conda

* Update CHANGELOG.md

* Jupytext is tested against Python 3.10 and 3.11 on the CI

* Don't include test failure in coverage
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 a pull request may close this issue.

1 participant