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
DEPS: Lazy import defusedxml
only when necessary
#12362
Conversation
Import `defusedxml` inside the `etree_parse()` function rather than in global scope of `sphinx.testing.util`. This makes it possible for reverse dependencies (such as `breathe`) to use this module without adding an unnecessary transitive dependency on `defusedxml` when it's not actually used. See also issue sphinx-doc#12339.
Yeh I'd agree, but will wait to @picnixz to comment before merging TBH |
Independently on that, I still think that we need to split the dependencies but I think this one is fine enough as a simple patch for now. Also, it reduces the import time so it's an improvement on its own. @chrisjsewell I'll let you merge this one if you want to improve the commit message |
defusedxml
import into the function using itdefusedxml
import into the function using it
defusedxml
import into the function using itdefusedxml
only when necessary
cheers! |
Thanks a lot! |
Until Sphinx v7.3.8 or v7.4.0 is released with [1] included. [1] sphinx-doc/sphinx#12362 Signed-off-by: Stephen Finucane <stephen@that.guru>
Until Sphinx cuts a release with [1] included. [1] sphinx-doc/sphinx#12362
Until Sphinx v7.3.8 or v7.4.0 is released with [1] included. [1] sphinx-doc/sphinx#12362 Signed-off-by: Stephen Finucane <stephen@that.guru>
Until Sphinx cuts a release with [1] included. [1] sphinx-doc/sphinx#12362
Subject: Move
defusedxml
import into the function using itFeature or Bugfix
Purpose
Import
defusedxml
inside theetree_parse()
function rather than in global scope ofsphinx.testing.util
. This makes it possible for reverse dependencies (such asbreathe
) to use this module without adding an unnecessary transitive dependency ondefusedxml
when it's not actually used.Detail
Relates
defusedxml
be moved to the runtime dependencies? #12339.