From 4406abe78831a53d8c0af61a803dcd88e398723c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 25 Apr 2024 07:20:29 +0200 Subject: [PATCH 01/42] Merge unit test results using pyEDAA.Reports. --- .github/workflows/Parameters.yml | 2 +- .github/workflows/PublishTestResults.yml | 22 ++++++---------------- .github/workflows/_Checking_Pipeline.yml | 2 +- dist/requirements.txt | 2 ++ 4 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 dist/requirements.txt diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 620b7063..cc997fd7 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -138,7 +138,7 @@ jobs: if currentAlphaVersion in versions: print(f"::notice title=Experimental::Python {currentAlphaVersion} ({currentAlphaRelease}) is a pre-release.") for disable in disabled: - print(f"::warning title=Disabled Python Job::System '{disable}' temporary disabled.") + print(f"::warning title=Disabled Python Job::System '{disable}' temporarily disabled.") # see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json data = { diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index fd9391ad..3fca84ce 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -48,7 +48,7 @@ jobs: - name: 🔧 Install junitparser run: | - python -m pip install --disable-pip-version-check -U junitparser + python -m pip install --disable-pip-version-check -U pyEDAA.Reports - name: Move JUnit files and collect them all to junit/ run: | @@ -57,26 +57,16 @@ jobs: tree -a junit - name: 🔁 Merge JUnit Unit Test Summaries - shell: python run: | - from pathlib import Path - from junitparser import JUnitXml - - junitDirectory = Path("junit") - junitXml = None - for file in junitDirectory.iterdir(): - if junitXml is None: - junitXml = JUnitXml.fromfile(file) - else: - junitXml += JUnitXml.fromfile(file) - - junitXml.write(junitDirectory / "merged.xml") + pyedaa-reports merge-unittest -v --junit "junit/*.xml" + echo "cat Unittesting.xml" + cat Unittesting.xml - name: 📊 Publish Unit Test Results uses: dorny/test-reporter@v1 with: name: Unit Test Results - path: junit/merged.xml + path: Unittesting.xml reporter: java-junit - name: 📤 Upload merged 'JUnit Test Summary' artifact @@ -84,6 +74,6 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ inputs.merged_junit_artifact }} - path: junit/merged.xml + path: Unittesting.xml if-no-files-found: error retention-days: 1 diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 77b21797..0edbc170 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -84,7 +84,7 @@ jobs: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r1 + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev needs: - UnitTesting - PlatformTesting diff --git a/dist/requirements.txt b/dist/requirements.txt new file mode 100644 index 00000000..5be2dd07 --- /dev/null +++ b/dist/requirements.txt @@ -0,0 +1,2 @@ +wheel ~= 0.43 +twine ~= 5.0 From 6d84311338a12b0e268765741e97a792d90ea85f Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 25 Apr 2024 22:09:29 +0200 Subject: [PATCH 02/42] Revert "Also handle pypy versions." This reverts commit be27e58d8ceb391c00df28098a3b1364b8d03aac. --- .github/workflows/Parameters.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index cc997fd7..1692e60b 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -158,9 +158,9 @@ jobs: }, # Runner systems (runner images) supported by GitHub Actions "sys": { - "ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)", "minPy": (3, 7)}, - "windows": { "icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)", "minPy": (3, 7)}, - "macos": { "icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)", "minPy": (3, 10)}, + "ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)", "minPy": [3, 7]}, + "windows": { "icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)", "minPy": [3, 7]}, + "macos": { "icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)", "minPy": [3, 10]}, }, # Runtimes provided by MSYS2 "runtime": { @@ -183,17 +183,13 @@ jobs: for disable in disabled: print(f"- {disable}") - def toVersion(value): - major, minor = value.split(".") - return int(major[-1]), int(minor) - combinations = [ (system, version) for system in systems if system in data["sys"] for version in versions if version in data["python"] - and toVersion(version) >= data["sys"][system]["minPy"] + and [int(i) for i in version.split(".")] >= data["sys"][system]["minPy"] and f"{system}:{version}" not in excludes and f"{system}:{version}" not in disabled ] + [ @@ -207,7 +203,7 @@ jobs: for system, version in includes if system in data["sys"] and version in data["python"] - and toVersion(version) >= data["sys"][system]["minPy"] + and [int(i) for i in version.split(".")] >= data["sys"][system]["minPy"] and f"{system}:{version}" not in disabled ] print(f"Combinations ({len(combinations)}):") From 0db182165844a9308ec58440252be2a5dcdfd17e Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 25 Apr 2024 22:09:59 +0200 Subject: [PATCH 03/42] Revert "Added a minimum Python version field, so unsupported Python versions (e.g. for macOS) can be disabled." This reverts commit 461931099aa5cb99e2ed18deb885f1eddafa473b. --- .github/workflows/Parameters.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 1692e60b..5b7c29e7 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -158,9 +158,9 @@ jobs: }, # Runner systems (runner images) supported by GitHub Actions "sys": { - "ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)", "minPy": [3, 7]}, - "windows": { "icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)", "minPy": [3, 7]}, - "macos": { "icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)", "minPy": [3, 10]}, + "ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)" }, + "windows": { "icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)" }, + "macos": { "icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)" }, }, # Runtimes provided by MSYS2 "runtime": { @@ -189,7 +189,6 @@ jobs: if system in data["sys"] for version in versions if version in data["python"] - and [int(i) for i in version.split(".")] >= data["sys"][system]["minPy"] and f"{system}:{version}" not in excludes and f"{system}:{version}" not in disabled ] + [ @@ -203,7 +202,6 @@ jobs: for system, version in includes if system in data["sys"] and version in data["python"] - and [int(i) for i in version.split(".")] >= data["sys"][system]["minPy"] and f"{system}:{version}" not in disabled ] print(f"Combinations ({len(combinations)}):") From 6b4af68fa4cc687966a2bcdc3d000ed28a54dc4a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 5 May 2024 20:27:37 +0200 Subject: [PATCH 04/42] Bumped dependencies. --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 285ff1a2..d7bdbde9 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,7 +4,7 @@ Coverage ~= 7.5 # Test Runner -pytest ~= 8.1 +pytest ~= 8.2 pytest-cov ~= 5.0 # Static Type Checking From 8b7a8009a65b7166c79117efff848ea4a8dc516e Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 5 May 2024 23:28:13 +0200 Subject: [PATCH 05/42] Cleanup pytest results. --- .github/workflows/PublishTestResults.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 3fca84ce..0ec5931d 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -58,7 +58,7 @@ jobs: - name: 🔁 Merge JUnit Unit Test Summaries run: | - pyedaa-reports merge-unittest -v --junit "junit/*.xml" + pyedaa-reports merge-unittest -d --pytest "pytest.tests.unit;pytest.tests.platform;pytest.tests.benchmark;pytest.tests.performance" --junit "junit/*.xml" echo "cat Unittesting.xml" cat Unittesting.xml From df4815f666ccacb015a035797224ec36891d219b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 6 May 2024 07:04:41 +0200 Subject: [PATCH 06/42] Added pytest_cleanup variable. --- .github/workflows/PublishTestResults.yml | 7 ++++++- .github/workflows/_Checking_Pipeline.yml | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 0ec5931d..43269ccc 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -30,6 +30,11 @@ on: required: false default: '' type: string + additional_merge_args: + description: 'Additional merging arguments.' + required: false + default: '--pytest "pytest.tests.unit"' + type: string jobs: PublishTestResults: @@ -58,7 +63,7 @@ jobs: - name: 🔁 Merge JUnit Unit Test Summaries run: | - pyedaa-reports merge-unittest -d --pytest "pytest.tests.unit;pytest.tests.platform;pytest.tests.benchmark;pytest.tests.performance" --junit "junit/*.xml" + pyedaa-reports merge-unittest ${{ inputs.additional_merge_args }} --junit "junit/*.xml" echo "cat Unittesting.xml" cat Unittesting.xml diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 0edbc170..0d0c62d4 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -88,6 +88,8 @@ jobs: needs: - UnitTesting - PlatformTesting + with: + additional_merge_args: '-d --pytest "pytest.tests.unit;pytest.tests.platform;pytest.tests.benchmark;pytest.tests.performance"' Package: uses: pyTooling/Actions/.github/workflows/Package.yml@r1 From ae13aa2dfff15db565ec0aaf469d765404c94fb4 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 4 Jun 2024 00:27:55 +0200 Subject: [PATCH 07/42] Updated usage of pyedaa-reports. --- .github/workflows/PublishTestResults.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 43269ccc..f305cf17 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -33,7 +33,7 @@ on: additional_merge_args: description: 'Additional merging arguments.' required: false - default: '--pytest "pytest.tests.unit"' + default: '"--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit"' type: string jobs: @@ -63,7 +63,7 @@ jobs: - name: 🔁 Merge JUnit Unit Test Summaries run: | - pyedaa-reports merge-unittest ${{ inputs.additional_merge_args }} --junit "junit/*.xml" + pyedaa-reports -v unittest "--merge=pytest-junit:junit/*.xml" ${{ inputs.additional_merge_args }} "--output=ant-junit:Unittesting.xml" echo "cat Unittesting.xml" cat Unittesting.xml From d4afc820ab50f3620faf1581c24479e3d28e959f Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 16 Jun 2024 23:35:06 +0200 Subject: [PATCH 08/42] Adjusted filter expression in find for PublishTestResults. --- .github/workflows/ApplicationTesting.yml | 4 ++-- .github/workflows/PublishTestResults.yml | 2 +- .github/workflows/UnitTesting.yml | 4 ++-- .github/workflows/VerifyDocs.yml | 2 +- doc/requirements.txt | 2 +- pyproject.toml | 4 ++-- requirements.txt | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ApplicationTesting.yml b/.github/workflows/ApplicationTesting.yml index c327cb99..eab42c74 100644 --- a/.github/workflows/ApplicationTesting.yml +++ b/.github/workflows/ApplicationTesting.yml @@ -215,7 +215,7 @@ jobs: ls -l install python -m pip install --disable-pip-version-check -U install/*.whl - - name: ☑ Run application tests (Ubuntu/macOS) + - name: ✅ Run application tests (Ubuntu/macOS) if: matrix.system != 'windows' run: | export ENVIRONMENT_NAME="${{ matrix.envname }}" @@ -230,7 +230,7 @@ jobs: python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }} fi - - name: ☑ Run application tests (Windows) + - name: ✅ Run application tests (Windows) if: matrix.system == 'windows' run: | $env:ENVIRONMENT_NAME = "${{ matrix.envname }}" diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index f305cf17..5e3c2a15 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -58,7 +58,7 @@ jobs: - name: Move JUnit files and collect them all to junit/ run: | mkdir -p junit - find . -type f -path "*artifacts*UnitTestReportSummary*.xml" -exec sh -c 'cp -v $0 "junit/$(basename $(dirname $0)).$(basename $0)"' {} ';' + find . -type f -path "*artifacts*TestReportSummary-XML*.xml" -exec sh -c 'cp -v $0 "junit/$(basename $(dirname $0)).$(basename $0)"' {} ';' tree -a junit - name: 🔁 Merge JUnit Unit Test Summaries diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index f51b8cfd..8228b9bd 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -294,7 +294,7 @@ jobs: print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}") - - name: ☑ Run unit tests (Ubuntu/macOS) + - name: ✅ Run unit tests (Ubuntu/macOS) if: matrix.system != 'windows' run: | export ENVIRONMENT_NAME="${{ matrix.envname }}" @@ -310,7 +310,7 @@ jobs: python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }} fi - - name: ☑ Run unit tests (Windows) + - name: ✅ Run unit tests (Windows) if: matrix.system == 'windows' run: | $env:ENVIRONMENT_NAME = "${{ matrix.envname }}" diff --git a/.github/workflows/VerifyDocs.yml b/.github/workflows/VerifyDocs.yml index 5866d847..4b8d772f 100644 --- a/.github/workflows/VerifyDocs.yml +++ b/.github/workflows/VerifyDocs.yml @@ -72,7 +72,7 @@ jobs: - name: Print example.py run: cat tests/docs/example.py - - name: ☑ Run example snippet + - name: ✅ Run example snippet working-directory: tests/docs run: | python3 example.py diff --git a/doc/requirements.txt b/doc/requirements.txt index f7920004..6f7cb1f3 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ -r ../requirements.txt -pyTooling ~= 6.1 +pyTooling ~= 6.3 # Enforce latest version on ReadTheDocs sphinx ~= 7.3 diff --git a/pyproject.toml b/pyproject.toml index 52b2f0fb..6ba59924 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools ~= 69.5", + "setuptools ~= 70.0", "wheel ~= 0.40.0", - "pyTooling ~= 6.1" + "pyTooling ~= 6.3" ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 963d44c9..2c08940a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyTooling ~= 6.1 +pyTooling ~= 6.3 From dfc922152925367bfe0e049f07db7fb3a379281e Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 18 Jun 2024 01:04:31 +0200 Subject: [PATCH 09/42] Also upload unit test results in case of errors. --- .github/workflows/UnitTesting.yml | 4 ++++ dist/requirements.txt | 2 +- tests/requirements.txt | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 8228b9bd..887519fe 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -328,20 +328,24 @@ jobs: - name: Convert coverage to XML format (Cobertura) if: inputs.coverage_xml_artifact != '' + continue-on-error: true run: coverage xml --data-file=.coverage - name: Convert coverage to JSON format if: inputs.coverage_json_artifact != '' + continue-on-error: true run: coverage json --data-file=.coverage - name: Convert coverage to HTML format if: inputs.coverage_html_artifact != '' + continue-on-error: true run: | coverage html --data-file=.coverage -d ${{ steps.getVariables.outputs.coverage_report_html_directory }} rm ${{ steps.getVariables.outputs.coverage_report_html_directory }}/.gitignore - name: 📤 Upload 'TestReportSummary.xml' artifact if: inputs.unittest_xml_artifact != '' + continue-on-error: true uses: actions/upload-artifact@v4 with: name: ${{ inputs.unittest_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }} diff --git a/dist/requirements.txt b/dist/requirements.txt index 5be2dd07..71950fcd 100644 --- a/dist/requirements.txt +++ b/dist/requirements.txt @@ -1,2 +1,2 @@ wheel ~= 0.43 -twine ~= 5.0 +twine ~= 5.1 diff --git a/tests/requirements.txt b/tests/requirements.txt index d7bdbde9..49289374 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -9,5 +9,5 @@ pytest-cov ~= 5.0 # Static Type Checking mypy ~= 1.10 -typing_extensions ~= 4.11 +typing_extensions ~= 4.12 lxml ~= 5.1 From 607637b278469965a6bdc94aaab6ad6ff485ce34 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 18 Jun 2024 22:32:27 +0200 Subject: [PATCH 10/42] Limit interrogate to a directory. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ba59924..25e31b6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "setuptools ~= 70.0", - "wheel ~= 0.40.0", + "wheel ~= 0.43", "pyTooling ~= 6.3" ] build-backend = "setuptools.build_meta" From 92ce8343034eb183297e9e5aa6c85306aac3ae93 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 19 Jun 2024 00:09:27 +0200 Subject: [PATCH 11/42] Added input parameter 'fail_under' for CheckDocumentation. --- .github/workflows/CheckDocumentation.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index c092b5cb..a2a11b07 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -33,11 +33,11 @@ on: description: 'Source code directory to check.' required: true type: string -# fail_below: -# description: 'Minimum required documentation coverage level' -# required: false -# default: 75 -# type: string + fail_under: + description: 'Minimum required documentation coverage level' + required: false + default: 80 + type: string jobs: DocCoverage: @@ -59,9 +59,9 @@ jobs: - name: Run 'interrogate' Documentation Coverage Check continue-on-error: true run: | - interrogate -c pyproject.toml + interrogate -c pyproject.toml --fail-under=${{ inputs.fail_under }} - name: Run 'docstr_coverage' Documentation Coverage Check continue-on-error: true run: | - docstr_coverage -v ${{ inputs.directory }} + docstr-coverage -v 2 --fail-under=${{ inputs.fail_under }} ${{ inputs.directory }} From 0fef6f8a4d732cd733f0af2b08de419f80b87761 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 24 Jul 2024 06:56:22 +0200 Subject: [PATCH 12/42] Bumped dependencies. --- doc/conf.py | 6 +++--- doc/index.rst | 5 +++++ doc/requirements.txt | 6 +++--- pyproject.toml | 4 ++-- requirements.txt | 2 +- tests/requirements.txt | 6 +++--- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 40b56fe7..50f9c225 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -60,10 +60,10 @@ # ============================================================================== # Restructured Text settings # ============================================================================== -prologPath = "prolog.inc" +prologPath = Path("prolog.inc") try: - with open(prologPath, "r") as prologFile: - rst_prolog = prologFile.read() + with prologPath.open("r", encoding="utf-8") as fileHandle: + rst_prolog = fileHandle.read() except Exception as ex: print(f"[ERROR:] While reading '{prologPath}'.") print(ex) diff --git a/doc/index.rst b/doc/index.rst index 87f48040..0de97bd0 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -100,6 +100,9 @@ References - `hdl/containers#48 `__ + +.. _CONTRIBUTORS: + Contributors ************ @@ -108,6 +111,8 @@ Contributors * `and more... `__ +.. _LICENSE: + License ******* diff --git a/doc/requirements.txt b/doc/requirements.txt index 6f7cb1f3..daaff1d0 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,10 +1,10 @@ -r ../requirements.txt -pyTooling ~= 6.3 +pyTooling ~= 6.5 # Enforce latest version on ReadTheDocs -sphinx ~= 7.3 -docutils ~= 0.18.0 +sphinx ~= 7.4 +docutils ~= 0.20 # Sphinx Extenstions #sphinx.ext.coverage diff --git a/pyproject.toml b/pyproject.toml index 25e31b6d..63ef1c4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools ~= 70.0", + "setuptools ~= 71.1", "wheel ~= 0.43", - "pyTooling ~= 6.3" + "pyTooling ~= 6.5" ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 2c08940a..6c78340d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyTooling ~= 6.3 +pyTooling ~= 6.5 diff --git a/tests/requirements.txt b/tests/requirements.txt index 49289374..ea876b3c 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,13 +1,13 @@ -r ../requirements.txt # Coverage collection -Coverage ~= 7.5 +Coverage ~= 7.6 # Test Runner -pytest ~= 8.2 +pytest ~= 8.3 pytest-cov ~= 5.0 # Static Type Checking mypy ~= 1.10 typing_extensions ~= 4.12 -lxml ~= 5.1 +lxml ~= 5.2 From 98f0fffaf6cf49781256873f19d6914ed325c7d8 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 15 May 2024 17:03:49 +0200 Subject: [PATCH 13/42] with-post-step: use Node.js 20 instead of Node.js 16 (cherry picked from commit 0c1e72cfd667c87244d024252561b56facd28171) --- with-post-step/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/with-post-step/action.yml b/with-post-step/action.yml index 3c58f573..69c2a6ef 100644 --- a/with-post-step/action.yml +++ b/with-post-step/action.yml @@ -37,6 +37,6 @@ inputs: default: POST runs: - using: 'node16' + using: 'node20' main: 'main.js' post: 'main.js' From c38ff2af3c978255b2a1608ae3a92b25a8b69bca Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 29 Jul 2024 23:32:45 +0200 Subject: [PATCH 14/42] Added embedded Python code as standalone files for debugging. --- .github/workflows/Parameters.yml | 1 - tests/pacman_packages.py | 87 ++++++++++++++ tests/python_jobs.py | 194 +++++++++++++++++++++++++++++++ 3 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 tests/pacman_packages.py create mode 100644 tests/python_jobs.py diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 5b7c29e7..2df22926 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -91,7 +91,6 @@ jobs: from json import dumps as json_dumps from os import getenv from pathlib import Path - from pprint import pprint from textwrap import dedent name = "${{ inputs.name }}".strip() diff --git a/tests/pacman_packages.py b/tests/pacman_packages.py new file mode 100644 index 00000000..12e30216 --- /dev/null +++ b/tests/pacman_packages.py @@ -0,0 +1,87 @@ +from os import getenv +from pathlib import Path +from re import compile +from sys import version + +print(f"Python: {version}") + + +def loadRequirementsFile(requirementsFile: Path): + requirements = [] + with requirementsFile.open("r") as file: + for line in file.readlines(): + line = line.strip() + if line.startswith("#") or line.startswith("https") or line == "": + continue + elif line.startswith("-r"): + # Remove the first word/argument (-r) + requirements += loadRequirementsFile(requirementsFile.parent / line[2:].lstrip()) + else: + requirements.append(line) + + return requirements + + +requirements = "-r ../tests/requirements.txt" +if requirements.startswith("-r"): + requirementsFile = Path(requirements[2:].lstrip()) + dependencies = loadRequirementsFile(requirementsFile) +else: + dependencies = [req.strip() for req in requirements.split(" ")] + +packages = { + "coverage": "python-coverage:p", + "igraph": "igraph:p", + "jinja2": "python-markupsafe:p", + "lxml": "python-lxml:p", + "numpy": "python-numpy:p", + "markupsafe": "python-markupsafe:p", + "pip": "python-pip: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", +} +subPackages = { + "pytooling": { + "yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", + }, +} + +regExp = compile( + r"(?P[\w_\-\.]+)(?:\[(?P(?:\w+)(?:\s*,\s*\w+)*)\])?(?:\s*(?P[<>~=]+)\s*)(?P\d+(?:\.\d+)*)(?:-(?P\w+))?") + +pacboyPackages = set(("python-pip:p", "python-wheel:p", "python-tomli:p")) +print(f"Processing dependencies ({len(dependencies)}):") +for dependency in dependencies: + print(f" {dependency}") + + match = regExp.match(dependency.lower()) + if not match: + print(f" Wrong format: {dependency}") + print(f"::error title=Identifying Pacboy Packages::Unrecognized dependency format '{dependency}'") + continue + + package = match["PackageName"] + if package in packages: + rewrite = packages[package] + print(f" Found rewrite rule for '{package}': {rewrite}") + pacboyPackages.add(rewrite) + + if match["SubPackages"] and package in subPackages: + for subPackage in match["SubPackages"].split(","): + if subPackage in subPackages[package]: + rewrite = subPackages[package][subPackage] + print(f" Found rewrite rule for '{package}[..., {subPackage}, ...]': {rewrite}") + pacboyPackages.add(rewrite) + +# Write jobs to special file +# github_output = Path(getenv("GITHUB_OUTPUT")) +# print(f"GITHUB_OUTPUT: {github_output}") +# with github_output.open("a+") as f: +# f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n") + +print(f"GITHUB_OUTPUT:") +print(f"pacboy_packages={' '.join(pacboyPackages)}\n") diff --git a/tests/python_jobs.py b/tests/python_jobs.py new file mode 100644 index 00000000..d82d5a37 --- /dev/null +++ b/tests/python_jobs.py @@ -0,0 +1,194 @@ +from json import dumps as json_dumps +from os import getenv +from pathlib import Path +from textwrap import dedent + +name = "example".strip() +python_version = "3.12".strip() +systems = "ubuntu windows macos mingw64 ucrt64".strip() +versions = "3.8 3.9 3.10 3.11 3.12".strip() +include_list = "".strip() +exclude_list = "".strip() +disable_list = "".strip() + +currentMSYS2Version = "3.11" +currentAlphaVersion = "3.13" +currentAlphaRelease = "3.13.0-alpha.1" + +if systems == "": + print("::error title=Parameter::system_list is empty.") +else: + systems = [sys.strip() for sys in systems.split(" ")] + +if versions == "": + versions = [python_version] +else: + versions = [ver.strip() for ver in versions.split(" ")] + +if include_list == "": + includes = [] +else: + includes = [tuple(include.strip().split(":")) for include in include_list.split(" ")] + +if exclude_list == "": + excludes = [] +else: + excludes = [exclude.strip() for exclude in exclude_list.split(" ")] + +if disable_list == "": + disabled = [] +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 "msys2" in systems: + print("::warning title=Deprecated::System 'msys2' will be replaced by 'mingw64'.") +if currentAlphaVersion in versions: + print(f"::notice title=Experimental::Python {currentAlphaVersion} ({currentAlphaRelease}) is a pre-release.") +for disable in disabled: + print(f"::warning title=Disabled Python Job::System '{disable}' temporarily disabled.") + +# see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json +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.12": {"icon": "🟢", "until": "2028.10"}, + # "3.13": { "icon": "🟣", "until": "2028.10" }, + "pypy-3.7": {"icon": "⟲⚫", "until": "????.??"}, + "pypy-3.8": {"icon": "⟲🔴", "until": "????.??"}, + "pypy-3.9": {"icon": "⟲🟠", "until": "????.??"}, + "pypy-3.10": {"icon": "⟲🟡", "until": "????.??"}, + }, + # Runner systems (runner images) supported by GitHub Actions + "sys": { + "ubuntu": {"icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)"}, + "windows": {"icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)"}, + "macos": {"icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)"}, + }, + # Runtimes provided by MSYS2 + "runtime": { + "msys": {"icon": "🪟🟪", "name": "Windows+MSYS2 (x86-64) - MSYS"}, + "mingw32": {"icon": "🪟⬛", "name": "Windows+MSYS2 (x86-64) - MinGW32"}, + "mingw64": {"icon": "🪟🟦", "name": "Windows+MSYS2 (x86-64) - MinGW64"}, + "clang32": {"icon": "🪟🟫", "name": "Windows+MSYS2 (x86-64) - Clang32"}, + "clang64": {"icon": "🪟🟧", "name": "Windows+MSYS2 (x86-64) - Clang64"}, + "ucrt64": {"icon": "🪟🟨", "name": "Windows+MSYS2 (x86-64) - UCRT64"}, + } +} + +print(f"includes ({len(includes)}):") +for system, version in includes: + print(f"- {system}:{version}") +print(f"excludes ({len(excludes)}):") +for exclude in excludes: + print(f"- {exclude}") +print(f"disabled ({len(disabled)}):") +for disable in disabled: + print(f"- {disable}") + +combinations = [ + (system, version) + for system in systems + if system in data["sys"] + for version in versions + if version in data["python"] + and f"{system}:{version}" not in excludes + and f"{system}:{version}" not in disabled + ] + [ + (system, currentMSYS2Version) + for system in systems + if system in data["runtime"] + and f"{system}:{currentMSYS2Version}" not in excludes + and f"{system}:{currentMSYS2Version}" not in disabled + ] + [ + (system, version) + for system, version in includes + if system in data["sys"] + and version in data["python"] + and f"{system}:{version}" not in disabled + ] +print(f"Combinations ({len(combinations)}):") +for system, version in combinations: + print(f"- {system}:{version}") + +jobs = [ + { + "sysicon": data["sys"][system]["icon"], + "system": system, + "runs-on": data["sys"][system]["runs-on"], + "runtime": "native", + "shell": data["sys"][system]["shell"], + "pyicon": data["python"][version]["icon"], + "python": currentAlphaRelease if version == currentAlphaVersion else version, + "envname": data["sys"][system]["name"], + } + for system, version in combinations if system in data["sys"] + ] + [ + { + "sysicon": data["runtime"][runtime]["icon"], + "system": "msys2", + "runs-on": "windows-latest", + "runtime": runtime.upper(), + "shell": "msys2 {0}", + "pyicon": data["python"][currentMSYS2Version]["icon"], + "python": version, + "envname": data["runtime"][runtime]["name"], + } + for runtime, version in combinations if runtime not in data["sys"] + ] + +artifact_names = { + "unittesting_xml": f"{name}-UnitTestReportSummary-XML", + "unittesting_html": f"{name}-UnitTestReportSummary-HTML", + "perftesting_xml": f"{name}-PerformanceTestReportSummary-XML", + "benchtesting_xml": f"{name}-BenchmarkTestReportSummary-XML", + "apptesting_xml": f"{name}-ApplicationTestReportSummary-XML", + "codecoverage_sqlite": f"{name}-CodeCoverage-SQLite", + "codecoverage_xml": f"{name}-CodeCoverage-XML", + "codecoverage_json": f"{name}-CodeCoverage-JSON", + "codecoverage_html": f"{name}-CodeCoverage-HTML", + "statictyping_html": f"{name}-StaticTyping-HTML", + "package_all": f"{name}-Packages", + "documentation_html": f"{name}-Documentation-HTML", + "documentation_latex": f"{name}-Documentation-LaTeX", + "documentation_pdf": f"{name}-Documentation-PDF", +} + +# Deprecated structure +params = { + "python_version": python_version, + "artifacts": { + "unittesting": f"{artifact_names['unittesting_xml']}", + "coverage": f"{artifact_names['codecoverage_html']}", + "typing": f"{artifact_names['statictyping_html']}", + "package": f"{artifact_names['package_all']}", + "doc": f"{artifact_names['documentation_html']}", + } +} + +print("Parameters:") +print(f" python_version: {python_version}") +print(f" python_jobs ({len(jobs)}):\n" + + "".join( + [f" {{ " + ", ".join([f"\"{key}\": \"{value}\"" for key, value in job.items()]) + f" }},\n" for job in jobs]) + ) +print(f" artifact_names ({len(artifact_names)}):") +for id, name in artifact_names.items(): + print(f" {id:>20}: {name}") + +# 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"""\ + python_version={python_version} + python_jobs={json_dumps(jobs)} + artifact_names={json_dumps(artifact_names)} + params={json_dumps(params)} +""")) From 5fe793e3fa92a70b6f61958e8bc1ba5828eae8a4 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 30 Jul 2024 00:23:13 +0200 Subject: [PATCH 15/42] Allow installing additional packaged via apt and allow running before scripts for ubuntu and macos. --- .github/workflows/UnitTesting.yml | 50 ++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 887519fe..a3db60fb 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -29,21 +29,36 @@ on: description: 'JSON list with environment fields, telling the system and Python versions to run tests with.' required: true type: string - requirements: - description: 'Python dependencies to be installed through pip.' + apt: + description: 'Ubuntu dependencies to be installed through apt.' required: false - default: '-r tests/requirements.txt' + default: '' type: string pacboy: description: 'MSYS2 dependencies to be installed through pacboy (pacman).' required: false - default: "" + default: '' + type: string + requirements: + description: 'Python dependencies to be installed through pip.' + required: false + default: '-r tests/requirements.txt' type: string mingw_requirements: description: 'Override Python dependencies to be installed through pip on MSYS2 (MINGW64) only.' required: false default: '' type: string + macos_before_script: + description: 'Scripts to execute before pytest on macOS.' + required: false + default: '' + type: string + ubuntu_before_script: + description: 'Scripts to execute before pytest on Ubuntu.' + required: false + default: '' + type: string root_directory: description: 'Working directory for running tests.' required: false @@ -113,6 +128,13 @@ jobs: - name: ⏬ Checkout repository uses: actions/checkout@v4 +# Package Manager steps + - name: 🔧 Install apt dependencies on Ubuntu + if: matrix.system == 'ubuntu' && inputs.apt != '' + run: sudo apt-get install -y --no-install-recommends ${{ inputs.apt }} + +# Compute Dependencies for MSYS2 steps + - name: 🔧 Install dependencies (system Python for Python shell) if: matrix.system == 'msys2' shell: pwsh @@ -206,6 +228,8 @@ jobs: with github_output.open("a+") as f: f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n") +# Python setup + - name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}' if: matrix.system == 'msys2' uses: msys2/setup-msys2@v2 @@ -222,6 +246,8 @@ jobs: with: python-version: ${{ matrix.python }} +# Python Dependency steps + - name: 🔧 Install wheel,tomli and pip dependencies (native) if: matrix.system != 'msys2' run: | @@ -237,6 +263,18 @@ jobs: python -m pip install --disable-pip-version-check ${{ inputs.requirements }} fi +# Before scripts + + - name: 🍎 macOS before scripts + if: matrix.system == 'ubuntu' && inputs.macos_before_script != '' + run: ${{ inputs.macos_before_script }} + + - name: 🐧 Ubuntu before scripts + if: matrix.system == 'ubuntu' && inputs.ubuntu_before_script != '' + run: ${{ inputs.ubuntu_before_script }} + +# Read pyproject.toml + - name: 🔁 Extract configurations from pyproject.toml id: getVariables shell: python @@ -294,6 +332,8 @@ jobs: print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}") +# Run pytests + - name: ✅ Run unit tests (Ubuntu/macOS) if: matrix.system != 'windows' run: | @@ -343,6 +383,8 @@ jobs: coverage html --data-file=.coverage -d ${{ steps.getVariables.outputs.coverage_report_html_directory }} rm ${{ steps.getVariables.outputs.coverage_report_html_directory }}/.gitignore +# Upload artifacts + - name: 📤 Upload 'TestReportSummary.xml' artifact if: inputs.unittest_xml_artifact != '' continue-on-error: true From da3cdbe96a425e8ce0c98544f24573f69995b0ec Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 30 Jul 2024 01:51:11 +0200 Subject: [PATCH 16/42] Allow installing packages using brew. --- .github/workflows/UnitTesting.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index a3db60fb..ebbc0054 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -34,6 +34,11 @@ on: required: false default: '' type: string + brew: + description: 'macOS dependencies to be installed through brew.' + required: false + default: '' + type: string pacboy: description: 'MSYS2 dependencies to be installed through pacboy (pacman).' required: false @@ -129,6 +134,10 @@ jobs: uses: actions/checkout@v4 # Package Manager steps + - name: 🔧 Install homebrew dependencies on macOS + if: matrix.system == 'macos' && inputs.brew != '' + run: brew install ${{ inputs.brew }} + - name: 🔧 Install apt dependencies on Ubuntu if: matrix.system == 'ubuntu' && inputs.apt != '' run: sudo apt-get install -y --no-install-recommends ${{ inputs.apt }} From 13c1a56f92bf785719a30ba95aac843af93c506d Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 30 Jul 2024 02:06:42 +0200 Subject: [PATCH 17/42] Upgrade to Ubuntu 2024.04 as GitHub is stuck with Ubuntu-latest at 2022.04. --- .github/workflows/ArtifactCleanUp.yml | 2 +- .github/workflows/BuildTheDocs.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 | 4 ++-- .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 | 2 +- .github/workflows/StaticTypeCheck.yml | 2 +- .github/workflows/TestReleaser.yml | 6 +++--- .github/workflows/VerifyDocs.yml | 2 +- .github/workflows/_Checking_ArtifactCleanup.yml | 2 +- .github/workflows/_Checking_Parameters.yml | 2 +- doc/Action/Releaser.rst | 4 ++-- doc/Instantiation.rst | 2 +- releaser/README.md | 4 ++-- tests/python_jobs.py | 2 +- 23 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ArtifactCleanUp.yml b/.github/workflows/ArtifactCleanUp.yml index abfb8d93..97929fb3 100644 --- a/.github/workflows/ArtifactCleanUp.yml +++ b/.github/workflows/ArtifactCleanUp.yml @@ -38,7 +38,7 @@ on: jobs: ArtifactCleanUp: name: 🗑️ Artifact Cleanup - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: 🗑️ Delete package Artifacts diff --git a/.github/workflows/BuildTheDocs.yml b/.github/workflows/BuildTheDocs.yml index 44b13ea7..a8d72c1c 100644 --- a/.github/workflows/BuildTheDocs.yml +++ b/.github/workflows/BuildTheDocs.yml @@ -34,7 +34,7 @@ on: jobs: BuildTheDocs: name: 📓 Run BuildTheDocs - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index a2a11b07..aca8af85 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -42,7 +42,7 @@ on: jobs: DocCoverage: name: 👀 Check documentation coverage - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 2922e251..2d0204ff 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -63,7 +63,7 @@ jobs: Coverage: name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/IntermediateCleanUp.yml b/.github/workflows/IntermediateCleanUp.yml index 927a3d32..d087ea6e 100644 --- a/.github/workflows/IntermediateCleanUp.yml +++ b/.github/workflows/IntermediateCleanUp.yml @@ -36,7 +36,7 @@ on: jobs: IntermediateCleanUp: name: 🗑️ Intermediate Artifact Cleanup - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 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 0c4d3757..675ae043 100644 --- a/.github/workflows/LaTeXDocumentation.yml +++ b/.github/workflows/LaTeXDocumentation.yml @@ -42,7 +42,7 @@ on: jobs: PDFDocumentation: name: 📓 Converting LaTeX Documentation to PDF - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 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 5378fbc2..b18ad87a 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -44,7 +44,7 @@ jobs: Package: name: 📦 Package in Source and Wheel Format - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 2df22926..8c6a6ed0 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -76,7 +76,7 @@ on: jobs: Parameters: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: python_version: ${{ steps.params.outputs.python_version }} python_jobs: ${{ steps.params.outputs.python_jobs }} @@ -157,7 +157,7 @@ jobs: }, # Runner systems (runner images) supported by GitHub Actions "sys": { - "ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)" }, + "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", "shell": "bash", "name": "MacOS (x86-64)" }, }, diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index b45c1de5..ae1074a7 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -57,7 +57,7 @@ on: jobs: PublishCoverageResults: name: 📊 Publish Code Coverage Results - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: always() steps: diff --git a/.github/workflows/PublishOnPyPI.yml b/.github/workflows/PublishOnPyPI.yml index 890595c3..f108670f 100644 --- a/.github/workflows/PublishOnPyPI.yml +++ b/.github/workflows/PublishOnPyPI.yml @@ -48,7 +48,7 @@ jobs: PublishOnPyPI: name: 🚀 Publish to PyPI - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 5e3c2a15..38160636 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -39,7 +39,7 @@ on: jobs: PublishTestResults: name: 📊 Publish Test Results - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: always() steps: diff --git a/.github/workflows/PublishToGitHubPages.yml b/.github/workflows/PublishToGitHubPages.yml index 351eb02b..325512bd 100644 --- a/.github/workflows/PublishToGitHubPages.yml +++ b/.github/workflows/PublishToGitHubPages.yml @@ -44,7 +44,7 @@ jobs: PublishToGitHubPages: name: 📚 Publish to GH-Pages - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index cc3d4938..47ac2377 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-latest + runs-on: ubuntu-24.04 steps: - name: 🔁 Extract Git tag from GITHUB_REF diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index 34f9d48e..d196dbf4 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -73,7 +73,7 @@ on: jobs: Sphinx: name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/StaticTypeCheck.yml b/.github/workflows/StaticTypeCheck.yml index eef16f3e..c37d64f2 100644 --- a/.github/workflows/StaticTypeCheck.yml +++ b/.github/workflows/StaticTypeCheck.yml @@ -63,7 +63,7 @@ jobs: StaticTypeCheck: name: 👀 Check Static Typing using Python ${{ inputs.python_version }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/TestReleaser.yml b/.github/workflows/TestReleaser.yml index 5ee5787b..8b7056a8 100644 --- a/.github/workflows/TestReleaser.yml +++ b/.github/workflows/TestReleaser.yml @@ -41,7 +41,7 @@ jobs: Image: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: DOCKER_BUILDKIT: 1 steps: @@ -60,7 +60,7 @@ jobs: Composite: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -120,7 +120,7 @@ jobs: needs: - Image - Composite - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/VerifyDocs.yml b/.github/workflows/VerifyDocs.yml index 4b8d772f..574f9c59 100644 --- a/.github/workflows/VerifyDocs.yml +++ b/.github/workflows/VerifyDocs.yml @@ -35,7 +35,7 @@ jobs: VerifyDocs: name: 👍 Verify example snippets using Python ${{ inputs.python_version }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/_Checking_ArtifactCleanup.yml b/.github/workflows/_Checking_ArtifactCleanup.yml index b1173248..3d001356 100644 --- a/.github/workflows/_Checking_ArtifactCleanup.yml +++ b/.github/workflows/_Checking_ArtifactCleanup.yml @@ -36,7 +36,7 @@ jobs: name: Package generation needs: - Params - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Package creation run: echo "Package" >> package.txt diff --git a/.github/workflows/_Checking_Parameters.yml b/.github/workflows/_Checking_Parameters.yml index 17c339cb..874a0b8f 100644 --- a/.github/workflows/_Checking_Parameters.yml +++ b/.github/workflows/_Checking_Parameters.yml @@ -64,7 +64,7 @@ jobs: - Params_Exclude - Params_Disable - Params_All - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 defaults: run: shell: python diff --git a/doc/Action/Releaser.rst b/doc/Action/Releaser.rst index d91b04fe..c53c99b4 100644 --- a/doc/Action/Releaser.rst +++ b/doc/Action/Releaser.rst @@ -81,7 +81,7 @@ The following block shows a minimal YAML workflow file: jobs: mwe: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: # Clone repository @@ -171,7 +171,7 @@ For prototyping purposes, the following job might be useful: Release: name: '📦 Release' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: - ... if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'>`__) diff --git a/doc/Instantiation.rst b/doc/Instantiation.rst index 254b2d8f..3b18faf0 100644 --- a/doc/Instantiation.rst +++ b/doc/Instantiation.rst @@ -76,7 +76,7 @@ Documentation Only (Sphinx) needs: - BuildTheDocs - PublishToGitHubPages - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: 🗑️ Delete artifacts diff --git a/releaser/README.md b/releaser/README.md index 33a78cca..3d09e670 100644 --- a/releaser/README.md +++ b/releaser/README.md @@ -75,7 +75,7 @@ on: jobs: mwe: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: # Clone repository @@ -156,7 +156,7 @@ For prototyping purposes, the following job might be useful: ```yml Release: name: '📦 Release' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: - ... if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/')) diff --git a/tests/python_jobs.py b/tests/python_jobs.py index d82d5a37..526a7f7d 100644 --- a/tests/python_jobs.py +++ b/tests/python_jobs.py @@ -67,7 +67,7 @@ }, # Runner systems (runner images) supported by GitHub Actions "sys": { - "ubuntu": {"icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)"}, + "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", "shell": "bash", "name": "MacOS (x86-64)"}, }, From f62d5d93eac6fe33154d8d4b09e35d0bac1f371f Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 30 Jul 2024 02:12:23 +0200 Subject: [PATCH 18/42] Fixed typo. --- .github/workflows/UnitTesting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index ebbc0054..a7fdc83b 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -275,7 +275,7 @@ jobs: # Before scripts - name: 🍎 macOS before scripts - if: matrix.system == 'ubuntu' && inputs.macos_before_script != '' + if: matrix.system == 'macos' && inputs.macos_before_script != '' run: ${{ inputs.macos_before_script }} - name: 🐧 Ubuntu before scripts From fa96ee919795af507133f82583b064cc5317ce09 Mon Sep 17 00:00:00 2001 From: Silverlan Date: Tue, 28 May 2024 17:39:29 +0200 Subject: [PATCH 19/42] fix(releaser): fix failure to install PyGithub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the error message: × This environment is externally managed (cherry picked from commit 7879c05ab77d562d3e1430062497fa47fce27028) --- releaser/composite/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releaser/composite/action.yml b/releaser/composite/action.yml index fd8943b7..3b7cc58e 100644 --- a/releaser/composite/action.yml +++ b/releaser/composite/action.yml @@ -45,7 +45,7 @@ runs: steps: - shell: bash - run: pip install --disable-pip-version-check PyGithub --progress-bar off + run: pip install --disable-pip-version-check PyGithub --progress-bar off --break-system-packages - shell: bash run: '''${{ github.action_path }}/../releaser.py''' From b87d11502bedcc1c1e6f06857991b8a0c253fe47 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 30 Jul 2024 10:36:02 +0200 Subject: [PATCH 20/42] Added UCRT64 before scripts. --- .github/workflows/UnitTesting.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index a7fdc83b..9c1754ff 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -64,6 +64,11 @@ on: required: false default: '' type: string + ucrt64_before_scripts: + description: 'Scripts to execute before pytest on Windows within MSYS2 UCRT64.' + required: false + default: '' + type: string root_directory: description: 'Working directory for running tests.' required: false @@ -282,6 +287,10 @@ jobs: if: matrix.system == 'ubuntu' && inputs.ubuntu_before_script != '' run: ${{ inputs.ubuntu_before_script }} + - name: 🐧 UCRT64 before scripts + if: matrix.system == 'msys2' && matrix.runtime == 'UCRT64' && inputs.ucrt64_before_script != '' + run: ${{ inputs.ucrt64_before_script }} + # Read pyproject.toml - name: 🔁 Extract configurations from pyproject.toml From cc1dade947fda00cbca4c972f67a24990d1ca119 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 30 Jul 2024 10:55:05 +0200 Subject: [PATCH 21/42] Added MinGW64 --- .github/workflows/UnitTesting.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 9c1754ff..ff824559 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -64,7 +64,12 @@ on: required: false default: '' type: string - ucrt64_before_scripts: + mingw64_before_script: + description: 'Scripts to execute before pytest on Windows within MSYS2 MinGW64.' + required: false + default: '' + type: string + ucrt64_before_script: description: 'Scripts to execute before pytest on Windows within MSYS2 UCRT64.' required: false default: '' @@ -287,7 +292,13 @@ jobs: if: matrix.system == 'ubuntu' && inputs.ubuntu_before_script != '' run: ${{ inputs.ubuntu_before_script }} - - name: 🐧 UCRT64 before scripts + # Windows before script + + - name: 🪟🟦 MinGW64 before scripts + if: matrix.system == 'msys2' && matrix.runtime == 'MINGW64' && inputs.mingw64_before_script != '' + run: ${{ inputs.mingw64_before_script }} + + - name: 🪟🟨 UCRT64 before scripts if: matrix.system == 'msys2' && matrix.runtime == 'UCRT64' && inputs.ucrt64_before_script != '' run: ${{ inputs.ucrt64_before_script }} From e0af5055a87db3477122c9eb811bf87b781cbf7d Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 31 Jul 2024 00:29:39 +0200 Subject: [PATCH 22/42] Debugging DYLD_LIBRARY_PATH on macOS --- .github/workflows/UnitTesting.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index ff824559..b7effef9 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -368,6 +368,7 @@ jobs: run: | export ENVIRONMENT_NAME="${{ matrix.envname }}" export PYTHONPATH=$(pwd) + export DYLD_LIBRARY_PATH=$(brew --prefix llvm@15)/lib cd "${{ inputs.root_directory || '.' }}" [ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS From 02d386a9e17cb843091e32f7e03bf4637bc9182a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 1 Aug 2024 10:57:44 +0200 Subject: [PATCH 23/42] Workaround for Ubuntu 2024.04 --- .github/workflows/PublishTestResults.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 38160636..9fc3ba73 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -53,7 +53,7 @@ jobs: - name: 🔧 Install junitparser run: | - python -m pip install --disable-pip-version-check -U pyEDAA.Reports + python -m pip install --disable-pip-version-check --break-system-packages -U pyEDAA.Reports - name: Move JUnit files and collect them all to junit/ run: | From 2004711d482fe1ab3952c6a38ef50102a7fd7506 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 1 Aug 2024 11:19:58 +0200 Subject: [PATCH 24/42] Support Intel and ARM platforms for macOS. --- .github/workflows/Parameters.yml | 27 ++++++++++++++++++++++++--- .gitignore | 1 + tests/pacman_packages.py | 8 ++++---- tests/python_jobs.py | 5 +++-- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 8c6a6ed0..9d00d847 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -59,6 +59,26 @@ on: required: false default: '' type: string + ubuntu_image: + description: 'The used GitHub Action image for Ubuntu based jobs.' + required: false + default: 'ubuntu-24.04' + type: string + windows_image: + description: 'The used GitHub Action image for Windows based jobs.' + required: false + default: 'windows-latest' + type: string + macos_intel_image: + description: 'The used GitHub Action image for macOS (Intel x86-64) based jobs.' + required: false + default: 'macos-latest-large' + type: string + macos_arm_image: + description: 'The used GitHub Action image for macOS (ARM arm64) based jobs.' + required: false + default: 'macos-latest' + type: string outputs: python_version: @@ -157,9 +177,10 @@ jobs: }, # Runner systems (runner images) supported by GitHub Actions "sys": { - "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", "shell": "bash", "name": "MacOS (x86-64)" }, + "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)" }, }, # Runtimes provided by MSYS2 "runtime": { diff --git a/.gitignore b/.gitignore index 7ab3de6d..aa068cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ coverage.xml # pytest /report/unit +/tests/*.github # setuptools /build/**/*.* diff --git a/tests/pacman_packages.py b/tests/pacman_packages.py index 12e30216..6d918712 100644 --- a/tests/pacman_packages.py +++ b/tests/pacman_packages.py @@ -78,10 +78,10 @@ def loadRequirementsFile(requirementsFile: Path): pacboyPackages.add(rewrite) # Write jobs to special file -# github_output = Path(getenv("GITHUB_OUTPUT")) -# print(f"GITHUB_OUTPUT: {github_output}") -# with github_output.open("a+") as f: -# f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n") +github_output = Path(getenv("GITHUB_OUTPUT")) +print(f"GITHUB_OUTPUT: {github_output}") +with github_output.open("a+") as f: + f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n") print(f"GITHUB_OUTPUT:") print(f"pacboy_packages={' '.join(pacboyPackages)}\n") diff --git a/tests/python_jobs.py b/tests/python_jobs.py index 526a7f7d..ac8e2c7d 100644 --- a/tests/python_jobs.py +++ b/tests/python_jobs.py @@ -67,9 +67,10 @@ }, # Runner systems (runner images) supported by GitHub Actions "sys": { - "ubuntu": {"icon": "🐧", "runs-on": "ubuntu-24.04", "shell": "bash", "name": "Linux (x86-64)"}, + "ubuntu": {"icon": "🐧", "runs-on": "ubuntu-2024.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", "shell": "bash", "name": "MacOS (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)"}, }, # Runtimes provided by MSYS2 "runtime": { From ebd20f5aea869ecca632e28315dfef69cd314396 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 2 Aug 2024 07:38:22 +0200 Subject: [PATCH 25/42] Disabled macOS x86-64 (macOS Intel) images, because it's not part of the free plan at GitHub. --- .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 9d00d847..37bec940 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 mingw64 ucrt64' + default: 'ubuntu windows macos-arm mingw64 ucrt64' type: string include_list: description: 'Space separated list of system:python items to be included into the list of test.' From 2862238ee53fbe6ffc076192891f185336f36147 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 2 Aug 2024 07:40:14 +0200 Subject: [PATCH 26/42] Allow extended exclude and disable patterns. --- .github/workflows/Parameters.yml | 28 ++++++++++++++++++++++----- pyproject.toml | 2 +- tests/python_jobs.py | 33 ++++++++++++++++++++++++++------ tests/requirements.txt | 2 +- 4 files changed, 52 insertions(+), 13 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 37bec940..c1f40aee 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -203,26 +203,44 @@ jobs: for disable in disabled: print(f"- {disable}") + def match(combination: str, pattern: str) -> bool: + system, version = combination.split(":") + sys, ver = pattern.split(":") + + if sys == "*": + return (ver == "*") or (version == ver) + elif system == sys: + return (ver == "*") or (version == ver) + else: + return False + + def notIn(combination: str, patterns: Iterable[str]) -> bool: + for pattern in patterns: + if match(combination, pattern): + return False + + return True + combinations = [ (system, version) for system in systems if system in data["sys"] for version in versions if version in data["python"] - and f"{system}:{version}" not in excludes - and f"{system}:{version}" not in disabled + and notIn(f"{system}:{version}", excludes) + and notIn(f"{system}:{version}", disabled) ] + [ (system, currentMSYS2Version) for system in systems if system in data["runtime"] - and f"{system}:{currentMSYS2Version}" not in excludes - and f"{system}:{currentMSYS2Version}" not in disabled + and notIn(f"{system}:{currentMSYS2Version}", excludes) + and notIn(f"{system}:{currentMSYS2Version}", disabled) ] + [ (system, version) for system, version in includes if system in data["sys"] and version in data["python"] - and f"{system}:{version}" not in disabled + and notIn(f"{system}:{version}", disabled) ] print(f"Combinations ({len(combinations)}):") for system, version in combinations: diff --git a/pyproject.toml b/pyproject.toml index 63ef1c4e..44b24c82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools ~= 71.1", + "setuptools ~= 72.1", "wheel ~= 0.43", "pyTooling ~= 6.5" ] diff --git a/tests/python_jobs.py b/tests/python_jobs.py index ac8e2c7d..36e892e5 100644 --- a/tests/python_jobs.py +++ b/tests/python_jobs.py @@ -2,10 +2,11 @@ from os import getenv from pathlib import Path from textwrap import dedent +from typing import Iterable name = "example".strip() python_version = "3.12".strip() -systems = "ubuntu windows macos mingw64 ucrt64".strip() +systems = "ubuntu windows macos-arm mingw64 ucrt64".strip() versions = "3.8 3.9 3.10 3.11 3.12".strip() include_list = "".strip() exclude_list = "".strip() @@ -93,26 +94,46 @@ for disable in disabled: print(f"- {disable}") + +def match(combination: str, pattern: str) -> bool: + system, version = combination.split(":") + sys, ver = pattern.split(":") + + if sys == "*": + return (ver == "*") or (version == ver) + elif system == sys: + return (ver == "*") or (version == ver) + else: + return False + + +def notIn(combination: str, patterns: Iterable[str]) -> bool: + for pattern in patterns: + if match(combination, pattern): + return False + + return True + combinations = [ (system, version) for system in systems if system in data["sys"] for version in versions if version in data["python"] - and f"{system}:{version}" not in excludes - and f"{system}:{version}" not in disabled + and notIn(f"{system}:{version}", excludes) + and notIn(f"{system}:{version}", disabled) ] + [ (system, currentMSYS2Version) for system in systems if system in data["runtime"] - and f"{system}:{currentMSYS2Version}" not in excludes - and f"{system}:{currentMSYS2Version}" not in disabled + and notIn(f"{system}:{currentMSYS2Version}", excludes) + and notIn(f"{system}:{currentMSYS2Version}", disabled) ] + [ (system, version) for system, version in includes if system in data["sys"] and version in data["python"] - and f"{system}:{version}" not in disabled + and notIn(f"{system}:{version}", disabled) ] print(f"Combinations ({len(combinations)}):") for system, version in combinations: diff --git a/tests/requirements.txt b/tests/requirements.txt index ea876b3c..b7fdbd9a 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.10 +mypy ~= 1.11 typing_extensions ~= 4.12 lxml ~= 5.2 From 5e0aa52e5de061ef12a6c1b45e56c5dc248d6de6 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 2 Aug 2024 07:41:20 +0200 Subject: [PATCH 27/42] Enhanced PR template. --- .github/pull_request_template.md | 18 ++++++++++++++++-- .github/workflows/Parameters.yml | 1 + .github/workflows/Release.yml | 24 +++++++++++++++++++++++- doc/JobTemplate/Release.rst | 23 +++++++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ac698f89..4ed2d900 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,16 +1,30 @@ # New Features - + +* tbd * tbd # Changes +* tbd * tbd # Bug Fixes +* tbd +* tbd + +# Documentation + +* tbd +* tbd + +# Unit Tests + +* tbd * tbd ---------- -# Related PRs: +# Related Issues and Pull-Requests * tbd +* tbd diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index c1f40aee..dd2f549c 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -112,6 +112,7 @@ jobs: from os import getenv from pathlib import Path from textwrap import dedent + from typing import Iterable name = "${{ inputs.name }}".strip() python_version = "${{ inputs.python_version }}".strip() diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 47ac2377..764eee73 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -55,12 +55,34 @@ jobs: **Automated Release created on: ${{ steps.getVariables.outputs.datetime }}** # New Features + + * tbd * tbd # Changes + + * tbd * tbd # Bug Fixes + + * tbd + * tbd + + # Documentation + + * tbd + * tbd + + # Unit Tests + + * tbd + * tbd + + ---------- + # Related Issues and Pull-Requests + + * tbd * tbd - draft: false + draft: true prerelease: false diff --git a/doc/JobTemplate/Release.rst b/doc/JobTemplate/Release.rst index 109038ca..149ea0d7 100644 --- a/doc/JobTemplate/Release.rst +++ b/doc/JobTemplate/Release.rst @@ -12,14 +12,37 @@ This job creates a Release Page on GitHub. **Automated Release created on: ${{ steps.getVariables.outputs.datetime }}** # New Features + + * tbd * tbd # Changes + + * tbd * tbd # Bug Fixes + + * tbd + * tbd + + # Documentation + + * tbd * tbd + # Unit Tests + + * tbd + * tbd + + ---------- + # Related Issues and Pull-Requests + + * tbd + * tbd + + **Behavior:** 1. Extract information from environment variables provided by GitHub Actions. From 33b99a3b4e10bfdea5f0d6b1d7dd0d9bd057b135 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 2 Aug 2024 08:20:50 +0200 Subject: [PATCH 28/42] Fixed import problem. Fixed pytest rewrite rules. --- .github/workflows/_Checking_Pipeline.yml | 2 +- tests/platform/Specific.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 0d0c62d4..5997ca59 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -89,7 +89,7 @@ jobs: - UnitTesting - PlatformTesting with: - additional_merge_args: '-d --pytest "pytest.tests.unit;pytest.tests.platform;pytest.tests.benchmark;pytest.tests.performance"' + 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 diff --git a/tests/platform/Specific.py b/tests/platform/Specific.py index 283f069e..1ccea7d6 100644 --- a/tests/platform/Specific.py +++ b/tests/platform/Specific.py @@ -28,12 +28,12 @@ # SPDX-License-Identifier: Apache-2.0 # # ==================================================================================================================== # # -from unittest import TestCase +from unittest import TestCase -from pytest import mark -from pyTooling.Common import CurrentPlatform +from pytest import mark +from pyTooling.Platform import CurrentPlatform -from pyDummy import Application +from pyDummy import Application if __name__ == "__main__": # pragma: no cover From 7a341dbe8f72fa350f866441a09e2c250cbcee0b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 2 Aug 2024 08:32:00 +0200 Subject: [PATCH 29/42] Allow system to break. --- .github/workflows/_Checking_Parameters.yml | 2 +- .github/workflows/_Checking_Pipeline.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_Checking_Parameters.yml b/.github/workflows/_Checking_Parameters.yml index 874a0b8f..d9114051 100644 --- a/.github/workflows/_Checking_Parameters.yml +++ b/.github/workflows/_Checking_Parameters.yml @@ -71,7 +71,7 @@ jobs: steps: - name: Install dependencies shell: bash - run: pip install pyTooling + run: pip install --disable-pip-version-check --break-system-packages pyTooling # Params_Default - name: Checking results from 'Params_Default' run: | diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 5997ca59..a1b27e47 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -89,7 +89,7 @@ jobs: - UnitTesting - PlatformTesting with: - additional_merge_args: '-d --pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;;reduce-depth:pytest.tests.platform"' + 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 From 26461822b566427ec8bde3b07041a95bc1961fb9 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 2 Aug 2024 20:54:57 +0200 Subject: [PATCH 30/42] Remove hotfix for Homebrew and GHDL. --- .github/workflows/UnitTesting.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index b7effef9..ff824559 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -368,7 +368,6 @@ jobs: run: | export ENVIRONMENT_NAME="${{ matrix.envname }}" export PYTHONPATH=$(pwd) - export DYLD_LIBRARY_PATH=$(brew --prefix llvm@15)/lib cd "${{ inputs.root_directory || '.' }}" [ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS From 440553e7fbff466a44ee89e4e5f1315317fc04f5 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 3 Aug 2024 07:25:33 +0200 Subject: [PATCH 31/42] Added before scripts for macOS (ARM). --- .github/workflows/UnitTesting.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index ff824559..f9079d17 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -55,7 +55,12 @@ on: default: '' type: string macos_before_script: - description: 'Scripts to execute before pytest on macOS.' + description: 'Scripts to execute before pytest on macOS (Intel).' + required: false + default: '' + type: string + macos_arm_before_script: + description: 'Scripts to execute before pytest on macOS (ARM).' required: false default: '' type: string @@ -145,7 +150,7 @@ jobs: # Package Manager steps - name: 🔧 Install homebrew dependencies on macOS - if: matrix.system == 'macos' && inputs.brew != '' + if: ( matrix.system == 'macos' || matrix.system == 'macos-arm' ) && inputs.brew != '' run: brew install ${{ inputs.brew }} - name: 🔧 Install apt dependencies on Ubuntu @@ -284,10 +289,14 @@ jobs: # Before scripts - - name: 🍎 macOS before scripts + - name: 🍎 macOS (Intel) before scripts if: matrix.system == 'macos' && inputs.macos_before_script != '' run: ${{ inputs.macos_before_script }} + - name: 🍏 macOS (ARM) before scripts + if: matrix.system == 'macos-arm' && inputs.macos_arm_before_script != '' + run: ${{ inputs.macos_arm_before_script }} + - name: 🐧 Ubuntu before scripts if: matrix.system == 'ubuntu' && inputs.ubuntu_before_script != '' run: ${{ inputs.ubuntu_before_script }} From cea83bc2aef5692b4ccf137bbce69e5a67e57300 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 5 Aug 2024 23:05:56 +0200 Subject: [PATCH 32/42] Write GitHub errors for documentation checks. --- .github/workflows/CheckDocumentation.yml | 4 ++-- .github/workflows/UnitTesting.yml | 4 +++- dist/requirements.txt | 2 +- pyproject.toml | 2 +- tests/python_jobs.py | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index aca8af85..e88a6bdd 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -59,9 +59,9 @@ jobs: - name: Run 'interrogate' Documentation Coverage Check continue-on-error: true run: | - interrogate -c pyproject.toml --fail-under=${{ inputs.fail_under }} + interrogate -c pyproject.toml --fail-under=${{ inputs.fail_under }} && echo "::error title=interrogate::Insufficient documentation quality (goal: ${{ inputs.fail_under }})" - name: Run 'docstr_coverage' Documentation Coverage Check continue-on-error: true run: | - docstr-coverage -v 2 --fail-under=${{ inputs.fail_under }} ${{ inputs.directory }} + docstr-coverage -v 2 --fail-under=${{ inputs.fail_under }} ${{ inputs.directory }} && echo "::error title=docstr-coverage::Insufficient documentation quality (goal: ${{ inputs.fail_under }})" diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index f9079d17..3f9b6d3c 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -155,7 +155,9 @@ jobs: - name: 🔧 Install apt dependencies on Ubuntu if: matrix.system == 'ubuntu' && inputs.apt != '' - run: sudo apt-get install -y --no-install-recommends ${{ inputs.apt }} + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends ${{ inputs.apt }} # Compute Dependencies for MSYS2 steps diff --git a/dist/requirements.txt b/dist/requirements.txt index 71950fcd..878e3e51 100644 --- a/dist/requirements.txt +++ b/dist/requirements.txt @@ -1,2 +1,2 @@ -wheel ~= 0.43 +wheel ~= 0.44 twine ~= 5.1 diff --git a/pyproject.toml b/pyproject.toml index 44b24c82..5d2e0ba1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "setuptools ~= 72.1", - "wheel ~= 0.43", + "wheel ~= 0.44", "pyTooling ~= 6.5" ] build-backend = "setuptools.build_meta" diff --git a/tests/python_jobs.py b/tests/python_jobs.py index 36e892e5..58ec322d 100644 --- a/tests/python_jobs.py +++ b/tests/python_jobs.py @@ -68,7 +68,7 @@ }, # Runner systems (runner images) supported by GitHub Actions "sys": { - "ubuntu": {"icon": "🐧", "runs-on": "ubuntu-2024.04", "shell": "bash", "name": "Linux (x86-64)"}, + "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)"}, From e444e5711216a780168a83016ad533093152f380 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 6 Aug 2024 09:29:43 +0200 Subject: [PATCH 33/42] fix(releaser): Use '--break-system-packages' only for Ubuntu 24.04. --- releaser/composite/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/releaser/composite/action.yml b/releaser/composite/action.yml index 3b7cc58e..bc1f1801 100644 --- a/releaser/composite/action.yml +++ b/releaser/composite/action.yml @@ -45,7 +45,9 @@ runs: steps: - shell: bash - run: pip install --disable-pip-version-check PyGithub --progress-bar off --break-system-packages + run: | + [ "$(source /etc/os-release && echo $VERSION_ID)" == "24.04" ] && UBUNTU_2404_ARGS='--break-system-packages' || unset UBUNTU_2404_ARGS + pip install --disable-pip-version-check --progress-bar off $UBUNTU_2404_ARGS PyGithub - shell: bash run: '''${{ github.action_path }}/../releaser.py''' From 474a8024d1f028a5116f34173cc3cffea668881f Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 6 Aug 2024 09:54:41 +0200 Subject: [PATCH 34/42] Remove macOS with Python 3.8, 3.9 from expected list. (cherry picked from commit ee9a3fbdcd14a1ab5a9f52c505716de82cdc2de0) --- .github/workflows/_Checking_Parameters.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/_Checking_Parameters.yml b/.github/workflows/_Checking_Parameters.yml index d9114051..659cf979 100644 --- a/.github/workflows/_Checking_Parameters.yml +++ b/.github/workflows/_Checking_Parameters.yml @@ -84,6 +84,8 @@ jobs: expectedPythons = ["3.8", "3.9", "3.10", "3.11", "3.12"] expectedSystems = ["ubuntu", "windows", "macos"] 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", From 4b058faf3e8f63ca8c8029591cfb953583362153 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 6 Aug 2024 10:01:52 +0200 Subject: [PATCH 35/42] Improved actual vs. expected prints. (cherry picked from commit d58db55086a6ca63f242503b4c306251ab42593a) --- .github/workflows/_Checking_Parameters.yml | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/_Checking_Parameters.yml b/.github/workflows/_Checking_Parameters.yml index 659cf979..4f02a4ea 100644 --- a/.github/workflows/_Checking_Parameters.yml +++ b/.github/workflows/_Checking_Parameters.yml @@ -114,8 +114,12 @@ jobs: errors += 1 if len(actualPythonJobs) != len(expectedJobs): 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']}") + print("Expected jobs:") + for job in expectedJobs: + print(f" {job}") errors += 1 if len(actualArtifactNames) != len(expectedArtifacts): print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.") @@ -170,8 +174,12 @@ jobs: errors += 1 if len(actualPythonJobs) != len(expectedJobs): 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']}") + print("Expected jobs:") + for job in expectedJobs: + print(f" {job}") errors += 1 if len(actualArtifactNames) != len(expectedArtifacts): print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.") @@ -226,8 +234,12 @@ jobs: errors += 1 if len(actualPythonJobs) != len(expectedJobs): 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']}") + print("Expected jobs:") + for job in expectedJobs: + print(f" {job}") errors += 1 if len(actualArtifactNames) != len(expectedArtifacts): print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.") @@ -282,8 +294,12 @@ jobs: errors += 1 if len(actualPythonJobs) != len(expectedJobs): 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']}") + print("Expected jobs:") + for job in expectedJobs: + print(f" {job}") errors += 1 if len(actualArtifactNames) != len(expectedArtifacts): print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.") @@ -338,8 +354,12 @@ jobs: errors += 1 if len(actualPythonJobs) != len(expectedJobs): 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']}") + print("Expected jobs:") + for job in expectedJobs: + print(f" {job}") errors += 1 if len(actualArtifactNames) != len(expectedArtifacts): print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.") @@ -394,8 +414,12 @@ jobs: errors += 1 if len(actualPythonJobs) != len(expectedJobs): 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']}") + print("Expected jobs:") + for job in expectedJobs: + print(f" {job}") errors += 1 if len(actualArtifactNames) != len(expectedArtifacts): print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.") @@ -450,8 +474,12 @@ jobs: errors += 1 if len(actualPythonJobs) != len(expectedJobs): 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']}") + print("Expected jobs:") + for job in expectedJobs: + print(f" {job}") errors += 1 if len(actualArtifactNames) != len(expectedArtifacts): print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.") From 5d6789660644c77524f1839eec784126e2b8154d Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 6 Aug 2024 10:08:44 +0200 Subject: [PATCH 36/42] Fixed next expected parameter set. (cherry picked from commit 188feb556b4a37162a0512a57d821a5a770a08f7) --- .github/workflows/_Checking_Parameters.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/_Checking_Parameters.yml b/.github/workflows/_Checking_Parameters.yml index 4f02a4ea..5f3e6ce6 100644 --- a/.github/workflows/_Checking_Parameters.yml +++ b/.github/workflows/_Checking_Parameters.yml @@ -146,6 +146,9 @@ jobs: expectedPythons = ["3.9", "3.10", "pypy-3.8", "pypy-3.9"] expectedSystems = ["ubuntu", "windows", "macos"] 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", From 0e9d878f0e4352f78f13b237d645f86a9d0567ec Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 9 Sep 2024 23:38:24 +0200 Subject: [PATCH 37/42] Check downloaded artifacts for XML files. --- .github/workflows/PublishTestResults.yml | 5 +++-- doc/requirements.txt | 2 +- pyproject.toml | 2 +- tests/requirements.txt | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 9fc3ba73..118e2868 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -51,14 +51,15 @@ jobs: with: path: artifacts - - name: 🔧 Install junitparser + - name: 🔧 Install pyEDAA.Reports (JUunit Parser and Merger) run: | python -m pip install --disable-pip-version-check --break-system-packages -U pyEDAA.Reports - name: Move JUnit files and collect them all to junit/ run: | mkdir -p junit - find . -type f -path "*artifacts*TestReportSummary-XML*.xml" -exec sh -c 'cp -v $0 "junit/$(basename $(dirname $0)).$(basename $0)"' {} ';' + ls -lAh artifacts/*/*.xml + find artifacts/ -type f -path "*TestReportSummary*.xml" -exec sh -c 'cp -v $0 "junit/$(basename $(dirname $0)).$(basename $0)"' {} ';' tree -a junit - name: 🔁 Merge JUnit Unit Test Summaries diff --git a/doc/requirements.txt b/doc/requirements.txt index daaff1d0..faf4989b 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -16,5 +16,5 @@ sphinxcontrib-mermaid>=0.9.2 autoapi >= 2.0.1 sphinx_fontawesome >= 0.0.6 sphinx-inline-tabs >= 2023.4.21 -sphinx_autodoc_typehints ~= 2.1 +sphinx_autodoc_typehints ~= 2.3 # changelog>=0.3.5 diff --git a/pyproject.toml b/pyproject.toml index 5d2e0ba1..1ac9eaf8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools ~= 72.1", + "setuptools ~= 74.1", "wheel ~= 0.44", "pyTooling ~= 6.5" ] diff --git a/tests/requirements.txt b/tests/requirements.txt index b7fdbd9a..77e2f22b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -10,4 +10,4 @@ pytest-cov ~= 5.0 # Static Type Checking mypy ~= 1.11 typing_extensions ~= 4.12 -lxml ~= 5.2 +lxml ~= 5.3 From c8362d99ccf5f813b1e8ae94cc6b8bc9a0664de0 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 11 Sep 2024 22:03:21 +0200 Subject: [PATCH 38/42] Report errors also to Pipeline message log. --- .github/workflows/ApplicationTesting.yml | 6 +++++- .github/workflows/CoverageCollection.yml | 6 +++++- .github/workflows/PublishCoverageResults.yml | 10 ++++++++-- .github/workflows/SphinxDocumentation.yml | 6 +++++- .github/workflows/UnitTesting.yml | 13 +++++++++++-- tests/pacman_packages.py | 6 +++++- 6 files changed, 39 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ApplicationTesting.yml b/.github/workflows/ApplicationTesting.yml index eab42c74..a2cfbef0 100644 --- a/.github/workflows/ApplicationTesting.yml +++ b/.github/workflows/ApplicationTesting.yml @@ -124,7 +124,11 @@ jobs: requirements = "${{ inputs.requirements }}" if requirements.startswith("-r"): requirementsFile = Path(requirements[2:].lstrip()) - dependencies = loadRequirementsFile(requirementsFile) + try: + dependencies = loadRequirementsFile(requirementsFile) + except FileNotFoundError as ex: + print(f"::error title=FileNotFoundError::{ex}") + exit(1) else: dependencies = [req.strip() for req in requirements.split(" ")] diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 2d0204ff..4f8b0192 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -102,7 +102,9 @@ jobs: htmlDirectory = pyProjectSettings["tool"]["coverage"]["html"]["directory"] xmlFile = pyProjectSettings["tool"]["coverage"]["xml"]["output"] else: - print(f"File '{pyProjectFile}' not found and no ' .coveragerc' file specified.") + 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: @@ -115,6 +117,8 @@ jobs: xmlFile = coverageRCSettings["xml"]["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")) diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index ae1074a7..7f831309 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -102,7 +102,9 @@ jobs: xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"]) jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"]) else: - print(f"File '{pyProjectFile}' not found and no '.coveragerc' file specified.") + 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: @@ -116,6 +118,8 @@ jobs: 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")) @@ -131,8 +135,10 @@ jobs: - name: Rename .coverage files and collect them all to coverage/ run: | + ls -lAh artifacts/ + ls -lAh artifacts/*/.coverage mkdir -p coverage - find . -type f -path "*artifacts*SQLite*.coverage" -exec sh -c 'cp -v $0 "coverage/$(basename $0).$(basename $(dirname $0))"' {} ';' + find artifacts/ -type f -path "*SQLite*.coverage" -exec sh -c 'cp -v $0 "coverage/$(basename $0).$(basename $(dirname $0))"' {} ';' tree -a coverage - name: Combine SQLite files (using Coverage.py) diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index d196dbf4..6fe793b8 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -121,7 +121,9 @@ jobs: xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"]) jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"]) else: - print(f"File '{pyProjectFile}' not found and no '.coveragerc' file specified.") + 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: @@ -135,6 +137,8 @@ jobs: 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")) diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 3f9b6d3c..f9fe40cd 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -197,7 +197,11 @@ jobs: requirements = "${{ inputs.requirements }}" if requirements.startswith("-r"): requirementsFile = Path(requirements[2:].lstrip()) - dependencies = loadRequirementsFile(requirementsFile) + try: + dependencies = loadRequirementsFile(requirementsFile) + except FileNotFoundError as ex: + print(f"::error title=FileNotFoundError::{ex}") + exit(1) else: dependencies = [req.strip() for req in requirements.split(" ")] @@ -344,7 +348,9 @@ jobs: xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"]) jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"]) else: - print(f"File '{pyProjectFile}' not found and no '.coveragerc' file specified.") + 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: @@ -358,6 +364,8 @@ jobs: 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")) @@ -452,6 +460,7 @@ jobs: with: name: ${{ inputs.coverage_sqlite_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }} path: .coverage + include-hidden-files: true if-no-files-found: error retention-days: 1 diff --git a/tests/pacman_packages.py b/tests/pacman_packages.py index 6d918712..c5705547 100644 --- a/tests/pacman_packages.py +++ b/tests/pacman_packages.py @@ -25,7 +25,11 @@ def loadRequirementsFile(requirementsFile: Path): requirements = "-r ../tests/requirements.txt" if requirements.startswith("-r"): requirementsFile = Path(requirements[2:].lstrip()) - dependencies = loadRequirementsFile(requirementsFile) + try: + dependencies = loadRequirementsFile(requirementsFile) + except FileNotFoundError as ex: + print(f"::error title=FileNotFound::{ex}") + exit(1) else: dependencies = [req.strip() for req in requirements.split(" ")] From 59ce0fa84af130e34ba3c43c7764abc16a3f9960 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 19 Sep 2024 23:54:05 +0200 Subject: [PATCH 39/42] Bumped dependencies. --- doc/requirements.txt | 2 +- pyproject.toml | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index faf4989b..ff21b759 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ -r ../requirements.txt -pyTooling ~= 6.5 +pyTooling ~= 6.6 # Enforce latest version on ReadTheDocs sphinx ~= 7.4 diff --git a/pyproject.toml b/pyproject.toml index 1ac9eaf8..b32a0f7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools ~= 74.1", + "setuptools ~= 75.1", "wheel ~= 0.44", - "pyTooling ~= 6.5" + "pyTooling ~= 6.6" ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 6c78340d..96da06bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyTooling ~= 6.5 +pyTooling ~= 6.6 From ea96cce0d10a256556000ac0137ea347cb01c0ec Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 22 Sep 2024 23:53:05 +0200 Subject: [PATCH 40/42] Allow selection of dorny/test-reporter's report name. --- .github/workflows/PublishTestResults.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 118e2868..dcfbd9ef 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -35,6 +35,11 @@ on: required: false default: '"--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit"' type: string + report_title: + description: 'Title of the summary report in the pipeline''s sidebar' + required: false + default: 'Unit Test Results' + type: string jobs: PublishTestResults: @@ -71,7 +76,7 @@ jobs: - name: 📊 Publish Unit Test Results uses: dorny/test-reporter@v1 with: - name: Unit Test Results + name: ${{ inputs.report_title }} path: Unittesting.xml reporter: java-junit From 72a8705e6cb128f3b9aa645a7b52b692c0b1ab0c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 26 Sep 2024 08:15:31 +0200 Subject: [PATCH 41/42] added pyyaml as a special MSYS2 maintained Python package. --- .github/workflows/ApplicationTesting.yml | 28 ++++++++++++++---------- .github/workflows/UnitTesting.yml | 26 ++++++++++++---------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ApplicationTesting.yml b/.github/workflows/ApplicationTesting.yml index a2cfbef0..3f91d6a5 100644 --- a/.github/workflows/ApplicationTesting.yml +++ b/.github/workflows/ApplicationTesting.yml @@ -133,21 +133,25 @@ jobs: dependencies = [req.strip() for req in requirements.split(" ")] packages = { - "coverage": "python-coverage:p", - "igraph": "igraph:p", - "jinja2": "python-markupsafe:p", - "lxml": "python-lxml:p", - "numpy": "python-numpy:p", - "markupsafe": "python-markupsafe:p", - "pip": "python-pip:p", - "ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", - "sphinx": "python-markupsafe:p", - "tomli": "python-tomli:p", - "wheel": "python-wheel:p", + "coverage": "python-coverage:p", + "docstr_coverage": "python-pyyaml:p", + "igraph": "igraph:p", + "jinja2": "python-markupsafe:p", + "lxml": "python-lxml:p", + "numpy": "python-numpy:p", + "markupsafe": "python-markupsafe:p", + "pip": "python-pip:p", + "pyyaml": "python-pyyaml: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", } subPackages = { "pytooling": { - "yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", + "yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", } } diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index f9fe40cd..52fcc46c 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -206,23 +206,25 @@ jobs: dependencies = [req.strip() for req in requirements.split(" ")] packages = { - "coverage": "python-coverage:p", - "igraph": "igraph:p", - "jinja2": "python-markupsafe:p", - "lxml": "python-lxml:p", - "numpy": "python-numpy:p", - "markupsafe": "python-markupsafe:p", - "pip": "python-pip:p", - "ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", - "sphinx": "python-markupsafe:p", - "tomli": "python-tomli:p", - "wheel": "python-wheel:p", + "coverage": "python-coverage:p", + "docstr_coverage": "python-pyyaml:p", + "igraph": "igraph:p", + "jinja2": "python-markupsafe:p", + "lxml": "python-lxml:p", + "numpy": "python-numpy:p", + "markupsafe": "python-markupsafe:p", + "pip": "python-pip:p", + "pyyaml": "python-pyyaml: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", } subPackages = { "pytooling": { - "yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", + "yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", }, } From 93cdeb9cbaeb35d5e8182a1904bbdb0b8af9a840 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 26 Sep 2024 23:19:51 +0200 Subject: [PATCH 42/42] Break system packages. --- .github/workflows/PublishCoverageResults.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index 7f831309..395a120e 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -71,7 +71,7 @@ jobs: - name: 🔧 Install coverage and tomli run: | - python -m pip install --disable-pip-version-check -U coverage[toml] tomli + python -m pip install -U --disable-pip-version-check --break-system-packages coverage[toml] tomli - name: 🔁 Extract configurations from pyproject.toml id: getVariables