From 855d432978d5f415c2bf367f6482cd0b23cc7ed2 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 29 Sep 2024 02:19:59 +0200 Subject: [PATCH 01/19] Renamed arm64 to aarch64. --- .github/workflows/Parameters.yml | 4 ++-- doc/requirements.txt | 4 ++-- tests/python_jobs.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index dd2f549c..c7d313fd 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -75,7 +75,7 @@ on: default: 'macos-latest-large' type: string macos_arm_image: - description: 'The used GitHub Action image for macOS (ARM arm64) based jobs.' + description: 'The used GitHub Action image for macOS (ARM aarch64) based jobs.' required: false default: 'macos-latest' type: string @@ -181,7 +181,7 @@ jobs: "ubuntu": { "icon": "🐧", "runs-on": "${{ inputs.ubuntu_image }}", "shell": "bash", "name": "Linux (x86-64)" }, "windows": { "icon": "🪟", "runs-on": "${{ inputs.windows_image }}", "shell": "pwsh", "name": "Windows (x86-64)" }, "macos": { "icon": "🍎", "runs-on": "${{ inputs.macos_intel_image }}", "shell": "bash", "name": "macOS (x86-64)" }, - "macos-arm": { "icon": "🍏", "runs-on": "${{ inputs.macos_arm_image }}", "shell": "bash", "name": "macOS (arm64)" }, + "macos-arm": { "icon": "🍏", "runs-on": "${{ inputs.macos_arm_image }}", "shell": "bash", "name": "macOS (aarch64)" }, }, # Runtimes provided by MSYS2 "runtime": { diff --git a/doc/requirements.txt b/doc/requirements.txt index ff21b759..3bc82d1b 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -14,7 +14,7 @@ sphinxcontrib-mermaid>=0.9.2 #sphinxcontrib-textstyle>=0.2.1 #sphinxcontrib-spelling>=2.2.0 autoapi >= 2.0.1 -sphinx_fontawesome >= 0.0.6 -sphinx-inline-tabs >= 2023.4.21 +sphinx_design >= 0.5.0 +sphinx-copybutton >= 0.5.2 sphinx_autodoc_typehints ~= 2.3 # changelog>=0.3.5 diff --git a/tests/python_jobs.py b/tests/python_jobs.py index 58ec322d..c9d90b7f 100644 --- a/tests/python_jobs.py +++ b/tests/python_jobs.py @@ -71,7 +71,7 @@ "ubuntu": {"icon": "🐧", "runs-on": "ubuntu-24.04", "shell": "bash", "name": "Linux (x86-64)"}, "windows": {"icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)"}, "macos": {"icon": "🍎", "runs-on": "macos-latest-large", "shell": "bash", "name": "macOS (x86-64)"}, - "macos-arm": {"icon": "🍏", "runs-on": "macos-latest", "shell": "bash", "name": "macOS (arm64)"}, + "macos-arm": {"icon": "🍏", "runs-on": "macos-latest", "shell": "bash", "name": "macOS (aarch64)"}, }, # Runtimes provided by MSYS2 "runtime": { From e88aa7b973c543634fc5d254dd618f6a10817e08 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 29 Sep 2024 02:37:19 +0200 Subject: [PATCH 02/19] Set image for macOS x86-64 to macOS-13. --- .github/workflows/Parameters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index c7d313fd..c302e0b2 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -72,7 +72,7 @@ on: macos_intel_image: description: 'The used GitHub Action image for macOS (Intel x86-64) based jobs.' required: false - default: 'macos-latest-large' + default: 'macos-13' type: string macos_arm_image: description: 'The used GitHub Action image for macOS (ARM aarch64) based jobs.' From b2ac6bc0d9cfdd6e63a27c0b06fad2444c354dac Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 29 Sep 2024 03:03:44 +0200 Subject: [PATCH 03/19] Run also macos-arm. --- .github/workflows/IntermediateCleanUp.yml | 2 +- .github/workflows/Parameters.yml | 2 +- doc/JobTemplate/Parameters.rst | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/IntermediateCleanUp.yml b/.github/workflows/IntermediateCleanUp.yml index d087ea6e..d1a6607a 100644 --- a/.github/workflows/IntermediateCleanUp.yml +++ b/.github/workflows/IntermediateCleanUp.yml @@ -45,7 +45,7 @@ jobs: with: name: ${{ inputs.sqlite_coverage_artifacts_prefix }}* - - name: 🗑️ Delete XML coverage artifacts from matrix jobs + - name: 🗑️ Delete JUnit XML artifacts from matrix jobs uses: geekyeggo/delete-artifact@v5 if: inputs.xml_unittest_artifacts_prefix != '' continue-on-error: true diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index c302e0b2..4a123bbd 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -42,7 +42,7 @@ on: system_list: description: 'Space separated list of systems to run tests on.' required: false - default: 'ubuntu windows macos-arm mingw64 ucrt64' + default: 'ubuntu windows macos macos-arm mingw64 ucrt64' type: string include_list: description: 'Space separated list of system:python items to be included into the list of test.' diff --git a/doc/JobTemplate/Parameters.rst b/doc/JobTemplate/Parameters.rst index f7ace30d..10c3bb7d 100644 --- a/doc/JobTemplate/Parameters.rst +++ b/doc/JobTemplate/Parameters.rst @@ -44,7 +44,7 @@ Complex Example The following instantiation example creates 3 jobs from the same template, but with differing input parameters. The first job `UnitTestingParams` might be used to create a job matrix of unit tests. It creates the cross of default -systems (Windows, Ubuntu, MacOS, MinGW64, UCRT64) and the given list of Python versions including some mypy versions. In +systems (Windows, Ubuntu, macOS, MinGW64, UCRT64) and the given list of Python versions including some mypy versions. In addition a list of excludes (marked as :deletion:`deletions`) and includes (marked as :addition:`additions`) is handed over resulting in the following combinations: @@ -55,7 +55,7 @@ over resulting in the following combinations: +------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+ | Ubuntu 🐧 | ubuntu:3.8 | ubuntu:3.9 | ubuntu:3.10 | ubuntu:3.11 | :addition:`ubuntu:3.12` | | | ubuntu:pypy-3.9 | ubuntu:pypy-3.10 | +------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+ -| MacOS 🍎 | macos:3.8 | macos:3.9 | macos:3.10 | macos:3.11 | :addition:`macos:3.12` | | | macos:pypy-3.9 | macos:pypy-3.10 | +| macOS 🍎 | macos:3.8 | macos:3.9 | macos:3.10 | macos:3.11 | :addition:`macos:3.12` | | | macos:pypy-3.9 | macos:pypy-3.10 | +------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+ | MSYS 🟪 | | | | | | | | | | +------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+ @@ -197,7 +197,7 @@ Space separated list of systems to run tests on. +------+-----------+------------------------------+-----------------------------------------------------------------+ | 🐧 | Ubuntu | Ubuntu 22.04 (LTS) (latest) | | +------+-----------+------------------------------+-----------------------------------------------------------------+ -| 🍎 | MacOS | macOS Monterey 12 (latest) | While this marked latest, macOS Ventura 13 is already provided. | +| 🍎 | macOS | macOS Monterey 12 (latest) | While this marked latest, macOS Ventura 13 is already provided. | +------+-----------+------------------------------+-----------------------------------------------------------------+ | 🟪 | MSYS | | | +------+-----------+------------------------------+-----------------------------------------------------------------+ From 13076012dd8500d001b649633ca3d0449ebfbe0a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 10 Oct 2024 07:34:24 +0200 Subject: [PATCH 04/19] Handle docstr_coverage and pyyaml. --- .github/workflows/Parameters.yml | 2 +- .github/workflows/UnitTesting.yml | 9 +++++---- doc/requirements.txt | 10 +++++----- pyproject.toml | 3 ++- requirements.txt | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 4a123bbd..c6297db2 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -37,7 +37,7 @@ on: python_version_list: description: 'Space separated list of Python versions to run tests with.' required: false - default: '3.8 3.9 3.10 3.11 3.12' + default: '3.9 3.10 3.11 3.12' type: string system_list: description: 'Space separated list of systems to run tests on.' diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 52fcc46c..81332592 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -207,7 +207,7 @@ jobs: packages = { "coverage": "python-coverage:p", - "docstr_coverage": "python-pyyaml:p", + "docstr_coverage": "python-pyaml:p", "igraph": "igraph:p", "jinja2": "python-markupsafe:p", "lxml": "python-lxml:p", @@ -215,12 +215,13 @@ jobs: "markupsafe": "python-markupsafe:p", "pip": "python-pip:p", "pyyaml": "python-pyyaml:p", - "ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", + "ruamel.yaml": "python-ruamel-yaml:p", + # "ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", "sphinx": "python-markupsafe:p", "tomli": "python-tomli:p", "wheel": "python-wheel:p", - "pyEDAA.ProjectModel": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p", - "pyEDAA.Reports": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p", + "pyedaa.projectmodel": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p", + "pyedaa.reports": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p", } subPackages = { "pytooling": { diff --git a/doc/requirements.txt b/doc/requirements.txt index 3bc82d1b..d58f647e 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,10 +1,10 @@ -r ../requirements.txt -pyTooling ~= 6.6 +pyTooling ~= 6.7 # Enforce latest version on ReadTheDocs -sphinx ~= 7.4 -docutils ~= 0.20 +sphinx ~= 8.0 +docutils ~= 0.21 # Sphinx Extenstions #sphinx.ext.coverage @@ -14,7 +14,7 @@ sphinxcontrib-mermaid>=0.9.2 #sphinxcontrib-textstyle>=0.2.1 #sphinxcontrib-spelling>=2.2.0 autoapi >= 2.0.1 -sphinx_design >= 0.5.0 +sphinx_design ~= 0.6.1 sphinx-copybutton >= 0.5.2 -sphinx_autodoc_typehints ~= 2.3 +sphinx_autodoc_typehints ~= 2.5 # changelog>=0.3.5 diff --git a/pyproject.toml b/pyproject.toml index b32a0f7d..fe0ec4fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools ~= 75.1", "wheel ~= 0.44", - "pyTooling ~= 6.6" + "pyTooling ~= 6.7" ] build-backend = "setuptools.build_meta" @@ -21,6 +21,7 @@ namespace_packages = true html_report = "report/typing" [tool.pytest.ini_options] +addopts = "--tb=native" # Don't set 'python_classes = *' otherwise, pytest doesn't search for classes # derived from unittest.Testcase python_files = "*" diff --git a/requirements.txt b/requirements.txt index 96da06bf..c802ce33 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyTooling ~= 6.6 +pyTooling ~= 6.7 From a15499a807307a48c15f3e45054cd673b672c442 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 13 Oct 2024 19:36:54 +0200 Subject: [PATCH 05/19] After merging pyTest-JUnit XML files, write again the pyTest-jUnit format. --- .github/workflows/PublishTestResults.yml | 2 +- doc/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index dcfbd9ef..4ff32f89 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -69,7 +69,7 @@ jobs: - name: 🔁 Merge JUnit Unit Test Summaries run: | - pyedaa-reports -v unittest "--merge=pytest-junit:junit/*.xml" ${{ inputs.additional_merge_args }} "--output=ant-junit:Unittesting.xml" + pyedaa-reports -v unittest "--merge=pyTest-JUnit:junit/*.xml" ${{ inputs.additional_merge_args }} "--output=pyTest-JUnit:Unittesting.xml" echo "cat Unittesting.xml" cat Unittesting.xml diff --git a/doc/requirements.txt b/doc/requirements.txt index d58f647e..e0760842 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -3,7 +3,7 @@ pyTooling ~= 6.7 # Enforce latest version on ReadTheDocs -sphinx ~= 8.0 +sphinx ~= 8.1 docutils ~= 0.21 # Sphinx Extenstions From 00269cf507009da441e40404eaccf403929a7b4e Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 22 Oct 2024 07:11:19 +0200 Subject: [PATCH 06/19] Added Support for Python 3.13 and 3.14 (alpha) and removed 3.8. --- .github/workflows/Parameters.yml | 24 ++-- .../workflows/_Checking_ArtifactCleanup.yml | 6 +- .github/workflows/_Checking_Parameters.yml | 122 ++++++++++-------- .github/workflows/_Checking_Pipeline.yml | 34 ++--- 4 files changed, 101 insertions(+), 85 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index c6297db2..7983420f 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -32,12 +32,12 @@ on: python_version: description: 'Python version.' required: false - default: '3.12' + default: '3.13' type: string python_version_list: description: 'Space separated list of Python versions to run tests with.' required: false - default: '3.9 3.10 3.11 3.12' + default: '3.9 3.10 3.11 3.12 3.13' type: string system_list: description: 'Space separated list of systems to run tests on.' @@ -123,8 +123,8 @@ jobs: disable_list = "${{ inputs.disable_list }}".strip() currentMSYS2Version = "3.11" - currentAlphaVersion = "3.13" - currentAlphaRelease = "3.13.0-alpha.1" + currentAlphaVersion = "3.14" + currentAlphaRelease = "3.14.0-alpha.1" if systems == "": print("::error title=Parameter::system_list is empty.") @@ -151,8 +151,8 @@ jobs: else: disabled = [disable.strip() for disable in disable_list.split(" ")] - if "3.7" in versions: - print("::warning title=Deprecated::Support for Python 3.7 ended in 2023.06.27.") + if "3.8" in versions: + print("::warning title=Deprecated::Support for Python 3.8 ended in 2024.10.") if "msys2" in systems: print("::warning title=Deprecated::System 'msys2' will be replaced by 'mingw64'.") if currentAlphaVersion in versions: @@ -164,13 +164,13 @@ jobs: data = { # Python and PyPy versions supported by "setup-python" action "python": { - "3.7": { "icon": "⚫", "until": "2023.06.27" }, - "3.8": { "icon": "🔴", "until": "2024.10" }, - "3.9": { "icon": "🟠", "until": "2025.10" }, - "3.10": { "icon": "🟡", "until": "2026.10" }, - "3.11": { "icon": "🟢", "until": "2027.10" }, + "3.8": { "icon": "⚫", "until": "2024.10" }, + "3.9": { "icon": "🔴", "until": "2025.10" }, + "3.10": { "icon": "🟠", "until": "2026.10" }, + "3.11": { "icon": "🟡", "until": "2027.10" }, "3.12": { "icon": "🟢", "until": "2028.10" }, - # "3.13": { "icon": "🟣", "until": "2028.10" }, + "3.13": { "icon": "🟢", "until": "2029.10" }, + "3.14": { "icon": "🟣", "until": "2030.10" }, "pypy-3.7": { "icon": "⟲⚫", "until": "????.??" }, "pypy-3.8": { "icon": "⟲🔴", "until": "????.??" }, "pypy-3.9": { "icon": "⟲🟠", "until": "????.??" }, diff --git a/.github/workflows/_Checking_ArtifactCleanup.yml b/.github/workflows/_Checking_ArtifactCleanup.yml index 3d001356..6cde55cf 100644 --- a/.github/workflows/_Checking_ArtifactCleanup.yml +++ b/.github/workflows/_Checking_ArtifactCleanup.yml @@ -6,10 +6,10 @@ on: jobs: Params: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example - python_version_list: "3.10 3.11" + python_version_list: "3.12 3.13" system_list: "ubuntu windows" Testing: @@ -50,7 +50,7 @@ jobs: retention-days: 1 ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r1 + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev needs: - Params - Testing diff --git a/.github/workflows/_Checking_Parameters.yml b/.github/workflows/_Checking_Parameters.yml index 5f3e6ce6..48569254 100644 --- a/.github/workflows/_Checking_Parameters.yml +++ b/.github/workflows/_Checking_Parameters.yml @@ -6,54 +6,54 @@ on: jobs: Params_Default: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example Params_PythonVersions: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example - python_version_list: "3.9 3.10 pypy-3.8 pypy-3.9" + python_version_list: "3.11 3.12 pypy-3.9 pypy-3.10" Params_Systems: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example system_list: "windows mingw32 mingw64" Params_Include: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example - python_version_list: "3.10" - system_list: "ubuntu windows macos" - include_list: "ubuntu:3.11 ubuntu:3.12" + python_version_list: "3.11" + system_list: "ubuntu windows macos macos-arm" + include_list: "ubuntu:3.12 ubuntu:3.13" Params_Exclude: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example - python_version_list: "3.10" - system_list: "ubuntu windows macos" - exclude_list: "windows:3.10 windows:3.11" + python_version_list: "3.12" + system_list: "ubuntu windows macos macos-arm" + exclude_list: "windows:3.12 windows:3.13" Params_Disable: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example - python_version_list: "3.10" - system_list: "ubuntu windows macos" - disable_list: "windows:3.10 windows:3.11" + python_version_list: "3.12" + system_list: "ubuntu windows macos macos-arm" + disable_list: "windows:3.12 windows:3.13" Params_All: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Example - python_version_list: "3.10 3.11" - system_list: "ubuntu windows macos" - include_list: "windows:3.8 windows:3.9 windows:3.12" - exclude_list: "macos:3.10 macos:3.11" + python_version_list: "3.12 3.13" + system_list: "ubuntu windows macos macos-arm" + include_list: "windows:3.10 windows:3.11 windows:3.13" + exclude_list: "macos:3.12 macos:3.13" Params_Check: needs: @@ -80,12 +80,10 @@ jobs: from pyTooling.Common import zipdicts - expectedPythonVersion = "3.12" - expectedPythons = ["3.8", "3.9", "3.10", "3.11", "3.12"] - expectedSystems = ["ubuntu", "windows", "macos"] + expectedPythonVersion = "3.13" + expectedPythons = ["3.9", "3.10", "3.11", "3.12", "3.13"] + expectedSystems = ["ubuntu", "windows", "macos", "macos-arm"] expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw64:3.11", "ucrt64:3.11"] - expectedJobs.remove("macos:3.8") - expectedJobs.remove("macos:3.9") expectedName = "Example" expectedArtifacts = { "unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML", @@ -116,7 +114,10 @@ jobs: print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.") print("Actual jobs:") for job in actualPythonJobs: - print(f" {job['system']}:{job['python']}") + if job['system'] == "msys2": + print(f" {job['runtime'].lower()}:{job['python']}") + else: + print(f" {job['system']}:{job['python']}") print("Expected jobs:") for job in expectedJobs: print(f" {job}") @@ -142,13 +143,10 @@ jobs: from pyTooling.Common import zipdicts - expectedPythonVersion = "3.12" - expectedPythons = ["3.9", "3.10", "pypy-3.8", "pypy-3.9"] - expectedSystems = ["ubuntu", "windows", "macos"] + expectedPythonVersion = "3.13" + expectedPythons = ["3.11", "3.12", "pypy-3.9", "pypy-3.10"] + expectedSystems = ["ubuntu", "windows", "macos", "macos-arm"] expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw64:3.11", "ucrt64:3.11"] - expectedJobs.remove("macos:3.9") - expectedJobs.remove("macos:pypy-3.8") - expectedJobs.remove("macos:pypy-3.9") expectedName = "Example" expectedArtifacts = { "unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML", @@ -179,7 +177,10 @@ jobs: print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.") print("Actual jobs:") for job in actualPythonJobs: - print(f" {job['system']}:{job['python']}") + if job['system'] == "msys2": + print(f" {job['runtime'].lower()}:{job['python']}") + else: + print(f" {job['system']}:{job['python']}") print("Expected jobs:") for job in expectedJobs: print(f" {job}") @@ -205,8 +206,8 @@ jobs: from pyTooling.Common import zipdicts - expectedPythonVersion = "3.12" - expectedPythons = ["3.8", "3.9", "3.10", "3.11", "3.12"] + expectedPythonVersion = "3.13" + expectedPythons = ["3.9", "3.10", "3.11", "3.12", "3.13"] expectedSystems = ["windows"] expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw32:3.11", "mingw64:3.11"] expectedName = "Example" @@ -239,7 +240,10 @@ jobs: print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.") print("Actual jobs:") for job in actualPythonJobs: - print(f" {job['system']}:{job['python']}") + if job['system'] == "msys2": + print(f" {job['runtime'].lower()}:{job['python']}") + else: + print(f" {job['system']}:{job['python']}") print("Expected jobs:") for job in expectedJobs: print(f" {job}") @@ -265,9 +269,9 @@ jobs: from pyTooling.Common import zipdicts - expectedPythonVersion = "3.12" - expectedPythons = ["3.10"] - expectedSystems = ["ubuntu", "windows", "macos"] + expectedPythonVersion = "3.13" + expectedPythons = ["3.12"] + expectedSystems = ["ubuntu", "windows", "macos", "macos-arm"] expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["ubuntu:3.11", "ubuntu:3.12"] expectedName = "Example" expectedArtifacts = { @@ -299,7 +303,10 @@ jobs: print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.") print("Actual jobs:") for job in actualPythonJobs: - print(f" {job['system']}:{job['python']}") + if job['system'] == "msys2": + print(f" {job['runtime'].lower()}:{job['python']}") + else: + print(f" {job['system']}:{job['python']}") print("Expected jobs:") for job in expectedJobs: print(f" {job}") @@ -325,9 +332,9 @@ jobs: from pyTooling.Common import zipdicts - expectedPythonVersion = "3.12" - expectedPythons = ["3.10"] - expectedSystems = ["ubuntu", "macos"] + expectedPythonVersion = "3.13" + expectedPythons = ["3.12"] + expectedSystems = ["ubuntu", "macos", "macos-arm"] expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] expectedName = "Example" expectedArtifacts = { @@ -359,7 +366,10 @@ jobs: print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.") print("Actual jobs:") for job in actualPythonJobs: - print(f" {job['system']}:{job['python']}") + if job['system'] == "msys2": + print(f" {job['runtime'].lower()}:{job['python']}") + else: + print(f" {job['system']}:{job['python']}") print("Expected jobs:") for job in expectedJobs: print(f" {job}") @@ -385,9 +395,9 @@ jobs: from pyTooling.Common import zipdicts - expectedPythonVersion = "3.12" - expectedPythons = ["3.10"] - expectedSystems = ["ubuntu", "macos"] + expectedPythonVersion = "3.13" + expectedPythons = ["3.12"] + expectedSystems = ["ubuntu", "macos", "macos-arm"] expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] expectedName = "Example" expectedArtifacts = { @@ -419,7 +429,10 @@ jobs: print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.") print("Actual jobs:") for job in actualPythonJobs: - print(f" {job['system']}:{job['python']}") + if job['system'] == "msys2": + print(f" {job['runtime'].lower()}:{job['python']}") + else: + print(f" {job['system']}:{job['python']}") print("Expected jobs:") for job in expectedJobs: print(f" {job}") @@ -445,10 +458,10 @@ jobs: from pyTooling.Common import zipdicts - expectedPythonVersion = "3.12" - expectedPythons = ["3.10", "3.11"] + expectedPythonVersion = "3.13" + expectedPythons = ["3.12", "3.13"] expectedSystems = ["ubuntu", "windows"] - expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["windows:3.8", "windows:3.9", "windows:3.12"] + expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["windows:3.10", "windows:3.11", "windows:3.13"] expectedName = "Example" expectedArtifacts = { "unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML", @@ -479,7 +492,10 @@ jobs: print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.") print("Actual jobs:") for job in actualPythonJobs: - print(f" {job['system']}:{job['python']}") + if job['system'] == "msys2": + print(f" {job['runtime'].lower()}:{job['python']}") + else: + print(f" {job['system']}:{job['python']}") print("Expected jobs:") for job in expectedJobs: print(f" {job}") diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index a1b27e47..fab11980 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -6,21 +6,21 @@ on: jobs: UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: pyDummy - python_version_list: "3.8 3.9 3.10 3.11 3.12 pypy-3.8 pypy-3.9 pypy-3.10" - disable_list: "windows:pypy-3.10" + python_version_list: "3.8 3.9 3.10 3.11 3.12 3.13 pypy-3.8 pypy-3.9 pypy-3.10" +# disable_list: "windows:pypy-3.10" PlatformTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 with: name: Platform python_version_list: "" system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64" UnitTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r1 + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@py313 needs: - UnitTestingParams with: @@ -33,7 +33,7 @@ jobs: # coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} PlatformTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r1 + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@py313 needs: - PlatformTestingParams with: @@ -48,7 +48,7 @@ jobs: coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }} # Coverage: -# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@r1 +# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@py313 # needs: # - UnitTestingParams # with: @@ -58,7 +58,7 @@ jobs: # codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r1 + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@py313 needs: - UnitTestingParams with: @@ -69,7 +69,7 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@r1 + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@py313 needs: - UnitTestingParams - UnitTesting @@ -84,7 +84,7 @@ jobs: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@py313 needs: - UnitTesting - PlatformTesting @@ -92,7 +92,7 @@ jobs: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@r1 + uses: pyTooling/Actions/.github/workflows/Package.yml@py313 needs: - UnitTestingParams - UnitTesting @@ -103,14 +103,14 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@r1 +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@py313 # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} BuildTheDocs: - uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@r1 + uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@py313 needs: - UnitTestingParams # - VerifyDocs @@ -118,7 +118,7 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r1 + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@py313 needs: - UnitTestingParams - BuildTheDocs @@ -131,7 +131,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@r1 + uses: pyTooling/Actions/.github/workflows/Release.yml@py313 if: startsWith(github.ref, 'refs/tags') needs: - UnitTesting @@ -142,7 +142,7 @@ jobs: - PublishToGitHubPages PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r1 + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@py313 if: startsWith(github.ref, 'refs/tags') needs: - UnitTestingParams @@ -156,7 +156,7 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r1 + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@py313 needs: - UnitTestingParams - PlatformTestingParams From c9d0e8e9c67fbe5278f2450975afcd42f8343727 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 22 Oct 2024 23:56:35 +0200 Subject: [PATCH 07/19] Replacing BuildTheDocs. --- .btd.yml | 9 --------- .github/workflows/_Checking_Pipeline.yml | 25 +++++++++++++++++++++++- doc/conf.py | 1 - 3 files changed, 24 insertions(+), 11 deletions(-) delete mode 100644 .btd.yml diff --git a/.btd.yml b/.btd.yml deleted file mode 100644 index 296c029b..00000000 --- a/.btd.yml +++ /dev/null @@ -1,9 +0,0 @@ -input: doc -output: _build -requirements: requirements.txt -target: gh-pages -formats: [ html ] -images: - base: btdi/sphinx:pytooling - latex: btdi/latex -theme: https://codeload.GitHub.com/buildthedocs/sphinx.theme/tar.gz/v1 diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index fab11980..969536f2 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -117,11 +117,34 @@ jobs: with: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + HTMLDocumentation: + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@py313 + needs: + - UnitTestingParams +# - VerifyDocs + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} +# unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} +# coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} + html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} + + PDFDocumentation: + uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@r1 + needs: + - UnitTestingParams + - HTMLDocumentation + with: + document: actions + latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} + pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} + PublishToGitHubPages: uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@py313 needs: - UnitTestingParams - - BuildTheDocs + - HTMLDocumentation + - PDFDocumentation # - Coverage - PublishCoverageResults - StaticTypeCheck diff --git a/doc/conf.py b/doc/conf.py index 50f9c225..1c3ddca3 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -186,7 +186,6 @@ # SphinxContrib extensions "sphinxcontrib.mermaid", # Other extensions - "sphinx_fontawesome", "sphinx_autodoc_typehints", "sphinx_inline_tabs", "autoapi.sphinx", From 1d0c8b36e8c65412adcefe80d733c15d5f03d10b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 24 Oct 2024 08:13:14 +0200 Subject: [PATCH 08/19] Switch from BTD to Sphinx. --- .github/workflows/_Checking_Pipeline.yml | 10 +- doc/JobTemplate/Parameters.rst | 2 +- doc/_static/css/override.css | 115 +++++++++++++++++++++++ doc/conf.py | 112 +++++++++++++--------- doc/coverage/index.rst | 2 +- doc/requirements.txt | 6 ++ doc/shields.inc | 4 +- doc/unittests/index.rst | 2 +- 8 files changed, 195 insertions(+), 58 deletions(-) create mode 100644 doc/_static/css/override.css diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 969536f2..532297a5 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -109,14 +109,6 @@ jobs: # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - BuildTheDocs: - uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@py313 - needs: - - UnitTestingParams -# - VerifyDocs - with: - artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} - HTMLDocumentation: uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@py313 needs: @@ -144,7 +136,7 @@ jobs: needs: - UnitTestingParams - HTMLDocumentation - - PDFDocumentation +# - PDFDocumentation # - Coverage - PublishCoverageResults - StaticTypeCheck diff --git a/doc/JobTemplate/Parameters.rst b/doc/JobTemplate/Parameters.rst index 10c3bb7d..bdaf3cf0 100644 --- a/doc/JobTemplate/Parameters.rst +++ b/doc/JobTemplate/Parameters.rst @@ -138,7 +138,7 @@ python_version_list | Parameter Name | Required | Type | Default | +======================+==========+==========+============================+ | python_version_list | optional | string | ``3.8 3.9 3.10 3.11 3.12`` | -+----------------------+----------+----------+-------------------------- -+ ++----------------------+----------+----------+----------------------------+ Space separated list of CPython versions and/or mypy version to run tests with. diff --git a/doc/_static/css/override.css b/doc/_static/css/override.css new file mode 100644 index 00000000..27407d4a --- /dev/null +++ b/doc/_static/css/override.css @@ -0,0 +1,115 @@ +/* theme overrides */ +.rst-content h1, +.rst-content h2 { + margin-top: 24px; + margin-bottom: 6px; + text-decoration: underline; +} + +.rst-content h3, +.rst-content h4, +.rst-content h5, +.rst-content h6 { + margin-top: 12px; + margin-bottom: 6px; +} + +.rst-content p { + margin-bottom: 6px +} + +/* general overrides */ +html { + font-size: 15px; +} + +footer { + font-size: 95%; + text-align: center +} + +footer p { + margin-bottom: 0px /* 12px */; + font-size: 95% +} + +section > p, +.section p, +.simple li { + text-align: justify +} + +.rst-content .topic-title { + font-size: larger; + font-weight: 700; + margin-top: 18px; + margin-bottom: 6px; +} + +.rst-content p.rubric { + text-decoration: underline; + font-weight: 700; + margin-top: 18px; + margin-bottom: 16px; +} + +/* wyrm overrides */ +.wy-menu-vertical header, +.wy-menu-vertical p.caption { + color: #9b9b9b /* #55a5d9 */; + padding: 0 0.809em /* 0 1.618em */; + margin: 6px 0 0 0 /* 12px 0 0 */; + border-top: 1px solid #9b9b9b; +} + +.wy-side-nav-search { + margin-bottom: 0 /* .809em */; + background-color: #333333 /* #2980b9 */; + /* BTD: */ + /*color: #fcfcfc*/ +} + +.wy-side-nav-search input[type=text] { + border-radius: 0px /* 50px */; +} + +.wy-side-nav-search .wy-dropdown > a, .wy-side-nav-search > a { + /* BTD: */ + /*color: #fcfcfc;*/ + margin-bottom: 0.404em /* .809em */; +} + +.wy-side-nav-search > div.version { + margin: 0 0 6px 0; + /* BTD: */ + /*margin-top: -.4045em;*/ +} + +.wy-nav .wy-menu-vertical a:hover { + background-color: #333333 /* #2980b9 */; +} + +.wy-nav-content { + max-width: 1600px /* 800px */ ; +} + +.wy-nav-top { + background: #333333 /* #2980b9 */; +} + +/* Sphinx Design */ +.sd-tab-set { + margin: 0 +} + +.sd-tab-set > label { + padding-top: .5em; + padding-right: 1em; + padding-bottom: .5em; + padding-left: 1em +} + +.sd-container-fluid { + padding-left: 0; + padding-right: 0; +} diff --git a/doc/conf.py b/doc/conf.py index 1c3ddca3..327b3caa 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,7 +14,7 @@ sys_path.insert(0, abspath(".")) sys_path.insert(0, abspath("..")) sys_path.insert(0, abspath("../pyDummy")) -sys_path.insert(0, abspath("_extensions")) +# sys_path.insert(0, abspath("_extensions")) # ============================================================================== @@ -23,9 +23,11 @@ # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -project = "Actions" +githubNamespace = "pyTooling" +githubProject = "Actions" +project = "pyDummy" -packageInformationFile = Path(f"../pyDummy/__init__.py") +packageInformationFile = Path(f"../{project}/__init__.py") versionInformation = extractVersionInformation(packageInformationFile) author = versionInformation.Author @@ -73,30 +75,15 @@ # ============================================================================== # Options for HTML output # ============================================================================== -html_context = {} -ctx = ROOT / "context.json" -if ctx.is_file(): - html_context.update(loads(ctx.open('r').read())) - -if (ROOT / "_theme").is_dir(): - html_theme_path = ["."] - html_theme = "_theme" - html_theme_options = { - "logo_only": True, - "home_breadcrumbs": False, - "vcs_pageview_mode": 'blob', -# "body_max_width": None -# "navigation_depth": 5, - } -elif find_spec("sphinx_rtd_theme") is not None: - html_theme = "sphinx_rtd_theme" - html_theme_options = { - "logo_only": True, - "vcs_pageview_mode": 'blob', -# "navigation_depth": 5, - } -else: - html_theme = "alabaster" +html_theme = "sphinx_rtd_theme" +html_theme_options = { + "logo_only": True, + "vcs_pageview_mode": 'blob', + "navigation_depth": 5, +} +html_css_files = [ + 'css/override.css', +] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -107,7 +94,7 @@ html_favicon = str(Path(html_static_path[0]) / "icon.png") # Output file base name for HTML help builder. -htmlhelp_basename = "ActionsDoc" +htmlhelp_basename = f"{githubProject}Doc" # If not None, a 'Last updated on:' timestamp is inserted at every page # bottom, using the given strftime format. @@ -160,10 +147,10 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( master_doc, - "Actions.tex", - "The pyTooling Actions Documentation", - "Patrick Lehmann", - "manual" + f"{githubProject}.tex", + f"The {githubProject} Documentation", + f"Patrick Lehmann", + f"manual" ), ] @@ -174,7 +161,6 @@ extensions = [ # Standard Sphinx extensions "sphinx.ext.autodoc", - "sphinx.ext.coverage", "sphinx.ext.extlinks", "sphinx.ext.intersphinx", "sphinx.ext.inheritance_diagram", @@ -186,9 +172,12 @@ # SphinxContrib extensions "sphinxcontrib.mermaid", # Other extensions + "sphinx_design", + "sphinx_copybutton", "sphinx_autodoc_typehints", - "sphinx_inline_tabs", "autoapi.sphinx", + "sphinx_reports", +# User defined extensions ] @@ -220,11 +209,11 @@ # Sphinx.Ext.ExtLinks # ============================================================================== extlinks = { - "gh": ("https://GitHub.com/%s", "gh:%s"), - "ghissue": ("https://GitHub.com/pyTooling/Actions/issues/%s", "issue #%s"), - "ghpull": ("https://GitHub.com/pyTooling/Actions/pull/%s", "pull request #%s"), - "ghsrc": ("https://GitHub.com/pyTooling/Actions/blob/main/%s", None), - "wiki": ("https://en.wikipedia.org/wiki/%s", None), + "gh": (f"https://GitHub.com/%s", "gh:%s"), + "ghissue": (f"https://GitHub.com/{githubNamespace}/{githubProject}/issues/%s", "issue #%s"), + "ghpull": (f"https://GitHub.com/{githubNamespace}/{githubProject}/pull/%s", "pull request #%s"), + "ghsrc": (f"https://GitHub.com/{githubNamespace}/{githubProject}/blob/main/%s", None), + "wiki": (f"https://en.wikipedia.org/wiki/%s", None), } @@ -264,18 +253,53 @@ # ============================================================================== -# Sphinx.Ext.Coverage +# sphinx-reports # ============================================================================== -coverage_show_missing_items = True +# report_unittest_testsuites = { +# "src": { +# "name": f"{project}", +# "xml_report": "../report/unit/unittest.xml", +# } +# } +# report_codecov_packages = { +# "src": { +# "name": f"{project}", +# "json_report": "../report/coverage/coverage.json", +# "fail_below": 80, +# "levels": "default" +# } +# } +# report_doccov_packages = { +# "src": { +# "name": f"{project}", +# "directory": f"../{project}", +# "fail_below": 80, +# "levels": "default" +# } +# } + + +# ============================================================================== +# Sphinx_Design +# ============================================================================== +# sd_fontawesome_latex = True # ============================================================================== # AutoAPI.Sphinx # ============================================================================== autoapi_modules = { - "pyDummy": { - "template": "module", - "output": "pyDummy", + f"{project}": { + "template": "package", + "output": project, "override": True } } + +for directory in [mod for mod in Path(f"../{project}").iterdir() if mod.is_dir() and mod.name != "__pycache__"]: + print(f"Adding module rule for '{project}.{directory.name}'") + autoapi_modules[f"{project}.{directory.name}"] = { + "template": "module", + "output": project, + "override": True + } diff --git a/doc/coverage/index.rst b/doc/coverage/index.rst index bad51b90..ef8d044d 100644 --- a/doc/coverage/index.rst +++ b/doc/coverage/index.rst @@ -3,5 +3,5 @@ Code Coverage Report Code coverage report generated with `pytest `__ and `Coverage.py `__. -.. report:code-coverage:: +.. #report:code-coverage:: :packageid: src diff --git a/doc/requirements.txt b/doc/requirements.txt index e0760842..efecb1ec 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,6 +6,9 @@ pyTooling ~= 6.7 sphinx ~= 8.1 docutils ~= 0.21 +# ReadTheDocs Theme +sphinx_rtd_theme ~= 3.0 + # Sphinx Extenstions #sphinx.ext.coverage #sphinxcontrib-actdiag>=0.8.5 @@ -18,3 +21,6 @@ sphinx_design ~= 0.6.1 sphinx-copybutton >= 0.5.2 sphinx_autodoc_typehints ~= 2.5 # changelog>=0.3.5 +sphinx_reports ~= 0.6 + +# BuildTheDocs Extensions (mostly patched Sphinx extensions) diff --git a/doc/shields.inc b/doc/shields.inc index 039867cd..08ea1065 100644 --- a/doc/shields.inc +++ b/doc/shields.inc @@ -7,11 +7,11 @@ .. |SHIELD:svg:pyTooling-github| image:: https://img.shields.io/badge/pyTooling-Actions-63bf7f.svg?longCache=true&style=flat-square&longCache=true&logo=GitHub :alt: Sourcecode on GitHub :height: 22 - :target: https://GitHub.com/pyTooling/pyTooling + :target: https://GitHub.com/pyTooling/Actions .. |SHIELD:png:pyTooling-github| image:: https://raster.shields.io/badge/pyTooling-Actions-63bf7f.svg?longCache=true&style=flat-square&longCache=true&logo=GitHub :alt: Sourcecode on GitHub :height: 22 - :target: https://GitHub.com/pyTooling/pyTooling + :target: https://GitHub.com/pyTooling/Actions .. # Sourcecode license .. |SHIELD:svg:pyTooling-src-license| image:: https://img.shields.io/pypi/l/pyTooling?longCache=true&style=flat-square&logo=Apache&label=code diff --git a/doc/unittests/index.rst b/doc/unittests/index.rst index 8b840ee6..f9650147 100644 --- a/doc/unittests/index.rst +++ b/doc/unittests/index.rst @@ -3,5 +3,5 @@ Unittest Summary Report Unittest report generated with `pytest `__. -.. report:unittest-summary:: +.. #report:unittest-summary:: :reportid: src From fbbb39046ae68bd3fa1d62f90d05db6c8a2672a8 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 24 Oct 2024 22:37:13 +0200 Subject: [PATCH 09/19] Preparation before merge. [skip ci] --- .../workflows/_Checking_ArtifactCleanup.yml | 2 +- .github/workflows/_Checking_Parameters.yml | 14 ++++----- .github/workflows/_Checking_Pipeline.yml | 30 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/_Checking_ArtifactCleanup.yml b/.github/workflows/_Checking_ArtifactCleanup.yml index 6cde55cf..c8cba7a5 100644 --- a/.github/workflows/_Checking_ArtifactCleanup.yml +++ b/.github/workflows/_Checking_ArtifactCleanup.yml @@ -6,7 +6,7 @@ on: jobs: Params: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example python_version_list: "3.12 3.13" diff --git a/.github/workflows/_Checking_Parameters.yml b/.github/workflows/_Checking_Parameters.yml index 48569254..3b8566b4 100644 --- a/.github/workflows/_Checking_Parameters.yml +++ b/.github/workflows/_Checking_Parameters.yml @@ -6,24 +6,24 @@ on: jobs: Params_Default: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example Params_PythonVersions: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example python_version_list: "3.11 3.12 pypy-3.9 pypy-3.10" Params_Systems: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example system_list: "windows mingw32 mingw64" Params_Include: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example python_version_list: "3.11" @@ -31,7 +31,7 @@ jobs: include_list: "ubuntu:3.12 ubuntu:3.13" Params_Exclude: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example python_version_list: "3.12" @@ -39,7 +39,7 @@ jobs: exclude_list: "windows:3.12 windows:3.13" Params_Disable: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example python_version_list: "3.12" @@ -47,7 +47,7 @@ jobs: disable_list: "windows:3.12 windows:3.13" Params_All: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Example python_version_list: "3.12 3.13" diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 532297a5..dba68051 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -6,21 +6,21 @@ on: jobs: UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: pyDummy python_version_list: "3.8 3.9 3.10 3.11 3.12 3.13 pypy-3.8 pypy-3.9 pypy-3.10" # disable_list: "windows:pypy-3.10" PlatformTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@py313 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Platform python_version_list: "" system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64" UnitTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@py313 + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev needs: - UnitTestingParams with: @@ -33,7 +33,7 @@ jobs: # coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} PlatformTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@py313 + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev needs: - PlatformTestingParams with: @@ -48,7 +48,7 @@ jobs: coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }} # Coverage: -# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@py313 +# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@dev # needs: # - UnitTestingParams # with: @@ -58,7 +58,7 @@ jobs: # codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@py313 + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev needs: - UnitTestingParams with: @@ -69,7 +69,7 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@py313 + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev needs: - UnitTestingParams - UnitTesting @@ -84,7 +84,7 @@ jobs: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@py313 + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev needs: - UnitTesting - PlatformTesting @@ -92,7 +92,7 @@ jobs: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@py313 + uses: pyTooling/Actions/.github/workflows/Package.yml@dev needs: - UnitTestingParams - UnitTesting @@ -103,14 +103,14 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@py313 +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} HTMLDocumentation: - uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@py313 + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev needs: - UnitTestingParams # - VerifyDocs @@ -132,7 +132,7 @@ jobs: pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@py313 + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev needs: - UnitTestingParams - HTMLDocumentation @@ -146,7 +146,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@py313 + uses: pyTooling/Actions/.github/workflows/Release.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - UnitTesting @@ -157,7 +157,7 @@ jobs: - PublishToGitHubPages PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@py313 + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - UnitTestingParams @@ -171,7 +171,7 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@py313 + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev needs: - UnitTestingParams - PlatformTestingParams From c3a999c754279b96e836d47532a80599ca483643 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 24 Oct 2024 22:41:20 +0200 Subject: [PATCH 10/19] Using Python 3.12 is good enough. (cherry picked from commit 9fd7134989f2f3fcb2868e7006a4093ddd2d13c8) --- releaser/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releaser/Dockerfile b/releaser/Dockerfile index 728c35c4..080b725c 100644 --- a/releaser/Dockerfile +++ b/releaser/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim-bullseye +FROM python:3.12-slim-bookworm COPY releaser.py /releaser.py RUN pip install PyGithub --progress-bar off \ && apt update -qq \ From 1cef0827531810202940359073a84c3095018f59 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 27 Oct 2024 19:47:04 +0100 Subject: [PATCH 11/19] Bumped dependencies. --- .idea/Actions.iml | 2 +- doc/requirements.txt | 4 +- pyproject.toml | 4 +- requirements.txt | 2 +- run.ps1 | 316 +++++++++++++++++++++++++++++++++++++++++ tests/requirements.txt | 2 +- 6 files changed, 323 insertions(+), 7 deletions(-) create mode 100644 run.ps1 diff --git a/.idea/Actions.iml b/.idea/Actions.iml index d0876a78..d8b3f6cb 100644 --- a/.idea/Actions.iml +++ b/.idea/Actions.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/doc/requirements.txt b/doc/requirements.txt index efecb1ec..da3f29a3 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ -r ../requirements.txt -pyTooling ~= 6.7 +pyTooling ~= 7.0 # Enforce latest version on ReadTheDocs sphinx ~= 8.1 @@ -21,6 +21,6 @@ sphinx_design ~= 0.6.1 sphinx-copybutton >= 0.5.2 sphinx_autodoc_typehints ~= 2.5 # changelog>=0.3.5 -sphinx_reports ~= 0.6 +sphinx_reports ~= 0.7 # BuildTheDocs Extensions (mostly patched Sphinx extensions) diff --git a/pyproject.toml b/pyproject.toml index fe0ec4fa..210f2d99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools ~= 75.1", + "setuptools ~= 75.2", "wheel ~= 0.44", - "pyTooling ~= 6.7" + "pyTooling ~= 7.0" ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index c802ce33..ce027dff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyTooling ~= 6.7 +pyTooling ~= 7.0 diff --git a/run.ps1 b/run.ps1 new file mode 100644 index 00000000..9e1ffd4b --- /dev/null +++ b/run.ps1 @@ -0,0 +1,316 @@ +[CmdletBinding()] +Param( + # Clean up all files and directories + [switch]$clean, + + # Commands + [switch]$all, + [switch]$copyall, + + [switch]$doc, + [switch]$livedoc, + [switch]$doccov, + + [switch]$unit, + [switch]$liveunit, + [switch]$copyunit, + + [switch]$cov, + [switch]$livecov, + [switch]$copycov, + + [switch]$type, + [switch]$livetype, + [switch]$copytype, + + [switch]$nooutput, + + [switch]$build, + [switch]$install, + + # Display this help" + [switch]$help +) + +$PackageName = "Actions" + +# set default values +$EnableDebug = [bool]$PSCmdlet.MyInvocation.BoundParameters["Debug"] +$EnableVerbose = [bool]$PSCmdlet.MyInvocation.BoundParameters["Verbose"] -or $EnableDebug + +# Display help if no command was selected +$help = $help -or ( -not( + $all -or $copyall -or + $clean -or + $doc -or $livedoc -or $doccov -or + $unit -or $liveunit -or $copyunit -or + $cov -or $livecov -or $copycov -or + $type -or $livetype -or $copytype -or + $build -or $install + ) +) + +Write-Host "================================================================================" -ForegroundColor Magenta +Write-Host "$PackageName Documentation Compilation and Assembly Tool" -ForegroundColor Magenta +Write-Host "================================================================================" -ForegroundColor Magenta + +if ($help) +{ Get-Help $MYINVOCATION.MyCommand.Path -Detailed + exit 0 +} + +if ($all) +{ $doc = $true + $unit = $true +# $copyunit = $true + $cov = $true +# $copycov = $true + $type = $true + $copytype = $true +} +if ($copyall) +{# $copyunit = $true +# $copycov = $true + $copytype = $true +} + +if ($clean) +{ Write-Host -ForegroundColor DarkYellow "[live][DOC] Cleaning documentation directories ..." + rm -Force .\doc\$PackageName\* + .\doc\make.bat clean + Write-Host -ForegroundColor DarkYellow "[live][BUILD] Cleaning build directories ..." + rm -Force .\build\bdist.win-amd64 + rm -Force .\build\lib +} + +if ($build) +{ Write-Host -ForegroundColor Yellow "[live][BUILD] Cleaning build directories ..." + rm -Force .\build\bdist.win-amd64 + rm -Force .\build\lib + Write-Host -ForegroundColor Yellow "[live][BUILD] Building $PackageName package as wheel ..." + py -3.12 -m build --wheel + + Write-Host -ForegroundColor Yellow "[live][BUILD] Building wheel finished" +} +if ($install) +{ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) + { Write-Host -ForegroundColor Yellow "[live][INSTALL] Installing $PackageName with administrator rights ..." + $proc = Start-Process pwsh.exe "-NoProfile -ExecutionPolicy Bypass -WorkingDirectory `"$PSScriptRoot`" -File `"$PSCommandPath`" `"-install`"" -Verb RunAs -Wait + +# Write-Host -ForegroundColor Yellow "[live][INSTALL] Wait on administrator console ..." +# Wait-Process -Id $proc.Id + } + else + { Write-Host -ForegroundColor Cyan "[ADMIN][UNINSTALL] Uninstalling $PackageName ..." + py -3.12 -m pip uninstall -y $PackageName + Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Installing $PackageName from wheel ..." + py -3.12 -m pip install .\dist\$PackageName-6.7.0-py3-none-any.whl + + Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Closing window in 5 seconds ..." + Start-Sleep -Seconds 5 + } +} + +$jobs = @() + +if ($livedoc) +{ Write-Host -ForegroundColor DarkYellow "[live][DOC] Building documentation using Sphinx ..." + + .\doc\make.bat html --verbose + + Write-Host -ForegroundColor DarkYellow "[live][DOC] Documentation finished" +} +elseif ($doc) +{ Write-Host -ForegroundColor DarkYellow "[Job1][DOC] Building documentation using Sphinx ..." + Write-Host -ForegroundColor DarkGreen "[SCRIPT] Starting Documentation job ..." + + # Compile documentation + $compileDocFunc = { + .\doc\make.bat html --verbose + } + $docJob = Start-Job -Name "Documentation" -ScriptBlock $compileDocFunc +# $jobs += $docJob +} + + +if ($doccov) +{ + .\doc\make.bat coverage +} + +if ($liveunit) +{ Write-Host -ForegroundColor DarkYellow "[live][UNIT] Running Unit Tests using pytest ..." + + $env:ENVIRONMENT_NAME = "Windows (x86-64)" + pytest -raP --color=yes --junitxml=report/unit/unittest.xml --template=html1/index.html --report=report/unit/html/index.html --split-report tests/unit + + if ($copyunit) + { cp -Recurse -Force .\report\unit\html\* .\doc\_build\html\unittests + Write-Host -ForegroundColor DarkBlue "[live][UNIT] Copyed unit testing report to 'unittests' directory in HTML directory" + } + + Write-Host -ForegroundColor DarkYellow "[live][UNIT] Unit Tests finished" +} +elseif ($unit) +{ Write-Host -ForegroundColor DarkYellow "[Job2][UNIT] Running Unit Tests using pytest ..." + Write-Host -ForegroundColor DarkGreen "[SCRIPT] Starting UnitTests jobs ..." + + # Run unit tests + $runUnitFunc = { + $env:ENVIRONMENT_NAME = "Windows (x86-64)" + pytest -raP --color=yes --junitxml=report/unit/unittest.xml --template=html1/index.html --report=report/unit/html/index.html --split-report tests/unit + } + $unitJob = Start-Job -Name "UnitTests" -ScriptBlock $runUnitFunc + $jobs += $unitJob +} + +if ($livecov) +{ Write-Host -ForegroundColor DarkMagenta "[live][COV] Running Unit Tests with coverage ..." + + $env:ENVIRONMENT_NAME = "Windows (x86-64)" + coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -ra --tb=line --color=yes tests/unit + + Write-Host -ForegroundColor DarkMagenta "[live][COV] Convert coverage report to HTML ..." + coverage html + + Write-Host -ForegroundColor DarkMagenta "[live][COV] Convert coverage report to XML (Cobertura) ..." + coverage xml + + Write-Host -ForegroundColor DarkMagenta "[live][COV] Convert coverage report to JSON ..." + coverage json + + Write-Host -ForegroundColor DarkMagenta "[live][COV] Write coverage report to console ..." + coverage report + + if ($copycov) + { cp -Recurse -Force .\report\coverage\html\* .\doc\_build\html\coverage + Write-Host -ForegroundColor DarkMagenta "[live][COV] Copyed code coverage report to 'coverage' directory in HTML directory" + } + + Write-Host -ForegroundColor DarkMagenta "[live][COV] Coverage finished" +} +elseif ($cov) +{ Write-Host -ForegroundColor DarkMagenta "[live][COV] Running Unit Tests with coverage ..." + Write-Host -ForegroundColor DarkMagenta "[SCRIPT] Starting Coverage jobs ..." + + # Collect coverage + $collectCovFunc = { + $env:ENVIRONMENT_NAME = "Windows (x86-64)" + coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -ra --tb=line --color=yes tests/unit + + Write-Host -ForegroundColor DarkMagenta "[Job3][COV] Convert coverage report to HTML ..." + coverage html + + Write-Host -ForegroundColor DarkMagenta "[Job3][COV] Convert coverage report to XML (Cobertura) ..." + coverage xml + + Write-Host -ForegroundColor DarkMagenta "[Job3][COV] Convert coverage report to JSON ..." + coverage json + } + $covJob = Start-Job -Name "Coverage" -ScriptBlock $collectCovFunc + $jobs += $covJob +} + +if ($livetype) +{ Write-Host -ForegroundColor DarkCyan "[live][TYPE] Running static type analysis using mypy ..." + + $env:MYPY_FORCE_COLOR = 1 + mypy.exe -p $PackageName + + if ($copytype) + { cp -Recurse -Force .\report\typing\* .\doc\_build\html\typing + Write-Host -ForegroundColor DarkCyan "[live][TYPE] Copyed typing report to 'typing' directory in HTML directory." + } + + Write-Host -ForegroundColor DarkCyan "[live][TYPE] Static type analysis finished" +} +elseif ($type) +{ Write-Host -ForegroundColor DarkCyan "[live][TYPE] Running static type analysis using mypy ..." + Write-Host -ForegroundColor DarkCyan "[SCRIPT] Starting Typing jobs ..." + + # Analyze types + $analyzeTypesFunc = { + $env:MYPY_FORCE_COLOR = 1 + mypy.exe -p $PackageName + } + $typeJob = Start-Job -Name "Typing" -ScriptBlock $analyzeTypesFunc + $jobs += $typeJob +} + + +if ($doc) +{ Write-Host -ForegroundColor DarkGreen "[SCRIPT] Waiting on Documentation job ..." + Wait-Job -Job $docJob + Write-Host -ForegroundColor DarkYellow "[Job1][DOC] Documentation finished" +} +if ($jobs.Count -ne 0) +{ + Write-Host -ForegroundColor DarkGreen ( "[SCRIPT] Waiting on {0} jobs ({1}) ..." -f $jobs.Count, (($jobs | %{ $_.Name }) -join ", ")) + Wait-Job -Job $jobs +} + + +if (-not $liveunit -and $copyunit) +{ +# if ($unit) +# { Wait-Job -Job $unitJob +# Write-Host -ForegroundColor DarkBlue "[Job2][UNIT] Unit tests finished" +# } + cp -Recurse -Force .\report\unit\html\* .\doc\_build\html\unittests + Write-Host -ForegroundColor DarkBlue "[post][UNIT] Copyed unit testing report to 'unittests' directory in HTML directory" +} +if (-not ($livecov -or $cov) -and $copycov) +{ +# if ($cov) +# { Wait-Job -Job $unitJob +# Write-Host -ForegroundColor DarkMagenta "[Job3][UNIT] Coverage collection finished" +# } + cp -Recurse -Force .\report\coverage\html\* .\doc\_build\html\coverage + Write-Host -ForegroundColor DarkMagenta "[post][COV] Copyed code coverage report to 'coverage' directory in HTML directory" +} +if (-not $livetype -and $copytype) +{ +# if ($type) +# { Wait-Job -Job $typeJob +# Write-Host -ForegroundColor DarkCyan "[Job4][UNIT] Static type analysis finished" +# } + cp -Recurse -Force .\report\typing\* .\doc\_build\html\typing + Write-Host -ForegroundColor DarkCyan "[post][TYPE] Copyed typing report to 'typing' directory in HTML directory." +} + + +if ($type) +{ Write-Host -ForegroundColor DarkCyan "================================================================================" + if (-not $nooutput) + { Receive-Job -Job $typeJob + } + Remove-Job -Job $typeJob +} +if ($doc) +{ Write-Host -ForegroundColor DarkYellow "================================================================================" + if (-not $nooutput) + { Receive-Job -Job $docJob + } + Remove-Job -Job $docJob +} +if ($unit) +{ Write-Host -ForegroundColor DarkBlue "================================================================================" + if (-not $nooutput) + { Receive-Job -Job $unitJob + } + Remove-Job -Job $unitJob +} +if ($cov) +{ Write-Host -ForegroundColor DarkMagenta "================================================================================" + if (-not $nooutput) + { Receive-Job -Job $covJob + } + Remove-Job -Job $covJob + + if ($copycov) + { cp -Recurse -Force .\report\coverage\html\* .\doc\_build\html\coverage + Write-Host -ForegroundColor DarkMagenta "[post][COV] Copyed code coverage report to 'coverage' directory in HTML directory" + } +} +Write-Host -ForegroundColor DarkGreen "================================================================================" +Write-Host -ForegroundColor DarkGreen "[SCRIPT] Finished" diff --git a/tests/requirements.txt b/tests/requirements.txt index 77e2f22b..130f5c68 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -8,6 +8,6 @@ pytest ~= 8.3 pytest-cov ~= 5.0 # Static Type Checking -mypy ~= 1.11 +mypy ~= 1.13 typing_extensions ~= 4.12 lxml ~= 5.3 From b9b9b0b1d450e7499862fe409152552cd0b69ddf Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 08:41:51 +0100 Subject: [PATCH 12/19] Added ubuntu_image_version parameter. --- .github/workflows/ArtifactCleanUp.yml | 7 ++++++- .github/workflows/CheckDocumentation.yml | 7 ++++++- .github/workflows/CoverageCollection.yml | 7 ++++++- .github/workflows/IntermediateCleanUp.yml | 7 ++++++- .github/workflows/LaTeXDocumentation.yml | 7 ++++++- .github/workflows/Package.yml | 7 ++++++- .github/workflows/Parameters.yml | 7 ++++++- .github/workflows/PublishCoverageResults.yml | 7 ++++++- .github/workflows/PublishOnPyPI.yml | 7 ++++++- .github/workflows/PublishTestResults.yml | 7 ++++++- .github/workflows/PublishToGitHubPages.yml | 7 ++++++- .github/workflows/Release.yml | 2 +- .github/workflows/StaticTypeCheck.yml | 7 ++++++- .github/workflows/VerifyDocs.yml | 7 ++++++- pyproject.toml | 2 +- tests/requirements.txt | 2 +- 16 files changed, 81 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ArtifactCleanUp.yml b/.github/workflows/ArtifactCleanUp.yml index 97929fb3..02c72e78 100644 --- a/.github/workflows/ArtifactCleanUp.yml +++ b/.github/workflows/ArtifactCleanUp.yml @@ -25,6 +25,11 @@ name: ArtifactCleanUp on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string package: description: 'Artifacts to be removed on not tagged runs.' required: true @@ -38,7 +43,7 @@ on: jobs: ArtifactCleanUp: name: 🗑️ Artifact Cleanup - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 🗑️ Delete package Artifacts diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index e88a6bdd..71187fe8 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -24,6 +24,11 @@ name: Check Documentation on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string python_version: description: 'Python version.' required: false @@ -42,7 +47,7 @@ on: jobs: DocCoverage: name: 👀 Check documentation coverage - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 4f8b0192..03520272 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -25,6 +25,11 @@ name: Coverage Collection on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string python_version: description: 'Python version.' required: false @@ -63,7 +68,7 @@ jobs: Coverage: name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/IntermediateCleanUp.yml b/.github/workflows/IntermediateCleanUp.yml index d1a6607a..04991744 100644 --- a/.github/workflows/IntermediateCleanUp.yml +++ b/.github/workflows/IntermediateCleanUp.yml @@ -24,6 +24,11 @@ name: Intermediate Cleanup on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string sqlite_coverage_artifacts_prefix: description: 'Prefix for SQLite coverage artifacts' required: false @@ -36,7 +41,7 @@ on: jobs: IntermediateCleanUp: name: 🗑️ Intermediate Artifact Cleanup - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 🗑️ Delete SQLite coverage artifacts from matrix jobs uses: geekyeggo/delete-artifact@v5 diff --git a/.github/workflows/LaTeXDocumentation.yml b/.github/workflows/LaTeXDocumentation.yml index 675ae043..54ca4f0c 100644 --- a/.github/workflows/LaTeXDocumentation.yml +++ b/.github/workflows/LaTeXDocumentation.yml @@ -24,6 +24,11 @@ name: LaTeX Documentation on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string document: description: 'LaTeX root document without *.tex extension.' required: true @@ -42,7 +47,7 @@ on: jobs: PDFDocumentation: name: 📓 Converting LaTeX Documentation to PDF - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 📥 Download artifacts '${{ inputs.latex_artifact }}' from 'SphinxDocumentation' job uses: actions/download-artifact@v4 diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index b18ad87a..476bd37f 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -25,6 +25,11 @@ name: Package on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string python_version: description: 'Python version.' required: false @@ -44,7 +49,7 @@ jobs: Package: name: 📦 Package in Source and Wheel Format - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 7983420f..393ee551 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -25,6 +25,11 @@ name: Parameters on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string name: description: 'Name of the tool.' required: true @@ -96,7 +101,7 @@ on: jobs: Parameters: - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" outputs: python_version: ${{ steps.params.outputs.python_version }} python_jobs: ${{ steps.params.outputs.python_jobs }} diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index 395a120e..2e550965 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -24,6 +24,11 @@ name: Publish Code Coverage Results on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string coverage_config: description: 'Path to the .coveragerc file. Use pyproject.toml by default.' required: false @@ -57,7 +62,7 @@ on: jobs: PublishCoverageResults: name: 📊 Publish Code Coverage Results - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" if: always() steps: diff --git a/.github/workflows/PublishOnPyPI.yml b/.github/workflows/PublishOnPyPI.yml index f108670f..b951463c 100644 --- a/.github/workflows/PublishOnPyPI.yml +++ b/.github/workflows/PublishOnPyPI.yml @@ -25,6 +25,11 @@ name: Publish on PyPI on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string python_version: description: 'Python version.' required: false @@ -48,7 +53,7 @@ jobs: PublishOnPyPI: name: 🚀 Publish to PyPI - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 4ff32f89..a4e5cd56 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -25,6 +25,11 @@ name: Publish Unit Test Results on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string merged_junit_artifact: description: 'Name of the merged JUnit Test Summary artifact.' required: false @@ -44,7 +49,7 @@ on: jobs: PublishTestResults: name: 📊 Publish Test Results - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" if: always() steps: diff --git a/.github/workflows/PublishToGitHubPages.yml b/.github/workflows/PublishToGitHubPages.yml index 325512bd..9f6ed1bc 100644 --- a/.github/workflows/PublishToGitHubPages.yml +++ b/.github/workflows/PublishToGitHubPages.yml @@ -25,6 +25,11 @@ name: Publish to GitHub Pages on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string doc: description: 'Name of the documentation artifact.' required: true @@ -44,7 +49,7 @@ jobs: PublishToGitHubPages: name: 📚 Publish to GH-Pages - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 764eee73..db77a136 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -29,7 +29,7 @@ jobs: Release: name: 📝 Create 'Release Page' on GitHub - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 🔁 Extract Git tag from GITHUB_REF diff --git a/.github/workflows/StaticTypeCheck.yml b/.github/workflows/StaticTypeCheck.yml index c37d64f2..82fe2bf6 100644 --- a/.github/workflows/StaticTypeCheck.yml +++ b/.github/workflows/StaticTypeCheck.yml @@ -25,6 +25,11 @@ name: Static Type Check on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string python_version: description: 'Python version.' required: false @@ -63,7 +68,7 @@ jobs: StaticTypeCheck: name: 👀 Check Static Typing using Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/VerifyDocs.yml b/.github/workflows/VerifyDocs.yml index 574f9c59..f8163058 100644 --- a/.github/workflows/VerifyDocs.yml +++ b/.github/workflows/VerifyDocs.yml @@ -25,6 +25,11 @@ name: Verify examples on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string python_version: description: 'Python version.' required: false @@ -35,7 +40,7 @@ jobs: VerifyDocs: name: 👍 Verify example snippets using Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/pyproject.toml b/pyproject.toml index 210f2d99..4ad49512 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools ~= 75.2", + "setuptools ~= 75.3", "wheel ~= 0.44", "pyTooling ~= 7.0" ] diff --git a/tests/requirements.txt b/tests/requirements.txt index 130f5c68..2ad659b6 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -5,7 +5,7 @@ Coverage ~= 7.6 # Test Runner pytest ~= 8.3 -pytest-cov ~= 5.0 +pytest-cov ~= 6.0 # Static Type Checking mypy ~= 1.13 From c924651632013a959752807bc17b74059613b552 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 08:42:32 +0100 Subject: [PATCH 13/19] Split Sphinx into a prepare and two working sub-jobs for HTML and LaTeX. --- .github/workflows/SphinxDocumentation.yml | 102 ++++++++++++++++++---- .github/workflows/_Checking_Pipeline.yml | 32 +++---- 2 files changed, 101 insertions(+), 33 deletions(-) diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index 6fe793b8..3d744088 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -24,6 +24,11 @@ name: Documentation on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string python_version: description: 'Python version.' required: false @@ -71,17 +76,20 @@ on: type: string jobs: - Sphinx: - name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + Prepare: + name: 📓 Extract configurations from pyproject.toml + runs-on: "ubuntu-${ubuntu_image_version}" + outputs: + coverage_report_html_directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }} + coverage_report_xml_directory: ${{ steps.getVariables.outputs.coverage_report_xml_directory }} + coverage_report_xml: ${{ steps.getVariables.outputs.coverage_report_xml }} + coverage_report_json_directory: ${{ steps.getVariables.outputs.coverage_report_json_directory }} + coverage_report_json: ${{ steps.getVariables.outputs.coverage_report_json }} steps: - name: ⏬ Checkout repository uses: actions/checkout@v4 - - name: 🔧 Install graphviz - run: sudo apt-get install -y --no-install-recommends graphviz - - name: 🐍 Setup Python ${{ inputs.python_version }} uses: actions/setup-python@v5 with: @@ -154,6 +162,29 @@ jobs: print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}") + Sphinx-HTML: + name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + runs-on: "ubuntu-${ubuntu_image_version}" + needs: + - Prepare + + steps: + - name: ⏬ Checkout repository + uses: actions/checkout@v4 + + - name: 🔧 Install graphviz + run: sudo apt-get install -y --no-install-recommends graphviz + + - name: 🐍 Setup Python ${{ inputs.python_version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python_version }} + + - name: 🔧 Install wheel,tomli and pip dependencies (native) + run: | + python -m pip install --disable-pip-version-check -U wheel + python -m pip install --disable-pip-version-check ${{ inputs.requirements }} + - name: 📥 Download artifacts '${{ inputs.unittest_xml_artifact }}' from 'Unittesting' job if: inputs.unittest_xml_artifact != '' uses: actions/download-artifact@v4 @@ -166,7 +197,7 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ inputs.coverage_json_artifact }} - path: ${{ steps.getVariables.outputs.coverage_report_json_directory }} + path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} - name: ☑ Generate HTML documentation if: inputs.html_artifact != '' @@ -176,16 +207,6 @@ jobs: cd "${{ inputs.doc_directory || '.' }}" sphinx-build -v -n -b html -d _build/doctrees -j $(nproc) -w _build/html.log . _build/html - - name: ☑ Generate LaTeX documentation - if: inputs.latex_artifact != '' -# continue-on-error: true - run: | - export PYTHONPATH=$(pwd) - - cd "${{ inputs.doc_directory || '.' }}" - sphinx-build -v -n -b latex -d _build/doctrees -j $(nproc) -w _build/latex.log . _build/latex -# --builder html --doctree-dir _build/doctrees --verbose --fresh-env --write-all --nitpicky --warning-file _build/html.log . _build/html - - name: 📤 Upload 'HTML Documentation' artifact if: inputs.html_artifact != '' continue-on-error: true @@ -196,6 +217,53 @@ jobs: if-no-files-found: error retention-days: 1 + Sphinx-LaTeX: + name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + runs-on: "ubuntu-${ubuntu_image_version}" + needs: + - Prepare + + steps: + - name: ⏬ Checkout repository + uses: actions/checkout@v4 + + - name: 🔧 Install graphviz + run: sudo apt-get install -y --no-install-recommends graphviz + + - name: 🐍 Setup Python ${{ inputs.python_version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python_version }} + + - name: 🔧 Install wheel,tomli and pip dependencies (native) + run: | + python -m pip install --disable-pip-version-check -U wheel + python -m pip install --disable-pip-version-check ${{ inputs.requirements }} + + - name: 📥 Download artifacts '${{ inputs.unittest_xml_artifact }}' from 'Unittesting' job + if: inputs.unittest_xml_artifact != '' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.unittest_xml_artifact }} + path: ${{ inputs.unittest_xml_directory }} + + - name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job + if: inputs.coverage_json_artifact != '' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.coverage_json_artifact }} + path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} + + - name: ☑ Generate LaTeX documentation + if: inputs.latex_artifact != '' +# continue-on-error: true + run: | + export PYTHONPATH=$(pwd) + + cd "${{ inputs.doc_directory || '.' }}" + sphinx-build -v -n -b latex -d _build/doctrees -j $(nproc) -w _build/latex.log . _build/latex +# --builder html --doctree-dir _build/doctrees --verbose --fresh-env --write-all --nitpicky --warning-file _build/html.log . _build/html + - name: 📤 Upload 'LaTeX Documentation' artifact if: inputs.latex_artifact != '' continue-on-error: true diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index dba68051..d418fe96 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -6,21 +6,21 @@ on: jobs: UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev + uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx with: name: pyDummy python_version_list: "3.8 3.9 3.10 3.11 3.12 3.13 pypy-3.8 pypy-3.9 pypy-3.10" # disable_list: "windows:pypy-3.10" PlatformTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev + uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx with: name: Platform python_version_list: "" system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64" UnitTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx needs: - UnitTestingParams with: @@ -33,7 +33,7 @@ jobs: # coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} PlatformTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx needs: - PlatformTestingParams with: @@ -48,7 +48,7 @@ jobs: coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }} # Coverage: -# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@dev +# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@sphinx # needs: # - UnitTestingParams # with: @@ -58,7 +58,7 @@ jobs: # codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@sphinx needs: - UnitTestingParams with: @@ -69,7 +69,7 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@sphinx needs: - UnitTestingParams - UnitTesting @@ -84,7 +84,7 @@ jobs: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@sphinx needs: - UnitTesting - PlatformTesting @@ -92,7 +92,7 @@ jobs: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@dev + uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx needs: - UnitTestingParams - UnitTesting @@ -103,14 +103,14 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@sphinx # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} HTMLDocumentation: - uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx needs: - UnitTestingParams # - VerifyDocs @@ -122,7 +122,7 @@ jobs: latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} PDFDocumentation: - uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@r1 + uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@sphinx needs: - UnitTestingParams - HTMLDocumentation @@ -132,7 +132,7 @@ jobs: pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@sphinx needs: - UnitTestingParams - HTMLDocumentation @@ -146,7 +146,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@dev + uses: pyTooling/Actions/.github/workflows/Release.yml@sphinx if: startsWith(github.ref, 'refs/tags') needs: - UnitTesting @@ -157,7 +157,7 @@ jobs: - PublishToGitHubPages PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@sphinx if: startsWith(github.ref, 'refs/tags') needs: - UnitTestingParams @@ -171,7 +171,7 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@sphinx needs: - UnitTestingParams - PlatformTestingParams From bec076bd665fb0d87ccf02ed4860453d6a9ac5c2 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 09:07:27 +0100 Subject: [PATCH 14/19] Fixed pipeline syntax. --- .github/workflows/ArtifactCleanUp.yml | 2 +- .github/workflows/CheckDocumentation.yml | 2 +- .github/workflows/CoverageCollection.yml | 2 +- .github/workflows/IntermediateCleanUp.yml | 2 +- .github/workflows/LaTeXDocumentation.yml | 2 +- .github/workflows/Package.yml | 2 +- .github/workflows/Parameters.yml | 2 +- .github/workflows/PublishCoverageResults.yml | 2 +- .github/workflows/PublishOnPyPI.yml | 2 +- .github/workflows/PublishTestResults.yml | 2 +- .github/workflows/PublishToGitHubPages.yml | 2 +- .github/workflows/Release.yml | 2 +- .github/workflows/SphinxDocumentation.yml | 6 +++--- .github/workflows/StaticTypeCheck.yml | 2 +- .github/workflows/VerifyDocs.yml | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ArtifactCleanUp.yml b/.github/workflows/ArtifactCleanUp.yml index 02c72e78..23f0a9e8 100644 --- a/.github/workflows/ArtifactCleanUp.yml +++ b/.github/workflows/ArtifactCleanUp.yml @@ -43,7 +43,7 @@ on: jobs: ArtifactCleanUp: name: 🗑️ Artifact Cleanup - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 🗑️ Delete package Artifacts diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index 71187fe8..3a9fa1f0 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -47,7 +47,7 @@ on: jobs: DocCoverage: name: 👀 Check documentation coverage - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 03520272..31069332 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -68,7 +68,7 @@ jobs: Coverage: name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/IntermediateCleanUp.yml b/.github/workflows/IntermediateCleanUp.yml index 04991744..1ba9295f 100644 --- a/.github/workflows/IntermediateCleanUp.yml +++ b/.github/workflows/IntermediateCleanUp.yml @@ -41,7 +41,7 @@ on: jobs: IntermediateCleanUp: name: 🗑️ Intermediate Artifact Cleanup - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 🗑️ Delete SQLite coverage artifacts from matrix jobs uses: geekyeggo/delete-artifact@v5 diff --git a/.github/workflows/LaTeXDocumentation.yml b/.github/workflows/LaTeXDocumentation.yml index 54ca4f0c..a12bc0a3 100644 --- a/.github/workflows/LaTeXDocumentation.yml +++ b/.github/workflows/LaTeXDocumentation.yml @@ -47,7 +47,7 @@ on: jobs: PDFDocumentation: name: 📓 Converting LaTeX Documentation to PDF - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 📥 Download artifacts '${{ inputs.latex_artifact }}' from 'SphinxDocumentation' job uses: actions/download-artifact@v4 diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index 476bd37f..9a60d1aa 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -49,7 +49,7 @@ jobs: Package: name: 📦 Package in Source and Wheel Format - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 393ee551..55bdc1bc 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -101,7 +101,7 @@ on: jobs: Parameters: - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" outputs: python_version: ${{ steps.params.outputs.python_version }} python_jobs: ${{ steps.params.outputs.python_jobs }} diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index 2e550965..5365e469 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -62,7 +62,7 @@ on: jobs: PublishCoverageResults: name: 📊 Publish Code Coverage Results - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" if: always() steps: diff --git a/.github/workflows/PublishOnPyPI.yml b/.github/workflows/PublishOnPyPI.yml index b951463c..637fe007 100644 --- a/.github/workflows/PublishOnPyPI.yml +++ b/.github/workflows/PublishOnPyPI.yml @@ -53,7 +53,7 @@ jobs: PublishOnPyPI: name: 🚀 Publish to PyPI - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index a4e5cd56..e7447d9a 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -49,7 +49,7 @@ on: jobs: PublishTestResults: name: 📊 Publish Test Results - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" if: always() steps: diff --git a/.github/workflows/PublishToGitHubPages.yml b/.github/workflows/PublishToGitHubPages.yml index 9f6ed1bc..6fbf3201 100644 --- a/.github/workflows/PublishToGitHubPages.yml +++ b/.github/workflows/PublishToGitHubPages.yml @@ -49,7 +49,7 @@ jobs: PublishToGitHubPages: name: 📚 Publish to GH-Pages - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index db77a136..bb9c686f 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -29,7 +29,7 @@ jobs: Release: name: 📝 Create 'Release Page' on GitHub - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 🔁 Extract Git tag from GITHUB_REF diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index 3d744088..16bb16b6 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -78,7 +78,7 @@ on: jobs: Prepare: name: 📓 Extract configurations from pyproject.toml - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" outputs: coverage_report_html_directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }} coverage_report_xml_directory: ${{ steps.getVariables.outputs.coverage_report_xml_directory }} @@ -164,7 +164,7 @@ jobs: Sphinx-HTML: name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" needs: - Prepare @@ -219,7 +219,7 @@ jobs: Sphinx-LaTeX: name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" needs: - Prepare diff --git a/.github/workflows/StaticTypeCheck.yml b/.github/workflows/StaticTypeCheck.yml index 82fe2bf6..feb8c69a 100644 --- a/.github/workflows/StaticTypeCheck.yml +++ b/.github/workflows/StaticTypeCheck.yml @@ -68,7 +68,7 @@ jobs: StaticTypeCheck: name: 👀 Check Static Typing using Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/VerifyDocs.yml b/.github/workflows/VerifyDocs.yml index f8163058..9f4ec221 100644 --- a/.github/workflows/VerifyDocs.yml +++ b/.github/workflows/VerifyDocs.yml @@ -40,7 +40,7 @@ jobs: VerifyDocs: name: 👍 Verify example snippets using Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository From ef5c852097d81292d545aaf8660dd1f63d9c1eee Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 09:20:22 +0100 Subject: [PATCH 15/19] Fixed pipeline dependencies. --- .github/workflows/_Checking_Pipeline.yml | 62 ++++++++++++++++-------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index d418fe96..02ee0250 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -9,7 +9,7 @@ jobs: uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx with: name: pyDummy - python_version_list: "3.8 3.9 3.10 3.11 3.12 3.13 pypy-3.8 pypy-3.9 pypy-3.10" + python_version_list: "3.9 3.10 3.11 3.12 3.13 pypy-3.9 pypy-3.10" # disable_list: "windows:pypy-3.10" PlatformTestingParams: @@ -68,6 +68,26 @@ jobs: html_report: 'htmlmypy' html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + DocCoverage: + uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r1 + needs: + - UnitTestingParams + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + directory: sphinx_reports +# fail_below: 70 + + Package: + uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx + needs: + - UnitTestingParams + - UnitTesting +# - Coverage + - PlatformTesting + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} + PublishCoverageResults: uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@sphinx needs: @@ -91,17 +111,6 @@ jobs: with: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' - Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx - needs: - - UnitTestingParams - - UnitTesting -# - Coverage - - PlatformTesting - with: - python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} - # VerifyDocs: # uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@sphinx # needs: @@ -109,10 +118,12 @@ jobs: # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - HTMLDocumentation: + Documentation: uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx needs: - UnitTestingParams + - PublishTestResults + - PublishCoverageResults # - VerifyDocs with: python_version: ${{ needs.UnitTestingParams.outputs.python_version }} @@ -121,11 +132,22 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} + IntermediateCleanUp: + uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@r1 + needs: + - UnitTestingParams + - PublishCoverageResults + - PublishTestResults + - Documentation + with: + sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}- + xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- + PDFDocumentation: uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@sphinx needs: - UnitTestingParams - - HTMLDocumentation + - Documentation with: document: actions latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} @@ -135,7 +157,7 @@ jobs: uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@sphinx needs: - UnitTestingParams - - HTMLDocumentation + - Documentation # - PDFDocumentation # - Coverage - PublishCoverageResults @@ -176,13 +198,15 @@ jobs: - UnitTestingParams - PlatformTestingParams - UnitTesting - - PlatformTesting # - Coverage - StaticTypeCheck -# - BuildTheDocs - - PublishToGitHubPages - - PublishCoverageResults + - PlatformTesting + - Documentation +# - PDFDocumentation - PublishTestResults + - PublishCoverageResults + - PublishToGitHubPages + - IntermediateCleanUp with: package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} remaining: | From 77a6b4c00af6e7145370770cf031267cd128b5e9 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 10:56:43 +0100 Subject: [PATCH 16/19] Use new extract job. --- .github/workflows/BuildTheDocs.yml | 3 + .github/workflows/CoverageCollection.yml | 3 + .github/workflows/ExtractConfiguration.yml | 144 +++++++++++++++++++++ .github/workflows/Parameters.yml | 1 + .github/workflows/SphinxDocumentation.yml | 107 ++------------- .github/workflows/_Checking_Pipeline.yml | 7 + 6 files changed, 166 insertions(+), 99 deletions(-) create mode 100644 .github/workflows/ExtractConfiguration.yml diff --git a/.github/workflows/BuildTheDocs.yml b/.github/workflows/BuildTheDocs.yml index a8d72c1c..a1f9baf4 100644 --- a/.github/workflows/BuildTheDocs.yml +++ b/.github/workflows/BuildTheDocs.yml @@ -37,6 +37,9 @@ jobs: runs-on: ubuntu-24.04 steps: + - name: '❗ Deprecation message' + run: echo "::warning title=Deprecated::'BuildTheDocs.yml' is not maintained anymore. Please switch to 'SphinxDocumentation.yml', 'LaTeXDocumentation.yml' and 'ExtractConfiguration.yml'. " + - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 31069332..cf7e635e 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -71,6 +71,9 @@ jobs: runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: + - name: '❗ Deprecation message' + run: echo "::warning title=Deprecated::'CoverageCollection.yml' is not maintained anymore. Please switch to 'UnitTesting.yml', 'PublishCoverageResults.yml' and 'PublishTestResults.yml'. " + - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/ExtractConfiguration.yml b/.github/workflows/ExtractConfiguration.yml new file mode 100644 index 00000000..5ce99bc6 --- /dev/null +++ b/.github/workflows/ExtractConfiguration.yml @@ -0,0 +1,144 @@ +# ==================================================================================================================== # +# Authors: # +# Patrick Lehmann # +# # +# ==================================================================================================================== # +# Copyright 2020-2024 The pyTooling Authors # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# # +# SPDX-License-Identifier: Apache-2.0 # +# ==================================================================================================================== # +name: Extract Configuration + +on: + workflow_call: + inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string + python_version: + description: 'Python version.' + required: false + default: '3.12' + type: string + coverage_config: + description: 'Path to the .coveragerc file. Use pyproject.toml by default.' + required: false + default: 'pyproject.toml' + type: string + + outputs: + coverage_report_html_directory: + description: "" + value: ${{ jobs.Extract.outputs.coverage_report_html_directory }} + coverage_report_xml_directory: + description: "" + value: ${{ jobs.Extract.outputs.coverage_report_xml_directory }} + coverage_report_xml: + description: "" + value: ${{ jobs.Extract.outputs.coverage_report_xml }} + coverage_report_json_directory: + description: "" + value: ${{ jobs.Extract.outputs.coverage_report_json_directory }} + coverage_report_json: + description: "" + value: ${{ jobs.Extract.outputs.coverage_report_json }} + +jobs: + Extract: + name: 📓 Extract configurations from pyproject.toml + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" + outputs: + coverage_report_html_directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }} + coverage_report_xml_directory: ${{ steps.getVariables.outputs.coverage_report_xml_directory }} + coverage_report_xml: ${{ steps.getVariables.outputs.coverage_report_xml }} + coverage_report_json_directory: ${{ steps.getVariables.outputs.coverage_report_json_directory }} + coverage_report_json: ${{ steps.getVariables.outputs.coverage_report_json }} + + steps: + - name: ⏬ Checkout repository + uses: actions/checkout@v4 + + - name: 🐍 Setup Python ${{ inputs.python_version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python_version }} + + - name: 🔧 Install wheel,tomli and pip dependencies (native) + run: | + python -m pip install --disable-pip-version-check -U wheel tomli + + - name: 🔁 Extract configurations from pyproject.toml + id: getVariables + shell: python + run: | + from os import getenv + from pathlib import Path + from sys import version + from textwrap import dedent + + print(f"Python: {version}") + + from tomli import load as tomli_load + + htmlDirectory = Path("htmlcov") + xmlFile = Path("./coverage.xml") + jsonFile = Path("./coverage.json") + coverageRC = "${{ inputs.coverage_config }}".strip() + + # Read output paths from 'pyproject.toml' file + if coverageRC == "pyproject.toml": + pyProjectFile = Path("pyproject.toml") + if pyProjectFile.exists(): + with pyProjectFile.open("rb") as file: + pyProjectSettings = tomli_load(file) + + htmlDirectory = Path(pyProjectSettings["tool"]["coverage"]["html"]["directory"]) + xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"]) + jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"]) + else: + print(f"File '{pyProjectFile}' not found.") + print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.") + exit(1) + + # Read output paths from '.coveragerc' file + elif len(coverageRC) > 0: + coverageRCFile = Path(coverageRC) + if coverageRCFile.exists(): + with coverageRCFile.open("rb") as file: + coverageRCSettings = tomli_load(file) + + htmlDirectory = Path(coverageRCSettings["html"]["directory"]) + xmlFile = Path(coverageRCSettings["xml"]["output"]) + jsonFile = Path(coverageRCSettings["json"]["output"]) + else: + print(f"File '{coverageRCFile}' not found.") + print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.") + exit(1) + + # Write jobs to special file + github_output = Path(getenv("GITHUB_OUTPUT")) + print(f"GITHUB_OUTPUT: {github_output}") + with github_output.open("a+", encoding="utf-8") as f: + f.write(dedent(f"""\ + coverage_report_html_directory={htmlDirectory.as_posix()} + coverage_report_xml_directory={xmlFile.parent.as_posix()} + coverage_report_xml={xmlFile.as_posix()} + coverage_report_json_directory={jsonFile.parent.as_posix()} + coverage_report_json={jsonFile.as_posix()} + """)) + + print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}") diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 55bdc1bc..c6d03fc6 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -101,6 +101,7 @@ on: jobs: Parameters: + name: ✎ Generate pipeline parameters runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" outputs: python_version: ${{ steps.params.outputs.python_version }} diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index 16bb16b6..ed10ac22 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -39,16 +39,15 @@ on: required: false default: '-r doc/requirements.txt' type: string - coverage_config: - description: 'Path to the .coveragerc file. Use pyproject.toml by default.' - required: false - default: 'pyproject.toml' - type: string doc_directory: description: 'Path to the directory containing documentation (Sphinx working directory).' required: false default: 'doc' type: string + coverage_report_json_directory: + description: '' + required: true + type: string coverage_json_artifact: description: 'Name of the coverage JSON artifact.' required: false @@ -76,97 +75,9 @@ on: type: string jobs: - Prepare: - name: 📓 Extract configurations from pyproject.toml - runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" - outputs: - coverage_report_html_directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }} - coverage_report_xml_directory: ${{ steps.getVariables.outputs.coverage_report_xml_directory }} - coverage_report_xml: ${{ steps.getVariables.outputs.coverage_report_xml }} - coverage_report_json_directory: ${{ steps.getVariables.outputs.coverage_report_json_directory }} - coverage_report_json: ${{ steps.getVariables.outputs.coverage_report_json }} - - steps: - - name: ⏬ Checkout repository - uses: actions/checkout@v4 - - - name: 🐍 Setup Python ${{ inputs.python_version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python_version }} - - - name: 🔧 Install wheel,tomli and pip dependencies (native) - run: | - python -m pip install --disable-pip-version-check -U wheel tomli - python -m pip install --disable-pip-version-check ${{ inputs.requirements }} - - - name: 🔁 Extract configurations from pyproject.toml - id: getVariables - shell: python - run: | - from os import getenv - from pathlib import Path - from sys import version - from textwrap import dedent - - print(f"Python: {version}") - - from tomli import load as tomli_load - - htmlDirectory = Path("htmlcov") - xmlFile = Path("./coverage.xml") - jsonFile = Path("./coverage.json") - coverageRC = "${{ inputs.coverage_config }}".strip() - - # Read output paths from 'pyproject.toml' file - if coverageRC == "pyproject.toml": - pyProjectFile = Path("pyproject.toml") - if pyProjectFile.exists(): - with pyProjectFile.open("rb") as file: - pyProjectSettings = tomli_load(file) - - htmlDirectory = Path(pyProjectSettings["tool"]["coverage"]["html"]["directory"]) - xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"]) - jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"]) - else: - print(f"File '{pyProjectFile}' not found.") - print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.") - exit(1) - - # Read output paths from '.coveragerc' file - elif len(coverageRC) > 0: - coverageRCFile = Path(coverageRC) - if coverageRCFile.exists(): - with coverageRCFile.open("rb") as file: - coverageRCSettings = tomli_load(file) - - htmlDirectory = Path(coverageRCSettings["html"]["directory"]) - xmlFile = Path(coverageRCSettings["xml"]["output"]) - jsonFile = Path(coverageRCSettings["json"]["output"]) - else: - print(f"File '{coverageRCFile}' not found.") - print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.") - exit(1) - - # Write jobs to special file - github_output = Path(getenv("GITHUB_OUTPUT")) - print(f"GITHUB_OUTPUT: {github_output}") - with github_output.open("a+", encoding="utf-8") as f: - f.write(dedent(f"""\ - coverage_report_html_directory={htmlDirectory.as_posix()} - coverage_report_xml_directory={xmlFile.parent.as_posix()} - coverage_report_xml={xmlFile.as_posix()} - coverage_report_json_directory={jsonFile.parent.as_posix()} - coverage_report_json={jsonFile.as_posix()} - """)) - - print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}") - Sphinx-HTML: - name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + name: 📓 HTML Documentation using Sphinx and Python ${{ inputs.python_version }} runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" - needs: - - Prepare steps: - name: ⏬ Checkout repository @@ -197,7 +108,7 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ inputs.coverage_json_artifact }} - path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} + path: ${{ inputs.coverage_report_json_directory }} - name: ☑ Generate HTML documentation if: inputs.html_artifact != '' @@ -218,10 +129,8 @@ jobs: retention-days: 1 Sphinx-LaTeX: - name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + name: 📓 LaTeX Documentation using Sphinx and Python ${{ inputs.python_version }} runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" - needs: - - Prepare steps: - name: ⏬ Checkout repository @@ -252,7 +161,7 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ inputs.coverage_json_artifact }} - path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} + path: ${{ inputs.coverage_report_json_directory }} - name: ☑ Generate LaTeX documentation if: inputs.latex_artifact != '' diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 02ee0250..f6f40b0b 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -77,6 +77,11 @@ jobs: directory: sphinx_reports # fail_below: 70 + ConfigParams: + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@sphinx + needs: + - DocCoverage + Package: uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx needs: @@ -122,11 +127,13 @@ jobs: uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx needs: - UnitTestingParams + - ConfigParams - PublishTestResults - PublishCoverageResults # - VerifyDocs with: python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }} # unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} # coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} From f737b0799206aa3a9bc1f463862b9f124922de41 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 13:52:23 +0100 Subject: [PATCH 17/19] Prepare for merge. [skip ci] --- .github/workflows/BuildTheDocs.yml | 2 +- .github/workflows/CoverageCollection.yml | 2 +- .github/workflows/Release.yml | 7 ++++- .github/workflows/_Checking_Pipeline.yml | 34 ++++++++++++------------ 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/BuildTheDocs.yml b/.github/workflows/BuildTheDocs.yml index a1f9baf4..44152e13 100644 --- a/.github/workflows/BuildTheDocs.yml +++ b/.github/workflows/BuildTheDocs.yml @@ -38,7 +38,7 @@ jobs: steps: - name: '❗ Deprecation message' - run: echo "::warning title=Deprecated::'BuildTheDocs.yml' is not maintained anymore. Please switch to 'SphinxDocumentation.yml', 'LaTeXDocumentation.yml' and 'ExtractConfiguration.yml'. " + run: echo "::warning title=Deprecated::'BuildTheDocs.yml' is not maintained anymore. Please switch to 'SphinxDocumentation.yml', 'LaTeXDocumentation.yml' and 'ExtractConfiguration.yml'." - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index cf7e635e..f7dab102 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -72,7 +72,7 @@ jobs: steps: - name: '❗ Deprecation message' - run: echo "::warning title=Deprecated::'CoverageCollection.yml' is not maintained anymore. Please switch to 'UnitTesting.yml', 'PublishCoverageResults.yml' and 'PublishTestResults.yml'. " + run: echo "::warning title=Deprecated::'CoverageCollection.yml' is not maintained anymore. Please switch to 'UnitTesting.yml', 'PublishCoverageResults.yml' and 'PublishTestResults.yml'." - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index bb9c686f..96f7c678 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -24,9 +24,14 @@ name: Release on: workflow_call: + inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string jobs: - Release: name: 📝 Create 'Release Page' on GitHub runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index f6f40b0b..e652bef3 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -6,21 +6,21 @@ on: jobs: UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: pyDummy python_version_list: "3.9 3.10 3.11 3.12 3.13 pypy-3.9 pypy-3.10" # disable_list: "windows:pypy-3.10" PlatformTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Platform python_version_list: "" system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64" UnitTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev needs: - UnitTestingParams with: @@ -33,7 +33,7 @@ jobs: # coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} PlatformTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev needs: - PlatformTestingParams with: @@ -48,7 +48,7 @@ jobs: coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }} # Coverage: -# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@sphinx +# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@dev # needs: # - UnitTestingParams # with: @@ -58,7 +58,7 @@ jobs: # codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@sphinx + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev needs: - UnitTestingParams with: @@ -78,12 +78,12 @@ jobs: # fail_below: 70 ConfigParams: - uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@sphinx + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev needs: - DocCoverage Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Package.yml@dev needs: - UnitTestingParams - UnitTesting @@ -94,7 +94,7 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev needs: - UnitTestingParams - UnitTesting @@ -109,7 +109,7 @@ jobs: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev needs: - UnitTesting - PlatformTesting @@ -117,14 +117,14 @@ jobs: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@sphinx +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} Documentation: - uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev needs: - UnitTestingParams - ConfigParams @@ -151,7 +151,7 @@ jobs: xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- PDFDocumentation: - uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@sphinx + uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev needs: - UnitTestingParams - Documentation @@ -161,7 +161,7 @@ jobs: pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev needs: - UnitTestingParams - Documentation @@ -175,7 +175,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Release.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - UnitTesting @@ -186,7 +186,7 @@ jobs: - PublishToGitHubPages PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - UnitTestingParams @@ -200,7 +200,7 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@sphinx + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev needs: - UnitTestingParams - PlatformTestingParams From 87978fd1f6e17ff387c73f5836d3c06bc1e467cc Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 4 Nov 2024 07:26:23 +0100 Subject: [PATCH 18/19] Added a full pipeline flow for a namespace package. --- .../workflows/Pipeline-NamespacePackage.yml | 284 ++++++++++++++++++ doc/requirements.txt | 1 + 2 files changed, 285 insertions(+) create mode 100644 .github/workflows/Pipeline-NamespacePackage.yml diff --git a/.github/workflows/Pipeline-NamespacePackage.yml b/.github/workflows/Pipeline-NamespacePackage.yml new file mode 100644 index 00000000..e6e24d4c --- /dev/null +++ b/.github/workflows/Pipeline-NamespacePackage.yml @@ -0,0 +1,284 @@ +name: Namespace Package + +on: + workflow_call: + inputs: + package_namespace: + description: 'Name of the tool.' + required: true + type: string + package_name: + description: 'Name of the tool.' + required: true + type: string + unittest_python_version: + description: 'Python version.' + required: false + default: '3.13' + type: string + unittest_python_version_list: + description: 'Space separated list of Python versions to run tests with.' + required: false + default: '3.9 3.10 3.11 3.12 3.13' + type: string + unittest_system_list: + description: 'Space separated list of systems to run tests on.' + required: false + default: 'ubuntu windows macos macos-arm mingw64 ucrt64' + type: string + unittest_include_list: + description: 'Space separated list of system:python items to be included into the list of test.' + required: false + default: '' + type: string + unittest_exclude_list: + description: 'Space separated list of system:python items to be excluded from the list of test.' + required: false + default: '' + type: string + unittest_disable_list: + description: 'Space separated list of system:python items to be disabled from the list of test.' + required: false + default: '' + type: string + apptest_python_version: + description: 'Python version.' + required: false + default: '3.13' + type: string + apptest_python_version_list: + description: 'Space separated list of Python versions to run tests with.' + required: false + default: "" + type: string + apptest_system_list: + description: 'Space separated list of systems to run tests on.' + required: false + default: 'ubuntu windows macos macos-arm ucrt64' + type: string + apptest_include_list: + description: 'Space separated list of system:python items to be included into the list of test.' + required: false + default: '' + type: string + apptest_exclude_list: + description: 'Space separated list of system:python items to be excluded from the list of test.' + required: false + default: '' + type: string + apptest_disable_list: + description: 'Space separated list of system:python items to be disabled from the list of test.' + required: false + default: '' + type: string + +jobs: + UnitTestingParams: + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev + with: + name: "${{ inputs.package_namespace }}.${{ inputs.package_name }}" + python_version: ${{ inputs.unittest_python_version }} + python_version_list: ${{ inputs.unittest_python_version_list }} + system_list: ${{ inputs.unittest_system_list }} + include_list: ${{ inputs.unittest_include_list }} + exclude_list: ${{ inputs.unittest_exclude_list }} + disable_list: ${{ inputs.unittest_disable_list }} + + AppTestingParams: + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev + with: + name: "${{ inputs.package_namespace }}.${{ inputs.package_name }}" + python_version: ${{ inputs.apptest_python_version }} + python_version_list: ${{ inputs.apptest_python_version_list }} + system_list: ${{ inputs.apptest_system_list }} + include_list: ${{ inputs.apptest_include_list }} + exclude_list: ${{ inputs.apptest_exclude_list }} + disable_list: ${{ inputs.apptest_disable_list }} + + UnitTesting: + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev + needs: + - UnitTestingParams + with: + jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }} + requirements: "-r tests/unit/requirements.txt" +# pacboy: "msys/git python-lxml:p" + unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} + coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} + + StaticTypeCheck: + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev + needs: + - UnitTestingParams + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + commands: | + touch ${{ inputs.package_namespace }}/__init__.py + mypy --html-report htmlmypy -p ${{ inputs.package_namespace }}.${{ inputs.name }} + html_report: 'htmlmypy' + html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + + DocCoverage: + uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev + needs: + - UnitTestingParams + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + directory: ${{ inputs.package_namespace }}/${{ inputs.package_name }} +# fail_below: 70 + + ConfigParams: + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev + needs: + - DocCoverage + + Package: + uses: pyTooling/Actions/.github/workflows/Package.yml@dev + needs: + - UnitTestingParams + - UnitTesting + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} + +# AppTesting: +# uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@dev +# needs: +# - AppTestingParams +# - UnitTestingParams +# - Package +# with: +# jobs: ${{ needs.AppTestingParams.outputs.python_jobs }} +# wheel: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} +# apptest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }} + + PublishCoverageResults: + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev + needs: + - UnitTestingParams + - UnitTesting + with: +# coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} +# coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }} + coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} + coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} + secrets: + codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} + + PublishTestResults: + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev + needs: + - UnitTestingParams + - UnitTesting + with: + merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} + +# VerifyDocs: +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev +# needs: +# - UnitTestingParams +# with: +# python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + + Documentation: + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev + needs: + - UnitTestingParams + - ConfigParams + - PublishTestResults + - PublishCoverageResults +# - VerifyDocs + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }} + unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-ubuntu-native-3.12 + coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} + html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} + + IntermediateCleanUp: + uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev + needs: + - UnitTestingParams + - PublishCoverageResults + - PublishTestResults + - Documentation + with: + sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}- + xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- + +# PDFDocumentation: +# uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev +# needs: +# - UnitTestingParams +# - Documentation +# with: +# document: pyEDAA.ProjectModel +# latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} +# pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} + + PublishToGitHubPages: + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev + needs: + - UnitTestingParams + - Documentation +# - PDFDocumentation + - PublishCoverageResults + - StaticTypeCheck + with: + doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} + typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + + ReleasePage: + uses: pyTooling/Actions/.github/workflows/Release.yml@dev + if: startsWith(github.ref, 'refs/tags') + needs: + - Package +# - AppTesting + - PublishToGitHubPages + + PublishOnPyPI: + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev + if: startsWith(github.ref, 'refs/tags') + needs: + - UnitTestingParams + - ReleasePage + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + requirements: -r dist/requirements.txt + artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + + ArtifactCleanUp: + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev + needs: + - UnitTestingParams + - UnitTesting + - StaticTypeCheck + - Documentation +# - PDFDocumentation + - PublishTestResults + - PublishCoverageResults + - PublishToGitHubPages +# - PublishOnPyPI + - IntermediateCleanUp + with: + package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} + remaining: | + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} +# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }}-* +# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} diff --git a/doc/requirements.txt b/doc/requirements.txt index da3f29a3..a5c9dcdc 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -5,6 +5,7 @@ pyTooling ~= 7.0 # Enforce latest version on ReadTheDocs sphinx ~= 8.1 docutils ~= 0.21 +docutils_stubs ~= 0.0.22 # ReadTheDocs Theme sphinx_rtd_theme ~= 3.0 From df0889b86b5385fdbc678ac6a9fba1325480deb5 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 10 Nov 2024 11:04:46 +0100 Subject: [PATCH 19/19] Bumped dependencies. --- dist/requirements.txt | 2 +- doc/requirements.txt | 2 +- pyproject.toml | 4 ++-- requirements.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/requirements.txt b/dist/requirements.txt index 878e3e51..918a0be9 100644 --- a/dist/requirements.txt +++ b/dist/requirements.txt @@ -1,2 +1,2 @@ -wheel ~= 0.44 +wheel ~= 0.45 twine ~= 5.1 diff --git a/doc/requirements.txt b/doc/requirements.txt index a5c9dcdc..51a65c93 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ -r ../requirements.txt -pyTooling ~= 7.0 +pyTooling ~= 8.0 # Enforce latest version on ReadTheDocs sphinx ~= 8.1 diff --git a/pyproject.toml b/pyproject.toml index 4ad49512..1132ea2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ "setuptools ~= 75.3", - "wheel ~= 0.44", - "pyTooling ~= 7.0" + "wheel ~= 0.45", + "pyTooling ~= 8.0" ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index ce027dff..4db35494 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyTooling ~= 7.0 +pyTooling ~= 8.0