Skip to content

Commit 965c653

Browse files
authored
Merge pull request #1174 from codypiersall/master
Remove lxml >=3.8.0 dependency.
2 parents 4a89982 + 5810b81 commit 965c653

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def main():
7272
'pyyaml',
7373
'tornado',
7474
'traitlets >=4.1',
75-
'lxml >=3.8.0'
75+
'lxml'
7676
],
7777
extras_require={
7878
'test': [

src/jupyter_contrib_nbextensions/nbconvert_support/embedhtml.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import base64
44
import os
55

6-
import lxml.etree as et
76
from ipython_genutils.ipstruct import Struct
87
from nbconvert.exporters.html import HTMLExporter
98

@@ -66,6 +65,14 @@ def replfunc(self, node):
6665
node.attrib["src"] = prefix + b64_data
6766

6867
def from_notebook_node(self, nb, resources=None, **kw):
68+
# The parent nbconvert_support module imports this module, and
69+
# nbconvert_support is imported as part of our install scripts, and
70+
# other fairly basic stuff.
71+
# By keeping lxml import in this method, we can still import this
72+
# module even if lxml isn't available, or is missing dependencies, etc.
73+
# In this way, problems with lxml should only bother people who are
74+
# actually trying to *use* this.
75+
import lxml.etree as et
6976
output, resources = super(
7077
EmbedHTMLExporter, self).from_notebook_node(nb, resources)
7178

0 commit comments

Comments
 (0)