From aa8594588a21004c722c8ea9ec71297dd37c03f3 Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Wed, 28 Feb 2024 02:35:33 +0000 Subject: [PATCH 1/3] use photon:4.0 for 3.3.x tests --- ci/Dockerfile.photon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Dockerfile.photon b/ci/Dockerfile.photon index d8252cf4..9742fa9b 100644 --- a/ci/Dockerfile.photon +++ b/ci/Dockerfile.photon @@ -1,4 +1,4 @@ -FROM photon:latest +FROM photon:4.0 RUN tdnf update -y RUN tdnf remove -y toybox From 69892d5f105e62887bf181b0085ef349aba3c880 Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Wed, 28 Feb 2024 02:36:01 +0000 Subject: [PATCH 2/3] fix python path for python 3.10 --- pytests/tests/test_tdnf_python.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) mode change 100644 => 100755 pytests/tests/test_tdnf_python.py diff --git a/pytests/tests/test_tdnf_python.py b/pytests/tests/test_tdnf_python.py old mode 100644 new mode 100755 index 6c68e742..8fdb63a2 --- a/pytests/tests/test_tdnf_python.py +++ b/pytests/tests/test_tdnf_python.py @@ -21,16 +21,28 @@ def setup_test(utils): sglpkgname = utils.config['sglversion_pkgname'] global config - config = utils.config['repo_path'] + '/tdnf.conf' + config = os.path.join(utils.config['repo_path'], "tdnf.conf") - path = '{builddir}/python/build/lib.linux-{arch}-{pymajor}.{pyminor}' + if not utils.config.get('installed', False): + # find path to our tdnf python module + builddir = utils.config['build_dir'] + arch = os.uname().machine + pymajor = sys.version_info.major + pyminor = sys.version_info.minor - path = path.format(builddir=utils.config['build_dir'], - arch=os.uname().machine, - pymajor=str(sys.version_info.major), - pyminor=str(sys.version_info.minor)) + # only support python3 + assert pymajor == 3 - sys.path.append(path) + if pyminor < 10: + path = f"{builddir}/python/build/lib.linux-{arch}-{pymajor}.{pyminor}" + else: + # build/lib.linux-aarch64-cpython-310/tdnf + path = f"{builddir}/python/build/lib.linux-{arch}-cpython-{pymajor}{pyminor}" + + print(f"tdnf python path: {path}") + + assert os.path.isdir(path) + sys.path.append(path) global tdnf import tdnf From 240c76d91831cb2b2bfc05a0ed430ea203bc7b5b Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Wed, 28 Feb 2024 02:39:55 +0000 Subject: [PATCH 3/3] use 'is' to compare types to make flake8 happy --- pytests/tests/test_json.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytests/tests/test_json.py b/pytests/tests/test_json.py index 993f4883..db3fe0e1 100644 --- a/pytests/tests/test_json.py +++ b/pytests/tests/test_json.py @@ -101,7 +101,7 @@ def test_erase(utils): def test_check_update(utils): ret = utils.run(['tdnf', '-j', 'check-update']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == list + assert type(d) is list def test_repolist(utils): @@ -120,19 +120,19 @@ def test_repolist(utils): def test_repoquery(utils): ret = utils.run(['tdnf', '-j', 'repoquery']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == list + assert type(d) is list def test_updateinfo(utils): ret = utils.run(['tdnf', '-j', 'updateinfo']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == dict + assert type(d) is dict def test_updateinfo_info(utils): ret = utils.run(['tdnf', '-j', 'updateinfo', '--info']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == list + assert type(d) is list def test_jsondump(utils):