mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Downgrade importlib-metadata
from the workflow, not nox.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
b2633987ef
commit
8c243a64de
2 changed files with 6 additions and 46 deletions
6
.github/workflows/test-packages-action.yml
vendored
6
.github/workflows/test-packages-action.yml
vendored
|
@ -174,6 +174,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
tools --timestamps vm decompress-dependencies ${{ inputs.distro-slug }}
|
tools --timestamps vm decompress-dependencies ${{ inputs.distro-slug }}
|
||||||
|
|
||||||
|
- name: Downgrade importlib-metadata
|
||||||
|
if: ${{ contains(fromJSON('["amazonlinux-2", "centos-7", "debian-10"]'), inputs.distro-slug) && contains(fromJSON('["upgrade-classic", "downgrade-classic"]'), matrix.test-chunk) }}
|
||||||
|
run: |
|
||||||
|
# This step can go away once we stop testing classic packages upgrade/downgrades to/from 3005.x
|
||||||
|
tools --timestamps vm ssh ${{ inputs.distro-slug }} -- "sudo python3 -m pip install -U 'importlib-metadata<=4.13.0' 'virtualenv<=20.21.1'"
|
||||||
|
|
||||||
- name: Show System Info & Test Plan
|
- name: Show System Info & Test Plan
|
||||||
run: |
|
run: |
|
||||||
tools --timestamps --timeout-secs=1800 vm testplan --skip-requirements-install \
|
tools --timestamps --timeout-secs=1800 vm testplan --skip-requirements-install \
|
||||||
|
|
46
noxfile.py
46
noxfile.py
|
@ -331,49 +331,6 @@ def _install_coverage_requirement(session):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _downgrade_importlib_metadata(session):
|
|
||||||
distro_data = session_run_always(
|
|
||||||
session,
|
|
||||||
"python",
|
|
||||||
"-c",
|
|
||||||
"import distro, json, sys; print(json.dumps(distro.linux_distribution()), file=sys.stdout, flush=True)",
|
|
||||||
stderr=None,
|
|
||||||
silent=True,
|
|
||||||
log=False,
|
|
||||||
)
|
|
||||||
distro_info = tuple(json.loads(distro_data.strip()))
|
|
||||||
session.log("Linux Distribution Details: {}".format(distro_info))
|
|
||||||
if (
|
|
||||||
("amazon" in distro_info[0].lower() and distro_info[1] == "2")
|
|
||||||
or ("debian" in distro_info[0].lower() and distro_info[1] == "10")
|
|
||||||
or ("centos" in distro_info[0].lower() and distro_info[1] == "7")
|
|
||||||
):
|
|
||||||
session.log("Downgrading importlib-metadata ...")
|
|
||||||
nox_version = session_run_always(
|
|
||||||
session,
|
|
||||||
"nox",
|
|
||||||
"--version",
|
|
||||||
silent=True,
|
|
||||||
log=False,
|
|
||||||
).strip()
|
|
||||||
# Workaround for installing and running classic packages from 3005.1
|
|
||||||
# They can only run with importlib-metadata<5.0.0.
|
|
||||||
session_run_always(
|
|
||||||
session,
|
|
||||||
"/usr/bin/python3",
|
|
||||||
"-m",
|
|
||||||
"pip",
|
|
||||||
"install",
|
|
||||||
"-U",
|
|
||||||
"importlib-metadata<=4.13.0",
|
|
||||||
"virtualenv<=20.21.1",
|
|
||||||
"nox=={}".format(nox_version),
|
|
||||||
silent=False,
|
|
||||||
log=True,
|
|
||||||
external=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _run_with_coverage(session, *test_cmd, env=None, on_rerun=False):
|
def _run_with_coverage(session, *test_cmd, env=None, on_rerun=False):
|
||||||
_install_coverage_requirement(session)
|
_install_coverage_requirement(session)
|
||||||
if on_rerun is False:
|
if on_rerun is False:
|
||||||
|
@ -1935,9 +1892,6 @@ def ci_test_onedir_pkgs(session):
|
||||||
if chunk in ("upgrade-classic", "downgrade-classic"):
|
if chunk in ("upgrade-classic", "downgrade-classic"):
|
||||||
cmd_args.append("--classic")
|
cmd_args.append("--classic")
|
||||||
|
|
||||||
if IS_LINUX:
|
|
||||||
_downgrade_importlib_metadata(session)
|
|
||||||
|
|
||||||
pytest_args = (
|
pytest_args = (
|
||||||
cmd_args[:]
|
cmd_args[:]
|
||||||
+ [
|
+ [
|
||||||
|
|
Loading…
Add table
Reference in a new issue