diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 21b1d059..aed6d876 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -7,27 +7,35 @@ on: # Every Friday at 22:00 - rerun pipeline to check for dependency-based issues - cron: '0 22 * * 5' +permissions: + actions: write + contents: write + pages: write + id-token: write + jobs: Prepare: - uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@r6 + uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@r7 ConfigParams: - uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r7 UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r6 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@r7 with: - package_name: 'pyVersioning' - disable_list: 'windows-arm:3.13 windows-arm:pypy-3.10 windows-arm:pypy-3.11' + package_name: 'pyVersioning' + python_version_list: '3.11 3.12 3.13 3.14' + disable_list: 'windows-arm:pypy-3.11 windows-arm:3.13' AppTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r6 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@r7 with: - name: pyVersioning - system_list: "ubuntu ubuntu-arm macos macos-arm windows windows-arm" + name: 'pyVersioning' + python_version_list: '3.11 3.12 3.13 3.14' + system_list: 'ubuntu ubuntu-arm macos macos-arm windows windows-arm' UnitTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r6 + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r7 needs: - ConfigParams - UnitTestingParams @@ -41,7 +49,7 @@ jobs: coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r6 + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r7 needs: - ConfigParams - UnitTestingParams @@ -51,7 +59,7 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} CodeQuality: - uses: pyTooling/Actions/.github/workflows/CheckCodeQuality.yml@r6 + uses: pyTooling/Actions/.github/workflows/CheckCodeQuality.yml@r7 needs: - UnitTestingParams with: @@ -61,7 +69,7 @@ jobs: artifact: CodeQuality DocCoverage: - uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r6 + uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r7 needs: - UnitTestingParams with: @@ -69,7 +77,7 @@ jobs: directory: ${{ needs.UnitTestingParams.outputs.package_directory }} Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@r6 + uses: pyTooling/Actions/.github/workflows/Package.yml@r7 needs: - UnitTestingParams with: @@ -77,7 +85,7 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} AppTesting: - uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@dev + uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@r7 needs: - UnitTestingParams - AppTestingParams @@ -101,10 +109,10 @@ jobs: shell: bash steps: - name: ⏬ Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: 📥 Download artifacts '${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}' from 'Package' job - uses: pyTooling/download-artifact@v5 + uses: pyTooling/download-artifact@v7 with: name: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} path: install @@ -135,7 +143,7 @@ jobs: ./check.sh ${{ matrix.example }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@r6 + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@r7 needs: - ConfigParams - UnitTestingParams @@ -153,7 +161,7 @@ jobs: CODACY_TOKEN: ${{ secrets.CODACY_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r6 + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r7 needs: - ConfigParams - UnitTestingParams @@ -171,14 +179,14 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@r6 +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@r7 # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} Documentation: - uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@r6 + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@r7 needs: - ConfigParams - UnitTestingParams @@ -194,7 +202,7 @@ jobs: latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} IntermediateCleanUp: - uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@r6 + uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@r7 needs: - UnitTestingParams - PublishCoverageResults @@ -204,7 +212,7 @@ jobs: xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- PDFDocumentation: - uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev + uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@r7 needs: - UnitTestingParams - Documentation @@ -215,7 +223,7 @@ jobs: can-fail: 'true' PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r6 + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r7 needs: - UnitTestingParams - Documentation @@ -228,7 +236,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} TriggerTaggedRelease: - uses: pyTooling/Actions/.github/workflows/TagReleaseCommit.yml@r6 + uses: pyTooling/Actions/.github/workflows/TagReleaseCommit.yml@r7 needs: - Prepare - UnitTesting @@ -247,7 +255,7 @@ jobs: secrets: inherit ReleasePage: - uses: pyTooling/Actions/.github/workflows/PublishReleaseNotes.yml@r6 + uses: pyTooling/Actions/.github/workflows/PublishReleaseNotes.yml@r7 needs: - Prepare - AppTesting @@ -264,7 +272,7 @@ jobs: secrets: inherit PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r6 + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r7 needs: - Prepare - UnitTestingParams @@ -279,7 +287,7 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r6 + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r7 needs: - UnitTestingParams - UnitTesting diff --git a/.idea/pyVersioning.iml b/.idea/pyVersioning.iml index 5efc77d0..b4107bab 100644 --- a/.idea/pyVersioning.iml +++ b/.idea/pyVersioning.iml @@ -2,6 +2,8 @@ + + @@ -10,7 +12,7 @@ - + diff --git a/dist/requirements.txt b/dist/requirements.txt index 778498a1..e87980bd 100644 --- a/dist/requirements.txt +++ b/dist/requirements.txt @@ -1,2 +1,2 @@ -wheel ~= 0.45 -twine ~= 6.1 +wheel ~= 0.45.0 +twine ~= 6.2 diff --git a/doc/Dependency.rst b/doc/Dependency.rst index debd79bf..99eeebc2 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -50,7 +50,7 @@ PyPI (see :ref:`INSTALL`). +---------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +===========================================================================+=============+==========================================================================================+========================================================================================================================================================+ -| `pyTooling[terminal] `__ | ≥8.7 | `Apache License, 2.0 `__ | * colorama | +| `pyTooling[terminal] `__ | ≥8.10 | `Apache License, 2.0 `__ | * colorama | +---------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | `ruamel.yaml `__ | ≥0.18 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -94,13 +94,13 @@ the mandatory dependencies too. +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=====================================================================+=============+========================================================================================+======================+ -| `pytest `__ | ≥8.4 | `MIT `__ | *Not yet evaluated.* | +| `pytest `__ | ≥9.0 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `pytest-cov `__ | ≥7.0 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `Coverage `__ | ≥7.10 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +| `Coverage `__ | ≥7.13 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `mypy `__ | ≥1.18 | `MIT `__ | *Not yet evaluated.* | +| `mypy `__ | ≥1.19 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `typing-extensions `__ | ≥4.15 | `PSF-2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ @@ -144,7 +144,7 @@ the mandatory dependencies too. +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=================================================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥8.7 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥8.10 | `Apache License, 2.0 `__ | *None* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `Sphinx `__ | ≥8.2 | `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.2 | `MIT `__ | *Not yet evaluated.* | +| `sphinx_autodoc_typehints `__ | ≥3.5 | `MIT `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `sphinx_reports `__ | ≥0.9 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -203,7 +203,7 @@ install the mandatory dependencies too. +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +============================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥8.7 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥8.10 | `Apache License, 2.0 `__ | *None* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `wheel `__ | ≥0.45 | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -248,5 +248,5 @@ install the mandatory dependencies too. +==========================================================+==============+===========================================================================================+======================+ | `wheel `__ | ≥0.45 | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ -| `Twine `__ | ≥6.1 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +| `Twine `__ | ≥6.2 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ diff --git a/doc/requirements.txt b/doc/requirements.txt index 88fa7520..cdb88df2 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,7 +2,7 @@ # Enforce latest version on ReadTheDocs sphinx ~= 8.2 -docutils ~= 0.21 +docutils ~= 0.21.0 docutils_stubs ~= 0.0.22 # ReadTheDocs Theme @@ -12,7 +12,7 @@ sphinx_rtd_theme ~= 3.0 sphinxcontrib-autoprogram ~= 0.1.9 sphinxcontrib-mermaid ~= 1.0 autoapi >= 2.0.1 -sphinx_design ~= 0.6.1 -sphinx-copybutton ~= 0.5.2 -sphinx_autodoc_typehints ~= 3.2 -sphinx_reports ~= 0.9 +sphinx_design ~= 0.6.0 +sphinx-copybutton ~= 0.5.0 +sphinx_autodoc_typehints ~= 3.5 +sphinx_reports ~= 0.9.0 diff --git a/example/C/example.c b/example/C/example.c index ae358c6b..766d7ab3 100644 --- a/example/C/example.c +++ b/example/C/example.c @@ -10,7 +10,7 @@ * * * @brief Code example in C * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * diff --git a/example/C/versioning.h b/example/C/versioning.h index 533074ea..aa8712cf 100644 --- a/example/C/versioning.h +++ b/example/C/versioning.h @@ -10,7 +10,7 @@ * * * @brief C Structure definitions for pyVersioning * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * diff --git a/example/CXX/example.cpp b/example/CXX/example.cpp index 2351185d..a7dbfd21 100644 --- a/example/CXX/example.cpp +++ b/example/CXX/example.cpp @@ -10,7 +10,7 @@ * * * @brief Code example in C++ * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * diff --git a/example/CXX/versioning.hpp b/example/CXX/versioning.hpp index 461d4a77..02b7d34e 100644 --- a/example/CXX/versioning.hpp +++ b/example/CXX/versioning.hpp @@ -10,7 +10,7 @@ * * * @brief C++ Structure definitions for pyVersioning * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * diff --git a/pyVersioning/AppVeyor.py b/pyVersioning/AppVeyor.py index 72c85fa4..81fccba0 100644 --- a/pyVersioning/AppVeyor.py +++ b/pyVersioning/AppVeyor.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/pyVersioning/CIService.py b/pyVersioning/CIService.py index 4910feab..5492265c 100644 --- a/pyVersioning/CIService.py +++ b/pyVersioning/CIService.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -89,12 +89,13 @@ def func(s): Environment = make_dataclass( "Environment", [(name, str) for name in filteredEnv.keys()], - bases=(SelfDescriptive,), + # bases=(SelfDescriptive,), namespace={ 'as_dict': lambda self: filteredEnv, 'Keys': lambda self: filteredEnv.keys(), 'KeyValuePairs': lambda self: func(self) }, + # slots=True, repr=True ) diff --git a/pyVersioning/CLI.py b/pyVersioning/CLI.py index 8db548c1..8f35d6aa 100644 --- a/pyVersioning/CLI.py +++ b/pyVersioning/CLI.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -431,7 +431,7 @@ def FillOutTemplate(self, template: str, **kwargs) -> str: self.WriteVerbose("Applying variables to template ...") return self._versioning.FillOutTemplate(template, **kwargs) - def WriteOutput(self, outputFile: Nullable[Path], content: str): + def WriteOutput(self, outputFile: Nullable[Path], content: str) -> None: if outputFile is not None: self.WriteVerbose(f"Writing output to '{outputFile}' ...") if not outputFile.parent.exists(): diff --git a/pyVersioning/Configuration.py b/pyVersioning/Configuration.py index 6f2866e9..78a631c9 100644 --- a/pyVersioning/Configuration.py +++ b/pyVersioning/Configuration.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -128,7 +128,7 @@ def __init__(self, configFile: Nullable[Path] = None) -> None: else: self.load(configFile) - def load(self, configFile: Path): + def load(self, configFile: Path) -> None: # TODO: change to pyTooling.Configuration yaml = YAML() config = yaml.load(configFile) @@ -138,6 +138,6 @@ def load(self, configFile: Path): if self.version == 1: self.loadVersion1(config) - def loadVersion1(self, config): + def loadVersion1(self, config) -> None: self.project = Project(self, self, config["project"]) if "project" in config else None self.build = Build(self, self, config["build"]) if "build" in config else None diff --git a/pyVersioning/GitHub.py b/pyVersioning/GitHub.py index 00ed7a87..c946edee 100644 --- a/pyVersioning/GitHub.py +++ b/pyVersioning/GitHub.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/pyVersioning/GitLab.py b/pyVersioning/GitLab.py index 15571422..39603425 100644 --- a/pyVersioning/GitLab.py +++ b/pyVersioning/GitLab.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/pyVersioning/Travis.py b/pyVersioning/Travis.py index e458f3d4..81104ce0 100644 --- a/pyVersioning/Travis.py +++ b/pyVersioning/Travis.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/pyVersioning/__init__.py b/pyVersioning/__init__.py index bb3e577b..7cd53fc1 100644 --- a/pyVersioning/__init__.py +++ b/pyVersioning/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -30,9 +30,9 @@ # __author__ = "Patrick Lehmann" __email__ = "Paebbels@gmail.com" -__copyright__ = "2020-2025, Patrick Lehmann" +__copyright__ = "2020-2026, Patrick Lehmann" __license__ = "Apache License, Version 2.0" -__version__ = "0.18.3" +__version__ = "0.18.4" __keywords__ = ["Python3", "Template", "Versioning", "Git"] from dataclasses import make_dataclass @@ -40,7 +40,6 @@ from enum import Enum, auto from os import environ from subprocess import run as subprocess_run, PIPE, CalledProcessError -from sys import version_info from typing import Union, Any, Dict, Tuple, ClassVar, Generator, Optional as Nullable, List from pyTooling.Decorators import export, readonly @@ -55,17 +54,6 @@ class VersioningException(Exception): """Base-exception for all exceptions thrown by pyVersioning.""" - # WORKAROUND: for Python <3.11 - # Implementing a dummy method for Python versions before - if version_info < (3, 11): # pragma: no cover - __notes__: List[str] - - def add_note(self, message: str) -> None: - try: - self.__notes__.append(message) - except AttributeError: - self.__notes__ = [message] - @export class ToolException(VersioningException): @@ -936,12 +924,13 @@ def func(s) -> Generator[Tuple[str, Any], None, None]: Environment = make_dataclass( "Environment", [(name, str) for name in env.keys()], -# bases=(SelfDescriptive,), + # bases=(SelfDescriptive,), namespace={ "as_dict": lambda self: env, "Keys": lambda self: env.keys(), "KeyValuePairs": lambda self: func(self) }, + # slots=True, repr=True ) diff --git a/pyproject.toml b/pyproject.toml index 316ca21f..7066591f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ "setuptools >= 80.0", - "wheel ~= 0.45", - "pyTooling ~= 8.7" + "wheel ~= 0.45.0", + "pyTooling ~= 8.10" ] build-backend = "setuptools.build_meta" @@ -36,23 +36,21 @@ namespace_packages = true html_report = "report/typing" [tool.pytest] -junit_xml = "report/unit/UnittestReportSummary.xml" - -[tool.pyedaa-reports] -junit_xml = "report/unit/unittest.xml" - -[tool.pytest.ini_options] -addopts = "--tb=native" +addopts = ["--tb=native"] # Don't set 'python_classes = *' otherwise, pytest doesn't search for classes # derived from unittest.Testcase -python_files = "*" -python_functions = "test_*" +python_files = ["*"] +python_functions = ["test_*"] filterwarnings = [ "error::DeprecationWarning", "error::PendingDeprecationWarning" ] +junit_xml = "report/unit/UnittestReportSummary.xml" junit_logging = "all" +[tool.pyedaa-reports] +junit_xml = "report/unit/unittest.xml" + [tool.interrogate] color = true verbose = 1 # possible values: 0 (minimal output), 1 (-v), 2 (-vv) diff --git a/requirements.txt b/requirements.txt index 93adcc8a..027882f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -pyTooling[terminal] ~= 8.7 -ruamel.yaml ~= 0.18 +pyTooling[terminal] ~= 8.10 +ruamel.yaml ~= 0.18.0 diff --git a/run.ps1 b/run.ps1 index 94cd3c1e..63d18261 100644 --- a/run.ps1 +++ b/run.ps1 @@ -32,7 +32,7 @@ Param( ) $PackageName = "pyVersioning" -$PackageVersion = "0.18.2" +$PackageVersion = "0.18.4" # set default values $EnableDebug = [bool]$PSCmdlet.MyInvocation.BoundParameters["Debug"] diff --git a/setup.py b/setup.py index 8768af05..239ce425 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -45,6 +45,7 @@ description="Write version information collected from (CI) environment for any programming language as source file.", gitHubNamespace=gitHubNamespace, sourceFileWithVersion=packageInformationFile, + pythonVersions=("3.11", "3.12", "3.13", "3.14"), consoleScripts={ "pyVersioning": "pyVersioning.CLI:main", } diff --git a/templates/C/versioning.c.template b/templates/C/versioning.c.template index f05d1d92..932e340e 100644 --- a/templates/C/versioning.c.template +++ b/templates/C/versioning.c.template @@ -10,7 +10,7 @@ * * * @brief C constant declaration of the version data structure * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * @@ -38,7 +38,7 @@ const VersioningInformation versioningInformation = {{ }}, .git = {{ .commit = {{ - .hash = "{git.commit.hash}\0", + .hash = "{git.commit.hash}", .datetime = {{ .date = {{ .day = {git.commit.date.day}, diff --git a/templates/C/versioning.h b/templates/C/versioning.h index e224f85d..c9e6a35c 100644 --- a/templates/C/versioning.h +++ b/templates/C/versioning.h @@ -10,7 +10,7 @@ /* * /* @brief C Structure definitions for pyVersioning * /* * -/* @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * +/* @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * /* * /* Licensed under the Apache License, Version 2.0 (the "License"); * /* you may not use this file except in compliance with the License. * @@ -57,8 +57,8 @@ typedef struct { } Version; typedef struct { - char hash[41]; // hex-value as string (160-bit => 40 characters + \0) - DateTime datetime; + const char* hash; // hex-value as string (160-bit => 40 characters + \0) + DateTime datetime; } Commit; typedef struct { diff --git a/templates/CXX/versioning.cpp.template b/templates/CXX/versioning.cpp.template index b70bc564..1c2c4995 100644 --- a/templates/CXX/versioning.cpp.template +++ b/templates/CXX/versioning.cpp.template @@ -10,7 +10,7 @@ * * * @brief C++ constant declaration of the version data structure * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * diff --git a/templates/CXX/versioning.hpp b/templates/CXX/versioning.hpp index 461d4a77..02b7d34e 100644 --- a/templates/CXX/versioning.hpp +++ b/templates/CXX/versioning.hpp @@ -10,7 +10,7 @@ * * * @brief C++ Structure definitions for pyVersioning * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * diff --git a/tests/__init__.py b/tests/__init__.py index 7f1de3e7..f18cec0c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/tests/app/GitHub.py b/tests/app/GitHub.py index 3661a702..82823711 100644 --- a/tests/app/GitHub.py +++ b/tests/app/GitHub.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -30,7 +30,7 @@ # """Unit tests for GitLab CI.""" from subprocess import run as subprocess_run, PIPE as subprocess_PIPE, STDOUT as subprocess_STDOUT, CalledProcessError -from typing import Any, Optional as Nullable +from typing import Any, Optional as Nullable, Tuple from unittest import TestCase @@ -43,7 +43,7 @@ class GitHubEnvironment(TestCase): @classmethod - def _run(cls, command: Nullable[str] = None, *args: Any): + def _run(cls, command: Nullable[str] = None, *args: Any) -> Tuple[str, str]: callArgs = ["pyVersioning"] if command is not None: callArgs.append(command) diff --git a/tests/requirements.txt b/tests/requirements.txt index c8b94c7c..e9c2fe89 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,13 +1,2 @@ --r ../requirements.txt - -# Coverage collection -Coverage ~= 7.10 - -# Test Runner -pytest ~= 8.4 -pytest-cov ~= 7.0 - -# Static Type Checking -mypy[reports] ~= 1.18 -typing_extensions ~= 4.15 -lxml ~= 6.0 +-r unit/requirements.txt +-r typing/requirements.txt diff --git a/tests/template.in b/tests/template.in index f05d1d92..1514dc22 100644 --- a/tests/template.in +++ b/tests/template.in @@ -10,7 +10,7 @@ * * * @brief C constant declaration of the version data structure * * * - * @copyright Copyright 2020-2024 Patrick Lehmann - Boetzingen, Germany * + * @copyright Copyright 2020-2026 Patrick Lehmann - Boetzingen, Germany * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * diff --git a/tests/typing/requirements.txt b/tests/typing/requirements.txt new file mode 100644 index 00000000..95ab13e1 --- /dev/null +++ b/tests/typing/requirements.txt @@ -0,0 +1,6 @@ +-r ../../requirements.txt + +# Static Type Checking +mypy[reports] ~= 1.19 +typing_extensions ~= 4.15 +lxml >= 5.4, <7.0 diff --git a/tests/unit/Application.py b/tests/unit/Application.py index b0f9b98b..c90a358a 100644 --- a/tests/unit/Application.py +++ b/tests/unit/Application.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -72,7 +72,7 @@ def _RemoveColorCodes(content: str) -> str: return ansiEscape.sub("", content) @patch("sys.argv", ["pyVersioning.py"]) - def test_NoCommand(self): + def test_NoCommand(self) -> None: print() app = pyV_Application() @@ -87,7 +87,7 @@ def test_NoCommand(self): # self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "help"]) - def test_Help(self): + def test_Help(self) -> None: print() app = pyV_Application() @@ -102,7 +102,7 @@ def test_Help(self): # self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "version"]) - def test_Version(self): + def test_Version(self) -> None: print() app = pyV_Application() @@ -117,7 +117,7 @@ def test_Version(self): # self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "variables"]) - def test_Variables(self): + def test_Variables(self) -> None: print() app = pyV_Application() @@ -132,7 +132,7 @@ def test_Variables(self): # self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "field", "version"]) - def test_Field_Version(self): + def test_Field_Version(self) -> None: print() app = pyV_Application() @@ -147,7 +147,7 @@ def test_Field_Version(self): # self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "field", "git.commit.hash"]) - def test_Field_GitCommitHash(self): + def test_Field_GitCommitHash(self) -> None: print() app = pyV_Application() @@ -162,7 +162,7 @@ def test_Field_GitCommitHash(self): # self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "fillout", "tests/template.in"]) - def test_Fillout(self): + def test_Fillout(self) -> None: print() app = pyV_Application() @@ -177,7 +177,7 @@ def test_Fillout(self): # self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "--config-file=tests/unit/CIServices/.pyVersioning.yml", "json"]) - def test_JSON_WithoutError(self): + def test_JSON_WithoutError(self) -> None: print() app = pyV_Application() @@ -195,7 +195,7 @@ def test_JSON_WithoutError(self): self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "--config-file=CIServices/.pyVersioning.yml", "json"]) - def test_JSON_WithError(self): + def test_JSON_WithError(self) -> None: print() app = pyV_Application() @@ -213,7 +213,7 @@ def test_JSON_WithError(self): self.assertEqual("1.1", json["format"]) @patch("sys.argv", ["pyVersioning.py", "--config-file=tests/unit/CIServices/.pyVersioning.yml", "yaml"]) - def test_YAML_WithoutError(self): + def test_YAML_WithoutError(self) -> None: print() app = pyV_Application() @@ -232,7 +232,7 @@ def test_YAML_WithoutError(self): self.assertEqual("1.1", yaml["format"]) @patch("sys.argv", ["pyVersioning.py", "--config-file=CIServices/.pyVersioning.yml", "yaml"]) - def test_YAML_WithError(self): + def test_YAML_WithError(self) -> None: print() app = pyV_Application() diff --git a/tests/unit/CIServices/GitHub.py b/tests/unit/CIServices/GitHub.py index 47549962..385e95e8 100644 --- a/tests/unit/CIServices/GitHub.py +++ b/tests/unit/CIServices/GitHub.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/tests/unit/CIServices/GitLab.py b/tests/unit/CIServices/GitLab.py index b1613596..cb7de65f 100644 --- a/tests/unit/CIServices/GitLab.py +++ b/tests/unit/CIServices/GitLab.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/tests/unit/CIServices/NoService.py b/tests/unit/CIServices/NoService.py index d9898cd4..35917dab 100644 --- a/tests/unit/CIServices/NoService.py +++ b/tests/unit/CIServices/NoService.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # @@ -67,7 +67,7 @@ def _getServiceEnvironment(cls, **kwargs: Any) -> Dict[str, str]: return env @mark.skipif(Platforms.OS_Windows in CurrentPlatform._platform, reason="Skipped, if current platform is on Windows.") - def test_NoArguments(self): + def test_NoArguments(self) -> None: print() stdout, stderr = self._run() diff --git a/tests/unit/CIServices/__init__.py b/tests/unit/CIServices/__init__.py index 7924a7f0..37bf78b9 100644 --- a/tests/unit/CIServices/__init__.py +++ b/tests/unit/CIServices/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/tests/unit/Database.py b/tests/unit/Database.py index ba28e1fe..007474c4 100644 --- a/tests/unit/Database.py +++ b/tests/unit/Database.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 7f1de3e7..f18cec0c 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2020-2025 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2020-2026 Patrick Lehmann - Bötzingen, Germany # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # diff --git a/tests/unit/requirements.txt b/tests/unit/requirements.txt index 3c8d7e78..a2ffbaa9 100644 --- a/tests/unit/requirements.txt +++ b/tests/unit/requirements.txt @@ -1 +1,8 @@ --r ../requirements.txt +-r ../../requirements.txt + +# Coverage collection +Coverage ~= 7.13 + +# Test Runner +pytest ~= 9.0 +pytest-cov ~= 7.0