mknotebooks icon indicating copy to clipboard operation
mknotebooks copied to clipboard

Deprecation warnings from `traitlets`

Open timvink opened this issue 2 years ago • 2 comments

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

timvink avatar Nov 29 '22 15:11 timvink

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

Lucas-C avatar Jan 31 '24 18:01 Lucas-C

Annoying to see them in the output.

To hide them we can do:

python -W ignore::DeprecationWarning -m mkdocs serve

darkopetrovic avatar Jul 06 '24 21:07 darkopetrovic