mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Try to constrain to setuptools-scm<8
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
398c245662
commit
bc58ea2d5c
1 changed files with 72 additions and 38 deletions
|
@ -10,6 +10,7 @@ import os
|
|||
import pathlib
|
||||
import shutil
|
||||
import tarfile
|
||||
import tempfile
|
||||
import zipfile
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
|
@ -97,8 +98,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")
|
||||
|
||||
|
@ -163,8 +174,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")
|
||||
|
||||
|
@ -552,40 +575,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(
|
||||
|
|
Loading…
Add table
Reference in a new issue