Skip to content

Commit 2ec0d5c

Browse files
andresailerweb-flow
authored andcommitted
sweep: #6458 fail when command documentation does not build, fix for importlib_metadata v5
1 parent 81b6228 commit 2ec0d5c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

docs/diracdoctools/cmd/commandReference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def createScriptDoc(self, script: str):
181181
if not helpMessage:
182182
LOG.warning("NO DOC for %s", scriptName)
183183
helpMessage = "Oops, we couldn't generate a description for this command."
184+
self.exitcode = 1
184185

185186
# Script reference
186187
fileContent = textwrap.dedent(

docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
LOG.info("Building command reference")
4949
from diracdoctools.cmd.commandReference import run as buildCommandReference
5050

51-
buildCommandReference(configFile="../docs.conf")
51+
if buildCommandReference(configFile="../docs.conf") != 0:
52+
raise RuntimeError("Something went wrong with the documentation creation")
5253

5354
# singlehtml build needs too much memory, so we need to create less code documentation
5455
buildType = "limited" if any("singlehtml" in arg for arg in sys.argv) else "full"

src/DIRAC/Core/Base/Script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __call__(self, func=None):
5151
return functools.wraps(func)(self)
5252

5353
# Iterate through all known entry_points looking for self.scriptName
54-
matches = [ep for ep in metadata.entry_points()["console_scripts"] if ep.name == self.scriptName]
54+
matches = [ep for ep in metadata.entry_points(group="console_scripts") if ep.name == self.scriptName]
5555
if not matches:
5656
raise NotImplementedError("Something is very wrong")
5757

0 commit comments

Comments
 (0)