From 7d169fdd535ba2b3e8a90a5ee7d68b2910ce3ced Mon Sep 17 00:00:00 2001 From: Klaus Wakonig Date: Sat, 28 Jan 2023 17:29:56 +0100 Subject: [PATCH 1/8] ci: improved ci pipeline; added 3.9 and 3.10 tests --- .gitlab-ci.yml | 33 +++++++++++++++++++++++++-------- setup.py | 2 +- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d635ab..1a43d49 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,13 @@ stages: - Test + - AdditionalTests + +.install-grum-test: &install-grum-test + - pip install pytest pytest-random-order pytest-cov + - pip install -e ./ + + - apt-get update + - apt-get install -y ffmpeg libnss3 libxcomposite1 libxtst6 tests: stage: Test @@ -8,15 +16,8 @@ tests: XDG_RUNTIME_DIR: "/tmp/runtime-root" script: - - pip install pytest pytest-random-order pytest-cov - - pip install -e ./ - - pip install PyQtWebEngine + - *install-grum-test - - apt-get update - - apt-get install -y ffmpeg libnss3 libxcomposite1 libxtst6 - -# - python -m unittest discover -f ./tests -# - coverage run --source=./grum -m unittest discover -f ./tests - coverage run --source=./grum -m pytest ./tests - coverage report - coverage xml @@ -26,4 +27,20 @@ tests: reports: cobertura: coverage.xml +tests-3.9: + stage: AdditionalTests + image: python:3.9 + needs: ["tests"] + allow_failure: true + variables: + QT_QPA_PLATFORM: "offscreen" + XDG_RUNTIME_DIR: "/tmp/runtime-root" + script: + - *install-grum-test + - pytest ./tests +tests-3.10: + extends: "tests-3.9" + stage: AdditionalTests + image: python:3.10 + allow_failure: true diff --git a/setup.py b/setup.py index a7a96ac..8369a89 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup if __name__ == "__main__": setup( - install_requires=["pyqt5", "pyqtgraph", "h5py"], + install_requires=["pyqt5", "pyqtgraph", "h5py", "PyQtWebEngine"], entry_points={"console_scripts": ["grum=grum:main"]}, ) From efd023ae3a80071123a39b9b360fbef09402140e Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 14 Mar 2023 09:35:44 +0100 Subject: [PATCH 2/8] a bit of formatting and naming --- .gitlab-ci.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a43d49..db973c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,46 +1,42 @@ stages: - - Test - - AdditionalTests + - Tests + - OptionalTests .install-grum-test: &install-grum-test - - pip install pytest pytest-random-order pytest-cov - - pip install -e ./ - - - apt-get update - - apt-get install -y ffmpeg libnss3 libxcomposite1 libxtst6 + - pip install pytest pytest-random-order pytest-cov + - pip install -e ./ + - apt-get update + - apt-get install -y ffmpeg libnss3 libxcomposite1 libxtst6 tests: - stage: Test + stage: Tests + image: python:3.8 variables: QT_QPA_PLATFORM: "offscreen" XDG_RUNTIME_DIR: "/tmp/runtime-root" - script: - *install-grum-test - - coverage run --source=./grum -m pytest ./tests - coverage report - coverage xml - coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' artifacts: reports: cobertura: coverage.xml tests-3.9: - stage: AdditionalTests + stage: OptionalTests image: python:3.9 needs: ["tests"] allow_failure: true variables: QT_QPA_PLATFORM: "offscreen" - XDG_RUNTIME_DIR: "/tmp/runtime-root" + XDG_RUNTIME_DIR: "/tmp/runtime-root" script: - *install-grum-test - pytest ./tests tests-3.10: extends: "tests-3.9" - stage: AdditionalTests image: python:3.10 - allow_failure: true + From a624cf37a4dbdaa617bf0fa2525e5f04b48563b7 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 14 Mar 2023 09:40:32 +0100 Subject: [PATCH 3/8] added some more versions --- .gitlab-ci.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db973c3..7101404 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,9 +24,9 @@ tests: reports: cobertura: coverage.xml -tests-3.9: +tests-3.6: stage: OptionalTests - image: python:3.9 + image: python:3.6 needs: ["tests"] allow_failure: true variables: @@ -36,7 +36,23 @@ tests-3.9: - *install-grum-test - pytest ./tests +tests-3.7: + extends: "tests-3.6" + image: python:3.7 + +tests-3.8: + extends: "tests-3.6" + image: python:3.8 + +tests-3.9: + extends: "tests-3.6" + image: python:3.9 + tests-3.10: - extends: "tests-3.9" + extends: "tests-3.6" image: python:3.10 +tests-3.11: + extends: "tests-3.6" + image: python:3.11 + From c6f034f2d378917d22ad1cb78a16c60c8418f0fe Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 14 Mar 2023 10:42:34 +0100 Subject: [PATCH 4/8] require PyQtWebEngine only for Python version were it exists --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8369a89..98e25b4 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,16 @@ +import sys from setuptools import setup if __name__ == "__main__": + install_requires = [ + "pyqt5", "pyqtgraph", "h5py" + ] + + if sys.version_info >= (3,8): + install_requires.append("PyQtWebEngine") + setup( - install_requires=["pyqt5", "pyqtgraph", "h5py", "PyQtWebEngine"], + install_requires=install_requires, entry_points={"console_scripts": ["grum=grum:main"]}, ) From bbb6d6c00c4c10b8e676b4c112c9a82a1eba534e Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 14 Mar 2023 10:47:06 +0100 Subject: [PATCH 5/8] lower the required version --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index e909240..6640f3b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ long_description = file: README.md long_description_content_type = text/markdown url = https://gitlab.psi.ch/augustin_s/grum project_urls = - Bug Tracker = https://gitlab.psi.ch/augustin_s/grum/issues + Bug Tracker = https://gitlab.psi.ch/augustin_s/grum/issues classifiers = Programming Language :: Python :: 3 License :: OSI Approved :: MIT License @@ -16,7 +16,7 @@ classifiers = package_dir = = . packages = find: -python_requires = >=3.8 +python_requires = >=3.6 [options.packages.find] where = . From aa79f1b0a1ce2bad966dd0ce9051fd0e752482f1 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 14 Mar 2023 10:58:31 +0100 Subject: [PATCH 6/8] removed the version check again --- setup.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 98e25b4..8369a89 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,8 @@ -import sys from setuptools import setup if __name__ == "__main__": - install_requires = [ - "pyqt5", "pyqtgraph", "h5py" - ] - - if sys.version_info >= (3,8): - install_requires.append("PyQtWebEngine") - setup( - install_requires=install_requires, + install_requires=["pyqt5", "pyqtgraph", "h5py", "PyQtWebEngine"], entry_points={"console_scripts": ["grum=grum:main"]}, ) From bed086f95f43df3d75af9f971f71f406146ec631 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 14 Mar 2023 11:06:10 +0100 Subject: [PATCH 7/8] do not test the default 3.8 twice --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7101404..5c8d905 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,9 +40,9 @@ tests-3.7: extends: "tests-3.6" image: python:3.7 -tests-3.8: - extends: "tests-3.6" - image: python:3.8 +#tests-3.8: +# extends: "tests-3.6" +# image: python:3.8 tests-3.9: extends: "tests-3.6" From 5d97dd6224475b7931be68143af66c9b2949f172 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 14 Mar 2023 11:52:03 +0100 Subject: [PATCH 8/8] added test report artifact --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c8d905..930ded7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,13 +16,15 @@ tests: XDG_RUNTIME_DIR: "/tmp/runtime-root" script: - *install-grum-test - - coverage run --source=./grum -m pytest ./tests + - coverage run --source=./grum -m pytest ./tests --junitxml=report-junit.xml - coverage report - coverage xml coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' artifacts: + when: always reports: cobertura: coverage.xml + junit: report-junit.xml tests-3.6: stage: OptionalTests