The extras-<python-major>.<python-minor> is a Salt thing.

Create it at the right stage.

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-05-03 07:27:26 +01:00 committed by Pedro Algarvio
parent 5c1ac329c4
commit 310991a6d6

View file

@ -467,8 +467,6 @@ def onedir_dependencies(
str(requirements_file),
env=env,
)
extras_dir = dest / f"extras-{requirements_version}"
extras_dir.mkdir()
@build.command(
@ -580,6 +578,17 @@ def salt_onedir(
ctx.error("Cloud not find a site-packages path with 'site-packages' in it?!")
ctx.exit(1)
ret = ctx.run(
str(python_executable),
"-c",
"import sys; print('{}.{}'.format(*sys.version_info))",
capture=True,
)
python_version_info = ret.stdout.strip().decode()
extras_dir = onedir_env / f"extras-{python_version_info}"
ctx.info(f"Creating Salt's extras path: {extras_dir}")
extras_dir.mkdir(exist_ok=True)
pth_path = pathlib.Path(site_packages) / "salt-extras.pth"
ctx.info(f"Writing '{pth_path}' ...")
pth_path.write_text(