From d1c9839ec70eb78c1e40d8de5aa5b1a00c13a394 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Mon, 28 Sep 2026 22:24:09 +0200 Subject: [PATCH] fix(python-generator): resolve directory path The path to the directory is now completely resolved in PythonDocumentationGenerator._namespace to prevent from empty path names if the path is '.'. A fallback was also added for the case that the path is '/'; the fallback value is irrelevant as the root namespace name does not occur in the output and only the root package path can be '/'. --- src/jcloud_docsgen/core/python/_core.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jcloud_docsgen/core/python/_core.py b/src/jcloud_docsgen/core/python/_core.py index f9881db..80b7ae6 100644 --- a/src/jcloud_docsgen/core/python/_core.py +++ b/src/jcloud_docsgen/core/python/_core.py @@ -1096,7 +1096,14 @@ class PythonDocumentationGenerator: self.kwargs = kwargs def _namespace(self, directory: pathlib.Path) -> PythonPackageNamespace: - namespace = PythonPackageNamespace(directory.name, []) + namespace = PythonPackageNamespace( + # fallback for the case that the path it '/'. In this case, the + # name would be ''. The fallback value is irrelevant; the name is + # only specified because PythonPackageNamespace requires + # specifying it. The name will not occur in the generated output. + directory.resolve().name or 'project', + [], + ) for entry in directory.iterdir(): if entry.is_dir():