Merge pull request 'Fix(python-generator): prevent from internal namespace error' (#55) from fix/project-dir-invalid-namespace-error into main
Generate API reference / generate (push) Successful in 23s

Reviewed-on: #55
This commit was merged in pull request #55.
This commit is contained in:
jakob.scheid authored and Gitea committed 2026-09-28 22:36:32 +02:00
commit 6d1656745e
2 files changed
+15 -1

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
# Changelog
## [Unreleased]
### Fixed
- Internal namespace name error which occured when generating Python documentation with `.` as the project directory
## [0.2.0] - 2026-09-28
### Added
+9 -1
View File
@@ -1096,7 +1096,15 @@ 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 be included in the generated
# output.
directory.resolve().name or 'project',
[],
)
for entry in directory.iterdir():
if entry.is_dir():