diff --git a/pyproject.toml b/pyproject.toml index 53a44bd42..957fa2d50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,7 +133,7 @@ extend-ignore = ["B904", "ISC001", "ICN001", "N818", "RUF005", "RUF013", "RUF012 files = "sphinx_needs" strict = true show_error_codes = true -implicit_reexport = true +implicit_reexport = false namespace_packages = true disallow_any_generics = true disallow_subclassing_any = true diff --git a/sphinx_needs/api/__init__.py b/sphinx_needs/api/__init__.py index 4b482e0ee..6021aedec 100644 --- a/sphinx_needs/api/__init__.py +++ b/sphinx_needs/api/__init__.py @@ -9,10 +9,10 @@ __all__ = ( "add_dynamic_function", "add_extra_option", - "add_need_type", - "get_need_types", "add_external_need", "add_need", + "add_need_type", "del_need", + "get_need_types", "make_hashed_id", ) diff --git a/sphinx_needs/api/configuration.py b/sphinx_needs/api/configuration.py index ba3c287f3..2677ce0d7 100644 --- a/sphinx_needs/api/configuration.py +++ b/sphinx_needs/api/configuration.py @@ -14,8 +14,7 @@ from sphinx_needs.api.exceptions import NeedsApiConfigException from sphinx_needs.config import NEEDS_CONFIG, NeedsSphinxConfig from sphinx_needs.data import NeedsInfoType -from sphinx_needs.functions import register_func -from sphinx_needs.functions.functions import DynamicFunction +from sphinx_needs.functions.functions import DynamicFunction, register_func def get_need_types(app: Sphinx) -> list[str]: diff --git a/sphinx_needs/api/need.py b/sphinx_needs/api/need.py index 9b9d2ea28..b734c4cf5 100644 --- a/sphinx_needs/api/need.py +++ b/sphinx_needs/api/need.py @@ -14,7 +14,6 @@ from sphinx.application import Sphinx from sphinx.environment import BuildEnvironment -from sphinx_needs.api.configuration import NEEDS_CONFIG from sphinx_needs.api.exceptions import ( NeedsConstraintNotAllowed, NeedsInvalidException, @@ -24,7 +23,7 @@ NeedsTagNotAllowed, NeedsTemplateException, ) -from sphinx_needs.config import GlobalOptionsType, NeedsSphinxConfig +from sphinx_needs.config import NEEDS_CONFIG, GlobalOptionsType, NeedsSphinxConfig from sphinx_needs.data import NeedsInfoType, SphinxNeedsData from sphinx_needs.directives.needuml import Needuml, NeedumlException from sphinx_needs.filter_common import filter_single_need diff --git a/sphinx_needs/directives/need.py b/sphinx_needs/directives/need.py index a92be651e..6ad096a57 100644 --- a/sphinx_needs/directives/need.py +++ b/sphinx_needs/directives/need.py @@ -19,12 +19,12 @@ from sphinx_needs.debug import measure_time from sphinx_needs.defaults import NEED_DEFAULT_OPTIONS from sphinx_needs.directives.needextend import Needextend, extend_needs_data -from sphinx_needs.functions import ( +from sphinx_needs.functions.functions import ( + check_and_get_content, find_and_replace_node_content, resolve_dynamic_values, resolve_variants_options, ) -from sphinx_needs.functions.functions import check_and_get_content from sphinx_needs.layout import build_need_repr from sphinx_needs.logging import get_logger, log_warning from sphinx_needs.need_constraints import process_constraints diff --git a/sphinx_needs/directives/needflow/_graphviz.py b/sphinx_needs/directives/needflow/_graphviz.py index 1d0ad9d82..080c43171 100644 --- a/sphinx_needs/directives/needflow/_graphviz.py +++ b/sphinx_needs/directives/needflow/_graphviz.py @@ -35,7 +35,7 @@ try: from sphinx.writers.html5 import HTML5Translator except ImportError: - from sphinx.writers.html import HTML5Translator + from sphinx.writers.html import HTML5Translator # type: ignore[attr-defined] LOGGER = getLogger(__name__) diff --git a/sphinx_needs/needs.py b/sphinx_needs/needs.py index 930c8732b..399c44498 100644 --- a/sphinx_needs/needs.py +++ b/sphinx_needs/needs.py @@ -30,7 +30,6 @@ ) from sphinx_needs.directives.list2need import List2Need, List2NeedDirective from sphinx_needs.directives.need import ( - Need, NeedDirective, analyse_need_locations, html_depart, @@ -96,8 +95,10 @@ install_styles_static_files, ) from sphinx_needs.external_needs import load_external_needs -from sphinx_needs.functions import NEEDS_COMMON_FUNCTIONS, register_func +from sphinx_needs.functions import NEEDS_COMMON_FUNCTIONS +from sphinx_needs.functions.functions import register_func from sphinx_needs.logging import get_logger, log_warning +from sphinx_needs.nodes import Need from sphinx_needs.roles import NeedsXRefRole from sphinx_needs.roles.need_count import NeedCount, process_need_count from sphinx_needs.roles.need_func import NeedFunc, NeedFuncRole, process_need_func diff --git a/sphinx_needs/services/manager.py b/sphinx_needs/services/manager.py index d993824f3..1a87649c7 100644 --- a/sphinx_needs/services/manager.py +++ b/sphinx_needs/services/manager.py @@ -4,8 +4,7 @@ from sphinx.application import Sphinx -from sphinx_needs.api.configuration import NEEDS_CONFIG -from sphinx_needs.config import NeedsSphinxConfig +from sphinx_needs.config import NEEDS_CONFIG, NeedsSphinxConfig from sphinx_needs.directives.needservice import NeedserviceDirective from sphinx_needs.logging import get_logger from sphinx_needs.services.base import BaseService diff --git a/sphinx_needs/utils.py b/sphinx_needs/utils.py index adb1dd564..911328f36 100644 --- a/sphinx_needs/utils.py +++ b/sphinx_needs/utils.py @@ -12,7 +12,8 @@ from docutils import nodes from jinja2 import Environment, Template -from sphinx.application import BuildEnvironment, Sphinx +from sphinx.application import Sphinx +from sphinx.environment import BuildEnvironment from sphinx_needs.api.exceptions import NeedsInvalidFilter from sphinx_needs.config import LinkOptionsType, NeedsSphinxConfig