summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieleades <33452915+danieleades@users.noreply.github.com>2022-09-29 17:26:53 +0100
committerGitHub <noreply@github.com>2022-09-29 17:26:53 +0100
commit3c73efadab5cf0e4be94eeadd91f3e9c0eb2996e (patch)
treeac00e1ddc3b29c581da30fa502e66f5eaba06c0d
parent8267dc4fdeb2777f8388f63392b47b7f651d4dc2 (diff)
downloadsphinx-git-3c73efadab5cf0e4be94eeadd91f3e9c0eb2996e.tar.gz
shrink 'Any generics' mypy whitelist for builders module (#10846)
-rw-r--r--pyproject.toml4
-rw-r--r--sphinx/builders/linkcheck.py8
2 files changed, 7 insertions, 5 deletions
diff --git a/pyproject.toml b/pyproject.toml
index c8328653b..8074d970c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -187,7 +187,9 @@ strict_optional = false
[[tool.mypy.overrides]]
module = [
"sphinx.application",
- "sphinx.builders.*",
+ "sphinx.builders._epub_base",
+ "sphinx.builders.html",
+ "sphinx.builders.linkcheck",
"sphinx.cmd.quickstart",
"sphinx.config",
"sphinx.deprecation",
diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
index 71e391378..a036aeefb 100644
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -201,7 +201,7 @@ class HyperlinkAvailabilityChecker:
self.config = config
self.env = env
self.rate_limits: Dict[str, RateLimit] = {}
- self.rqueue: Queue = Queue()
+ self.rqueue: Queue[CheckResult] = Queue()
self.workers: List[Thread] = []
self.wqueue: PriorityQueue[CheckRequest] = PriorityQueue()
@@ -246,8 +246,8 @@ class HyperlinkAvailabilityChecker:
class HyperlinkAvailabilityCheckWorker(Thread):
"""A worker class for checking the availability of hyperlinks."""
- def __init__(self, env: BuildEnvironment, config: Config, rqueue: Queue,
- wqueue: Queue, rate_limits: Dict[str, RateLimit]) -> None:
+ def __init__(self, env: BuildEnvironment, config: Config, rqueue: 'Queue[CheckResult]',
+ wqueue: 'Queue[CheckRequest]', rate_limits: Dict[str, RateLimit]) -> None:
self.config = config
self.env = env
self.rate_limits = rate_limits
@@ -428,7 +428,7 @@ class HyperlinkAvailabilityCheckWorker(Thread):
uri, docname, lineno = hyperlink
except ValueError:
# old styled check_request (will be deprecated in Sphinx-5.0)
- next_check, uri, docname, lineno = check_request
+ next_check, uri, docname, lineno = check_request # type: ignore[misc]
if uri is None:
break