From 42df819029b79bbdc7cb60faf68bcb5ab0088b1c Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Thu, 31 Mar 2022 13:32:27 +0200 Subject: [PATCH 1/2] application: Fix argparse type error ... due to https://bugs.python.org/issue16516 --- orangecanvas/application/application.py | 6 +++++- orangecanvas/application/tests/test_application.py | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/orangecanvas/application/application.py b/orangecanvas/application/application.py index e03b0d7cd..25254ee10 100644 --- a/orangecanvas/application/application.py +++ b/orangecanvas/application/application.py @@ -183,9 +183,13 @@ def argumentParser(): os.environ.get("QT_SCALE_FACTOR_ROUNDING_POLICY"), Qt.HighDpiScaleFactorRoundingPolicy.PassThrough ) + + def converter(value): + # dict.get wrapper due to https://bugs.python.org/issue16516 + return HighDpiScaleFactorRoundingPolicyLookup.get(value) parser.add_argument( "-scale-factor-rounding-policy", - type=HighDpiScaleFactorRoundingPolicyLookup.get, + type=converter, choices=[*HighDpiScaleFactorRoundingPolicyLookup.values(), None], default=default, ) diff --git a/orangecanvas/application/tests/test_application.py b/orangecanvas/application/tests/test_application.py index 922429470..479324a3e 100644 --- a/orangecanvas/application/tests/test_application.py +++ b/orangecanvas/application/tests/test_application.py @@ -23,6 +23,12 @@ def test_application(self): ]) self.assertEqual(res.returncode, 0) + def test_application_help(self): + res = sh.python_run([ + "-m", "orangecanvas", "--help" + ]) + self.assertEqual(res.returncode, 0) + def remove_after_exit(fname): appmod.run_after_exit([ From d90b29f38232507e7a73562dfe04be29623fc9f2 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Thu, 31 Mar 2022 14:04:26 +0200 Subject: [PATCH 2/2] CI: Add Python {3.6,3.7} x Qt 5.15 to test matrix --- .github/workflows/run-tests-workflow.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/run-tests-workflow.yml b/.github/workflows/run-tests-workflow.yml index ab0c818e1..9ef38457a 100644 --- a/.github/workflows/run-tests-workflow.yml +++ b/.github/workflows/run-tests-workflow.yml @@ -25,6 +25,14 @@ jobs: python-version: 3.7 test-env: "PyQt5~=5.12.0" + - os: ubuntu-20.04 + python-version: 3.6 + test-env: "PyQt5~=5.15.0" + + - os: ubuntu-20.04 + python-version: 3.7 + test-env: "PyQt5~=5.15.0" + - os: ubuntu-20.04 python-version: 3.8 test-env: "PyQt5~=5.14.0"