vericast / nbconflux

nbconflux converts Jupyter Notebooks to Atlassian Confluence pages
BSD 3-Clause "New" or "Revised" License
117 stars 33 forks source link

The package is broken because of nbconvert 6.0.0a0 #37

Open sancau opened 4 years ago

sancau commented 4 years ago

The package is broken due to nbconvert>=5.3 in the setup.py

Nbconflux doesn't work with nbconvert 6.0.0a0

makammoun commented 3 years ago

This is my attempt to fix the problem https://github.com/criteo-forks/nbconflux/pull/2

danizen commented 3 years ago

@makammoun, I tried your patch by installing directly from your fork, but it didn't work for me. It certainly improved the result, because it was a runtime error with templates rather than a class hierarchy issue. This is what I got:

(dataviz) NLM01991848OCCS:serials-alma davisda4$ nbconflux test_scripts/API-Comparison.ipynb https://wiki.nlm.nih.gov/confluence/pages/editpage.action?pageId=220366732
Confluence username (davisda4): 
Confluence password: 
Traceback (most recent call last):
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/traitlets/traitlets.py", line 535, in get
    value = obj._trait_values[self.name]
KeyError: 'template_paths'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/davisda4/envs/dataviz/bin/nbconflux", line 8, in <module>
    sys.exit(main())
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconflux/cli.py", line 55, in main
    notebook_to_page(args.notebook, args.url, username, password,
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconflux/api.py", line 60, in notebook_to_page
    exporter = ConfluenceExporter(c)
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconflux/exporter.py", line 99, in __init__
    super(ConfluenceExporter, self).__init__(config=config, **kwargs)
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 325, in __init__
    super().__init__(config=config, **kw)
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 114, in __init__
    self._init_preprocessors()
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 491, in _init_preprocessors
    conf = self._get_conf()
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 507, in _get_conf
    for path in map(Path, self.template_paths):
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/nbconflux/exporter.py", line 91, in template_paths
    return super().template_paths + [os.path.join(os.path.abspath(os.path.dirname(__file__)), 'templates')]
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/traitlets/traitlets.py", line 575, in __get__
    return self.get(obj, cls)
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/traitlets/traitlets.py", line 538, in get
    default = obj.trait_defaults(self.name)
  File "/Users/davisda4/envs/dataviz/lib/python3.8/site-packages/traitlets/traitlets.py", line 1574, in trait_defaults
    raise TraitError("'%s' is not a trait of '%s' "
traitlets.traitlets.TraitError: 'template_paths' is not a trait of 'ConfluenceExporter' instances