mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Non onedir builds might be able to user the newer pip and setuptools requirements
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
b0381cc053
commit
4dd5d53f1f
2 changed files with 25 additions and 11 deletions
15
noxfile.py
15
noxfile.py
|
@ -280,7 +280,7 @@ def _get_pip_requirements_file(session, transport, crypto=None, requirements_typ
|
|||
session.error("Could not find a linux requirements file for {}".format(pydir))
|
||||
|
||||
|
||||
def _upgrade_pip_setuptools_and_wheel(session, upgrade=True):
|
||||
def _upgrade_pip_setuptools_and_wheel(session, upgrade=True, onedir=False):
|
||||
if SKIP_REQUIREMENTS_INSTALL:
|
||||
session.log(
|
||||
"Skipping Python Requirements because SKIP_REQUIREMENTS_INSTALL was found in the environ"
|
||||
|
@ -296,14 +296,19 @@ def _upgrade_pip_setuptools_and_wheel(session, upgrade=True):
|
|||
]
|
||||
if upgrade:
|
||||
install_command.append("-U")
|
||||
install_command.extend(
|
||||
[
|
||||
if onedir:
|
||||
requirements = [
|
||||
"pip>=22.3.1,<23.0",
|
||||
# https://github.com/pypa/setuptools/commit/137ab9d684075f772c322f455b0dd1f992ddcd8f
|
||||
"setuptools>=65.6.3,<66",
|
||||
"wheel",
|
||||
]
|
||||
)
|
||||
else:
|
||||
requirements = [
|
||||
"pip>=20.2.4,<21.2",
|
||||
"setuptools!=50.*,!=51.*,!=52.*,<59",
|
||||
]
|
||||
install_command.extend(requirements)
|
||||
session_run_always(session, *install_command, silent=PIP_INSTALL_SILENT)
|
||||
return True
|
||||
|
||||
|
@ -318,7 +323,7 @@ def _install_requirements(
|
|||
if onedir and IS_LINUX:
|
||||
session_run_always(session, "python3", "-m", "relenv", "toolchain", "fetch")
|
||||
|
||||
if not _upgrade_pip_setuptools_and_wheel(session):
|
||||
if not _upgrade_pip_setuptools_and_wheel(session, onedir=onedir):
|
||||
return False
|
||||
|
||||
# Install requirements
|
||||
|
|
|
@ -1601,17 +1601,26 @@ class VirtualEnv:
|
|||
venv_dir = attr.ib(converter=_cast_to_pathlib_path)
|
||||
env = attr.ib(default=None)
|
||||
system_site_packages = attr.ib(default=False)
|
||||
pip_requirement = attr.ib(default="pip>=22.3.1,<23.0", repr=False)
|
||||
setuptools_requirement = attr.ib(
|
||||
# https://github.com/pypa/setuptools/commit/137ab9d684075f772c322f455b0dd1f992ddcd8f
|
||||
default="setuptools>=65.6.3,<66",
|
||||
repr=False,
|
||||
)
|
||||
pip_requirement = attr.ib(repr=False)
|
||||
setuptools_requirement = attr.ib(repr=False)
|
||||
# TBD build_requirement = attr.ib(default="build!=0.6.*", repr=False) # add build when implement pyproject.toml
|
||||
environ = attr.ib(init=False, repr=False)
|
||||
venv_python = attr.ib(init=False, repr=False)
|
||||
venv_bin_dir = attr.ib(init=False, repr=False)
|
||||
|
||||
@pip_requirement.default
|
||||
def _default_pip_requiremnt(self):
|
||||
if os.environ.get("ONEDIR_TESTRUN", "0") == "1":
|
||||
return "pip>=22.3.1,<23.0"
|
||||
return "pip>=20.2.4,<21.2"
|
||||
|
||||
@setuptools_requirement.default
|
||||
def _default_setuptools_requirement(self):
|
||||
if os.environ.get("ONEDIR_TESTRUN", "0") == "1":
|
||||
# https://github.com/pypa/setuptools/commit/137ab9d684075f772c322f455b0dd1f992ddcd8f
|
||||
return "setuptools>=65.6.3,<66"
|
||||
return "setuptools!=50.*,!=51.*,!=52.*,<59"
|
||||
|
||||
@venv_dir.default
|
||||
def _default_venv_dir(self):
|
||||
return pathlib.Path(tempfile.mkdtemp(dir=RUNTIME_VARS.TMP))
|
||||
|
|
Loading…
Add table
Reference in a new issue