fix(package): resolve source paths relative to package root

This commit is contained in:
PierreCsn committed 2026-10-28 16:43:39 +01:00
1 parent f859ff536c
commit 1afb3a2b73
6 files changed
+31 -10

No files matched your search

+2 -2
View File
@@ -7,8 +7,8 @@ import sys
def _source_directory():
"""Find the package source from this file, independent of the current cwd."""
source = Path(__file__).resolve().parent
"""Find package root and return its path relative to the current directory."""
source = Path(os.path.relpath(Path(__file__).resolve().parent, Path.cwd()))
if not (source / 'WAPT' / 'control').is_file():
raise RuntimeError('update_package.py must be inside a WAPT package source directory.')
return source