greenape / mknotebooks

A plugin for mkdocs to help you include Jupyter notebooks in your projects
MIT License
136 stars 20 forks source link

Deprecation warnings from `traitlets` #1065

Open timvink opened 1 year ago

timvink commented 1 year ago

I'm getting two deprecation warnings:

INFO     -  DeprecationWarning: 5.x style template file passed
            '/anaconda/envs/azureml_py38/lib/python3.8/site-packages/mknotebooks/templates/custom_markdown.tpl'.
            Use --template-name for the template directory with a index.<ext>.j2 file and/or
            --template-file to denote a different template.
              File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/traitlets/traitlets.py",
            line 1431, in _notify_observers
                c(event)
              File
            "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py",
            line 233, in _template_file_changed
                warnings.warn(

and

INFO     -  DeprecationWarning: Passing unrecognized arguments to
            super(HTMLExporter).__init__(template_path=['/anaconda/envs/azureml_py38/lib/python3.8/site-packages/mknotebooks/templates',
            '/home/azureuser/.local/share/jupyter/nbconvert/templates/base',
            '/anaconda/envs/azureml_py38/share/jupyter/nbconvert/templates/base',
            '/usr/local/share/jupyter/nbconvert/templates/base',
            '/usr/share/jupyter/nbconvert/templates/base']).
            object.__init__() takes exactly one argument (the instance to initialize)
            This is deprecated in traitlets 4.2.This error will be raised in a future release of
            traitlets.
              File
            "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/traitlets/config/configurable.py",
            line 85, in __init__
                super().__init__(**kwargs)
              File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/traitlets/traitlets.py",
            line 1246, in __init__
                warn(

Both seem related to traitlets.

mknotebooks                        0.7.1
traitlets                                 5.3.0
mkdocs-material                           8.5.10
mkdocs-material-extensions                1.1.1
mkdocs                                    1.4.2

Tested using Python 3.8.5 and 3.9.12, both on Ubuntu 20.04

Lucas-C commented 7 months ago

I also see the same two warnings displayed in mkdocs logs for my website: https://pyfpdf.github.io/fpdf2/

This seems raise by this piece of code: https://github.com/jupyter/nbconvert/blob/v7.14.2/nbconvert/exporters/templateexporter.py#L239

darkopetrovic commented 1 month ago

Annoying to see them in the output.

To hide them we can do:

python -W ignore::DeprecationWarning -m mkdocs serve