mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Add a .pth
to the onedir env to ensure packages in extras are importable
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
42d3eaa6e6
commit
3584921fc6
2 changed files with 9 additions and 0 deletions
1
changelog/64192.fixed.md
Normal file
1
changelog/64192.fixed.md
Normal file
|
@ -0,0 +1 @@
|
|||
Add a `.pth` to the onedir env to ensure packages in extras are importable.
|
|
@ -538,6 +538,14 @@ def salt_onedir(
|
|||
shutil.rmtree(onedir_env / "etc", onerror=errfn)
|
||||
shutil.rmtree(onedir_env / "Library", onerror=errfn)
|
||||
|
||||
# TODO: Fix hardcoded 3.10
|
||||
dest_path = onedir_env / "lib" / "python3.10" / "site-packages" / "extras.pth"
|
||||
ctx.info(f"Writing '{dest_path}' ...")
|
||||
dest_path.write_text(
|
||||
'import sys, pathlib; extras = str(pathlib.Path(__file__).parent.parent.parent / "extras-{}.{}".format(*sys.version_info)); '
|
||||
"extras not in sys.path and sys.path.insert(0, extras)\n"
|
||||
)
|
||||
|
||||
|
||||
def _check_pkg_build_files_exist(ctx: Context, **kwargs):
|
||||
for name, path in kwargs.items():
|
||||
|
|
Loading…
Add table
Reference in a new issue