Skip to content

Commit

Permalink
🐛 Fix plantuml top-level import
Browse files Browse the repository at this point in the history
`sphinxcontrib.plantuml` is optional, should not not be a top-level import
  • Loading branch information
chrisjsewell committed Oct 10, 2024
1 parent 2c5fbff commit d2454a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions sphinx_needs/directives/needflow/_plantuml.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from docutils import nodes
from jinja2 import Template
from sphinx.application import Sphinx
from sphinxcontrib.plantuml import (
generate_name, # Need for plantuml filename calculation
)

from sphinx_needs.config import LinkOptionsType, NeedsSphinxConfig
from sphinx_needs.data import NeedsFlowType, NeedsInfoType, SphinxNeedsData
Expand Down Expand Up @@ -244,7 +241,7 @@ def process_needflow_plantuml(
try:
if "sphinxcontrib.plantuml" not in app.config.extensions:
raise ImportError
from sphinxcontrib.plantuml import plantuml
from sphinxcontrib.plantuml import generate_name, plantuml
except ImportError:
error_node = nodes.error()
para = nodes.paragraph()
Expand Down
5 changes: 1 addition & 4 deletions sphinx_needs/directives/needgantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.application import Sphinx
from sphinxcontrib.plantuml import (
generate_name, # Need for plantuml filename calculation
)

from sphinx_needs.config import NeedsSphinxConfig
from sphinx_needs.data import NeedsGanttType, SphinxNeedsData
Expand Down Expand Up @@ -176,7 +173,7 @@ def process_needgantt(
try:
if "sphinxcontrib.plantuml" not in app.config.extensions:
raise ImportError
from sphinxcontrib.plantuml import plantuml
from sphinxcontrib.plantuml import generate_name, plantuml
except ImportError:
no_plantuml(node)
continue
Expand Down
5 changes: 1 addition & 4 deletions sphinx_needs/directives/needsequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.application import Sphinx
from sphinxcontrib.plantuml import (
generate_name, # Need for plantuml filename calculation
)

from sphinx_needs.config import NeedsSphinxConfig
from sphinx_needs.data import NeedsInfoType, NeedsSequenceType, SphinxNeedsData
Expand Down Expand Up @@ -124,7 +121,7 @@ def process_needsequence(
try:
if "sphinxcontrib.plantuml" not in app.config.extensions:
raise ImportError
from sphinxcontrib.plantuml import plantuml
from sphinxcontrib.plantuml import generate_name, plantuml
except ImportError:
no_plantuml(node)
continue
Expand Down

0 comments on commit d2454a2

Please sign in to comment.