From 1479fb1fef3290ba7b0ea009e03b74207b1211f6 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 2 May 2025 17:29:10 +0200 Subject: [PATCH] Use auto tagging pipeline. --- .github/workflows/Pipeline.yml | 71 ++++++++++++++++++++++------------ doc/Dependency.rst | 4 +- doc/conf.py | 9 +++-- doc/requirements.txt | 2 +- pyVersioning/__init__.py | 2 +- pyproject.toml | 2 +- run.ps1 | 3 +- tests/requirements.txt | 2 +- 8 files changed, 60 insertions(+), 35 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index c133c3d9..bbbaecec 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -8,13 +8,16 @@ on: - cron: '0 22 * * 5' jobs: + Prepare: + uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@dev + ConfigParams: - uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r4 + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev with: package_name: pyVersioning UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r4 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: pyVersioning # python_version_list: "3.9 3.10 3.11 3.12 pypy-3.9 pypy-3.10" @@ -24,7 +27,7 @@ jobs: # disable_list: "windows:pypy-3.8 windows:pypy-3.9 windows:pypy-3.10" AppTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r4 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: pyVersioning # python_version_list: "3.9 3.10 3.11 3.12 pypy-3.9 pypy-3.10" @@ -62,7 +65,7 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} DocCoverage: - uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r4 + uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev needs: - ConfigParams - UnitTestingParams @@ -139,7 +142,7 @@ jobs: ./check.sh ${{ matrix.example }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@r4 + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev needs: - ConfigParams - UnitTestingParams @@ -150,14 +153,12 @@ jobs: coverage_report_json_filename: ${{ needs.ConfigParams.outputs.coverage_report_json_filename }} coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} coverage_report_html_directory: ${{ needs.ConfigParams.outputs.coverage_report_html_directory }} - codecov: true - codacy: true - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - CODACY_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + codecov: false + codacy: false + secrets: inherit PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r4 + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev needs: - ConfigParams - UnitTestingParams @@ -169,9 +170,8 @@ jobs: merged_junit_filename: ${{ needs.ConfigParams.outputs.unittest_merged_report_xml_filename }} merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} dorny: true - codecov: true - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + codecov: false + secrets: inherit IntermediateCleanUp: uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@r4 @@ -179,7 +179,6 @@ jobs: - UnitTestingParams - PublishCoverageResults - PublishTestResults - - Documentation with: sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}- xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- @@ -227,17 +226,42 @@ jobs: - PublishCoverageResults - StaticTypeCheck with: - doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} -# coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} - typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} + typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + + TriggerTaggedRelease: + uses: pyTooling/Actions/.github/workflows/TagReleaseCommit.yml@dev + needs: + - Prepare + - UnitTesting + - AppTesting + - Examples +# - StaticTypeCheck + - Package + - PublishToGitHubPages + if: needs.Prepare.outputs.is_release_commit + permissions: + contents: write # required for create tag + actions: write # required for trigger workflow + with: + version: ${{ needs.Prepare.outputs.version }} + auto_tag: ${{ needs.Prepare.outputs.is_release_commit }} + secrets: inherit ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@r4 - if: startsWith(github.ref, 'refs/tags') + uses: pyTooling/Actions/.github/workflows/PublishReleaseNotes.yml@dev + if: needs.Prepare.outputs.is_release_tag == 'true' needs: + - Prepare - AppTesting - Examples +# - StaticTypeCheck + - Package - PublishToGitHubPages + with: + tag: ${{ needs.Prepare.outputs.version }} + secrets: inherit PublishOnPyPI: uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r4 @@ -247,10 +271,9 @@ jobs: - ReleasePage with: python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - requirements: -r dist/requirements.txt - artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} - secrets: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + requirements: '-r dist/requirements.txt' + artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} + secrets: inherit ArtifactCleanUp: uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r4 diff --git a/doc/Dependency.rst b/doc/Dependency.rst index fca2b882..88ec62a2 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -104,7 +104,7 @@ the mandatory dependencies too. +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `typing-extensions `__ | ≥4.13 | `PSF-2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `lxml `__ | ≥5.3 | `BSD 3-Clause `__ | *Not yet evaluated.* | +| `lxml `__ | ≥5.4 | `BSD 3-Clause `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ @@ -160,7 +160,7 @@ the mandatory dependencies too. +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `sphinx-copybutton `__ | ≥0.5 | `MIT `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `sphinx_autodoc_typehints `__ | ≥3.1 | `MIT `__ | *Not yet evaluated.* | +| `sphinx_autodoc_typehints `__ | ≥3.2 | `MIT `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `sphinx_reports `__ | ≥0.9 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/doc/conf.py b/doc/conf.py index 02b00f6c..81d7db58 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -24,6 +24,7 @@ # |version| and |release|, also used in various other places throughout the # built documents. project = "pyVersioning" +directoryName = project.replace('.', '/') projectDirectory = Path(f"../{project.replace('.', '/')}") packageInformationFile = projectDirectory / "__init__.py" @@ -266,13 +267,13 @@ # ============================================================================== report_unittest_testsuites = { "src": { - "name": "pyVersioning", + "name": f"{project}", "xml_report": "../report/unit/unittest.xml", } } report_codecov_packages = { "src": { - "name": "pyVersioning", + "name": f"{project}", "json_report": "../report/coverage/coverage.json", "fail_below": 80, "levels": "default" @@ -280,8 +281,8 @@ } report_doccov_packages = { "src": { - "name": "pyVersioning", - "directory": "../pyVersioning", + "name": f"{project}", + "directory": f"../{directoryName}", "fail_below": 80, "levels": "default" } diff --git a/doc/requirements.txt b/doc/requirements.txt index a4474cc6..88fa7520 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -14,5 +14,5 @@ sphinxcontrib-mermaid ~= 1.0 autoapi >= 2.0.1 sphinx_design ~= 0.6.1 sphinx-copybutton ~= 0.5.2 -sphinx_autodoc_typehints ~= 3.1 +sphinx_autodoc_typehints ~= 3.2 sphinx_reports ~= 0.9 diff --git a/pyVersioning/__init__.py b/pyVersioning/__init__.py index 843fa548..afdfed94 100644 --- a/pyVersioning/__init__.py +++ b/pyVersioning/__init__.py @@ -32,7 +32,7 @@ __email__ = "Paebbels@gmail.com" __copyright__ = "2020-2025, Patrick Lehmann" __license__ = "Apache License, Version 2.0" -__version__ = "0.18.0" +__version__ = "0.18.1" __keywords__ = ["Python3", "Template", "Versioning", "Git"] from dataclasses import make_dataclass diff --git a/pyproject.toml b/pyproject.toml index 3cc1bd7e..c2eae70f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools ~= 79.0", + "setuptools >= 80.0", "wheel ~= 0.45", "pyTooling ~= 8.4" ] diff --git a/run.ps1 b/run.ps1 index 8cc2f081..d4067758 100644 --- a/run.ps1 +++ b/run.ps1 @@ -32,6 +32,7 @@ Param( ) $PackageName = "pyVersioning" +$PackageVersion = "0.18.1" # set default values $EnableDebug = [bool]$PSCmdlet.MyInvocation.BoundParameters["Debug"] @@ -97,7 +98,7 @@ if ($install) { Write-Host -ForegroundColor Cyan "[ADMIN][UNINSTALL] Uninstalling $PackageName ..." py -3.13 -m pip uninstall -y $PackageName Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Installing $PackageName from wheel ..." - py -3.13 -m pip install .\dist\$PackageName-0.18.0-py3-none-any.whl + py -3.13 -m pip install .\dist\$PackageName-$PackageVersion-py3-none-any.whl Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Closing window in 5 seconds ..." Start-Sleep -Seconds 5 diff --git a/tests/requirements.txt b/tests/requirements.txt index e44d7b60..dc267c19 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -10,4 +10,4 @@ pytest-cov ~= 6.1 # Static Type Checking mypy ~= 1.15 typing_extensions ~= 4.13 -lxml ~= 5.3 +lxml ~= 5.4