Fix(python-generator): prevent from namespace name conflicts #58

Merged
jakob.scheid merged 3 commits from fix/python-namespace-name-conflict into main 2026-09-29 18:18:15 +02:00
3 changed files with 7 additions and 1 deletions

No files matched your search

+1
View File
@@ -4,6 +4,7 @@
### Fixed ### Fixed
- Python namespace name conflict when package and module have the same name
- Internal namespace name error which occured when generating Python documentation with `.` as the project directory - Internal namespace name error which occured when generating Python documentation with `.` as the project directory
## [0.2.0] - 2026-09-28 ## [0.2.0] - 2026-09-28
+3 -1
View File
@@ -1107,7 +1107,9 @@ class PythonDocumentationGenerator:
) )
for entry in directory.iterdir(): for entry in directory.iterdir():
if entry.is_dir(): if entry.is_dir() and (
entry.parent / (f'{entry.stem}.py')
).resolve() not in [e.resolve() for e in entry.parent.iterdir()]:
namespace.add(self._namespace(entry)) namespace.add(self._namespace(entry))
elif entry.suffix == '.py': elif entry.suffix == '.py':
namespace.add(PythonModuleNamespace(entry.stem)) namespace.add(PythonModuleNamespace(entry.stem))