Skip to content

Commit

Permalink
🔧 disallow implicit_reexport in mypy (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Sep 16, 2024
1 parent e6eea31 commit d48e8e4
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sphinx_needs/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
3 changes: 1 addition & 2 deletions sphinx_needs/api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
3 changes: 1 addition & 2 deletions sphinx_needs/api/need.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sphinx_needs/directives/need.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sphinx_needs/directives/needflow/_graphviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
5 changes: 3 additions & 2 deletions sphinx_needs/needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions sphinx_needs/services/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion sphinx_needs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d48e8e4

Please sign in to comment.