sphinx-needs icon indicating copy to clipboard operation
sphinx-needs copied to clipboard

sphinxcontrib.plantuml is no dependency

Open ubmarco opened this issue 3 years ago • 1 comments

When setting up a new venv and installing sphinx-needs 1.0.2 with

pip install sphinx-needs

and then importing the library I get an exception:

$ python
Python 3.10.7 (main, Sep  6 2022, 21:22:27) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sphinx_needs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/marco/.venv/lib/python3.10/site-packages/sphinx_needs/__init__.py", line 2, in <module>
    from sphinx_needs.needs import setup  # noqa: F401
  File "/home/marco/.venv/lib/python3.10/site-packages/sphinx_needs/needs.py", line 11, in <module>
    from sphinx_needs.api.configuration import add_extra_option
  File "/home/marco/.venv/lib/python3.10/site-packages/sphinx_needs/api/__init__.py", line 7, in <module>
    from .need import add_external_need, add_need, del_need, make_hashed_id  # noqa: F401
  File "/home/marco/.venv/lib/python3.10/site-packages/sphinx_needs/api/need.py", line 25, in <module>
    from sphinx_needs.directives.needuml import Needuml, NeedumlException
  File "/home/marco/.venv/lib/python3.10/site-packages/sphinx_needs/directives/needuml.py", line 10, in <module>
    from sphinx_needs.directives.needflow import make_entity_name
  File "/home/marco/.venv/lib/python3.10/site-packages/sphinx_needs/directives/needflow.py", line 10, in <module>
    from sphinxcontrib.plantuml import (
ModuleNotFoundError: No module named 'sphinxcontrib.plantuml'

This happens because sphinxcontrib.plantuml is not listed in [tool.poetry.dependencies]. The documentation says it is an optional dependency, however it is already a mandatory import in need.py.

ubmarco avatar Nov 02 '22 22:11 ubmarco

The workaround for this for the time being:

pip install sphinxcontrib-plantuml

mjsir911 avatar Dec 19 '22 21:12 mjsir911