Merge 3006.x into master

This commit is contained in:
Pedro Algarvio 2023-09-21 08:38:10 +01:00
commit 4a63636225
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
3 changed files with 76 additions and 46 deletions

View file

@ -19,14 +19,12 @@ on:
type: string
description: Seed used to invalidate caches
relenv-version:
required: false
required: true
type: string
default: 0.13.2
description: The version of relenv to use
python-version:
required: false
required: true
type: string
default: 3.10.12
description: The version of python to use with relenv
env:

View file

@ -19,14 +19,12 @@ on:
type: string
description: Seed used to invalidate caches
relenv-version:
required: false
required: true
type: string
default: 0.13.2
description: The version of relenv to use
python-version:
required: false
required: true
type: string
default: 3.10.12
description: The version of python to use with relenv
env:

View file

@ -10,6 +10,7 @@ import os
import pathlib
import shutil
import tarfile
import tempfile
import zipfile
from typing import TYPE_CHECKING
@ -94,8 +95,18 @@ def debian(
os.environ[key] = value
env_args.extend(["-e", key])
ctx.run("ln", "-sf", "pkg/debian/", ".")
ctx.run("debuild", *env_args, "-uc", "-us")
constraints = ["setuptools-scm<8"]
with tempfile.NamedTemporaryFile(
"w", prefix="reqs-constraints-", suffix=".txt", delete=False
) as tfile:
with open(tfile.name, "w", encoding="utf-8") as wfh:
for req in constraints:
wfh.write(f"{req}\n")
env = os.environ.copy()
env["PIP_CONSTRAINT"] = str(tfile.name)
ctx.run("ln", "-sf", "pkg/debian/", ".")
ctx.run("debuild", *env_args, "-uc", "-us", env=env)
ctx.info("Done")
@ -160,8 +171,20 @@ def rpm(
for key, value in new_env.items():
os.environ[key] = value
spec_file = checkout / "pkg" / "rpm" / "salt.spec"
ctx.run("rpmbuild", "-bb", f"--define=_salt_src {checkout}", str(spec_file))
constraints = ["setuptools-scm<8"]
with tempfile.NamedTemporaryFile(
"w", prefix="reqs-constraints-", suffix=".txt", delete=False
) as tfile:
with open(tfile.name, "w", encoding="utf-8") as wfh:
for req in constraints:
wfh.write(f"{req}\n")
env = os.environ.copy()
env["PIP_CONSTRAINT"] = str(tfile.name)
spec_file = checkout / "pkg" / "rpm" / "salt.spec"
ctx.run(
"rpmbuild", "-bb", f"--define=_salt_src {checkout}", str(spec_file), env=env
)
ctx.info("Done")
@ -549,40 +572,51 @@ def onedir_dependencies(
)
_check_pkg_build_files_exist(ctx, requirements_file=requirements_file)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
"-U",
"wheel",
)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
"-U",
"pip>=22.3.1,<23.0",
)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
"-U",
"setuptools>=65.6.3,<66",
)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
*install_args,
"-r",
str(requirements_file),
env=env,
)
constraints = ["setuptools-scm<8"]
with tempfile.NamedTemporaryFile(
"w", prefix="reqs-constraints-", suffix=".txt", delete=False
) as tfile:
with open(tfile.name, "w", encoding="utf-8") as wfh:
for req in constraints:
wfh.write(f"{req}\n")
env["PIP_CONSTRAINT"] = str(tfile.name)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
"-U",
"wheel",
env=env,
)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
"-U",
"pip>=22.3.1,<23.0",
env=env,
)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
"-U",
"setuptools>=65.6.3,<66",
env=env,
)
ctx.run(
str(python_bin),
"-m",
"pip",
"install",
*install_args,
"-r",
str(requirements_file),
env=env,
)
@build.command(