From 4f4cb624953d0f11669924eddbfbf9406295464a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 21:44:25 +0100 Subject: [PATCH] Bumped dependencies and general updates. --- .github/pull_request_template.md | 18 ++- .github/workflows/Pipeline.yml | 193 +++++++++++++++++++++---------- .idea/pySystemRDLModel.iml | 4 +- dist/requirements.txt | 4 +- doc/Dependency.rst | 28 ++--- doc/LanguageModel/index.rst | 2 +- doc/conf.py | 6 +- doc/index.rst | 4 +- doc/requirements.txt | 10 +- pySystemRDLModel/__init__.py | 10 +- pyproject.toml | 43 +++++-- requirements.txt | 2 +- setup.py | 13 ++- tests/requirements.txt | 12 +- tests/unit/Instantiate.py | 16 +-- tests/unit/__init__.py | 2 +- tests/unit/requirements.txt | 1 + 17 files changed, 239 insertions(+), 129 deletions(-) create mode 100644 tests/unit/requirements.txt diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ac698f8..4ed2d90 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/Pipeline.yml b/.github/workflows/Pipeline.yml index 88bccf0..2ad13f8 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -4,11 +4,11 @@ on: push: workflow_dispatch: schedule: - - cron: '0 0 * * 5' +# Every Friday at 22:00 - rerun pipeline to check for dependency-based issues + - cron: '0 22 * * 5' jobs: - - Params: + UnitTestingParams: uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: pySystemRDLModel @@ -16,109 +16,174 @@ jobs: UnitTesting: uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev needs: - - Params + - UnitTestingParams with: - jobs: ${{ needs.Params.outputs.python_jobs }} - artifact: ${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }} - - Coverage: - uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@dev - needs: - - Params - with: - python_version: ${{ needs.Params.outputs.python_version }} - artifact: ${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }} - secrets: - codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} + jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }} + requirements: "-r tests/unit/requirements.txt" +# pacboy: "msys/git" + unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} + coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} StaticTypeCheck: uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev needs: - - Params + - UnitTestingParams with: - python_version: ${{ needs.Params.outputs.python_version }} + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} commands: | mypy --html-report htmlmypy -p pySystemRDLModel - html_artifact: ${{ fromJson(needs.Params.outputs.artifact_names).statictyping_html }} + html_report: 'htmlmypy' + html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} - PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev + DocCoverage: + uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev needs: - - UnitTesting + - UnitTestingParams + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + directory: pySystemRDLModel +# fail_below: 70 + + ConfigParams: + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev + needs: + - DocCoverage Package: uses: pyTooling/Actions/.github/workflows/Package.yml@dev needs: - - Params - - Coverage + - UnitTestingParams + - UnitTesting with: - python_version: ${{ needs.Params.outputs.python_version }} - artifact: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }} + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} - Release: - uses: pyTooling/Actions/.github/workflows/Release.yml@dev - if: startsWith(github.ref, 'refs/tags') + PublishCoverageResults: + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev needs: + - UnitTestingParams - UnitTesting - - Coverage - - StaticTypeCheck - - Package + with: +# coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} +# coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }} + coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} + coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} + secrets: + codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} - PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev - if: startsWith(github.ref, 'refs/tags') + PublishTestResults: + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev needs: - - Params - - Release - - Package + - UnitTestingParams + - UnitTesting with: - python_version: ${{ needs.Params.outputs.python_version }} - requirements: -r dist/requirements.txt - artifact: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }} - secrets: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} # VerifyDocs: # uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev # needs: -# - Params +# - UnitTestingParams # with: -# python_version: ${{ needs.Params.outputs.python_version }} +# python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - BuildTheDocs: - uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@dev + Documentation: + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev needs: - - Params + - UnitTestingParams + - ConfigParams + - PublishTestResults + - PublishCoverageResults # - VerifyDocs with: - artifact: ${{ fromJson(needs.Params.outputs.artifact_names).documentation_html }} + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }} + unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-ubuntu-native-3.12 + coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} + html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} + + IntermediateCleanUp: + uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev + needs: + - UnitTestingParams + - PublishCoverageResults + - PublishTestResults + - Documentation + with: + sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}- + xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- + +# PDFDocumentation: +# uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev +# needs: +# - UnitTestingParams +# - Documentation +# with: +# document: pySystemRDLModel +# latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} +# pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} PublishToGitHubPages: uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev needs: - - Params - - BuildTheDocs - - Coverage + - UnitTestingParams + - Documentation +# - PDFDocumentation + - PublishCoverageResults - StaticTypeCheck with: - doc: ${{ fromJson(needs.Params.outputs.artifact_names).documentation_html }} - coverage: ${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }} - typing: ${{ fromJson(needs.Params.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 }} + + ReleasePage: + uses: pyTooling/Actions/.github/workflows/Release.yml@dev + if: startsWith(github.ref, 'refs/tags') + needs: + - Package + - PublishToGitHubPages + + PublishOnPyPI: + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev + if: startsWith(github.ref, 'refs/tags') + needs: + - UnitTestingParams + - ReleasePage + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + requirements: -r dist/requirements.txt + artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev needs: - - Params + - UnitTestingParams - UnitTesting - - Coverage - StaticTypeCheck - - BuildTheDocs - - PublishToGitHubPages + - Documentation +# - PDFDocumentation - PublishTestResults + - PublishCoverageResults + - PublishToGitHubPages +# - PublishOnPyPI with: - package: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }} + package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} remaining: | - ${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}-* - ${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }} - ${{ fromJson(needs.Params.outputs.artifact_names).statictyping_html }} - ${{ fromJson(needs.Params.outputs.artifact_names).documentation_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}-* + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} + ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} +# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} diff --git a/.idea/pySystemRDLModel.iml b/.idea/pySystemRDLModel.iml index eb934a9..5b5388d 100644 --- a/.idea/pySystemRDLModel.iml +++ b/.idea/pySystemRDLModel.iml @@ -7,8 +7,10 @@ + + - + \ No newline at end of file diff --git a/dist/requirements.txt b/dist/requirements.txt index a414030..878e3e5 100644 --- a/dist/requirements.txt +++ b/dist/requirements.txt @@ -1,2 +1,2 @@ -wheel >= 0.40.0 -twine >= 4.0.2 +wheel ~= 0.44 +twine ~= 5.1 diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 42020e4..c8a9ba4 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -29,7 +29,7 @@ pySystemRDLModel Package +--------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +========================================================+=============+==========================================================================================+=================================================================================================================================+ -| `pyTooling `__ | ≥4.0.0 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥7.0 | `Apache License, 2.0 `__ | *None* | +--------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------+ @@ -57,17 +57,17 @@ the mandatory dependencies too. +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=====================================================================+=============+========================================================================================+======================+ -| `pytest `__ | ≥7.4.0 | `MIT `__ | *Not yet evaluated.* | +| `pytest `__ | ≥8.3 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `pytest-cov `__ | ≥4.1.0 | `MIT `__ | *Not yet evaluated.* | +| `pytest-cov `__ | ≥6.0 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `Coverage `__ | ≥7.3 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +| `Coverage `__ | ≥7.6 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `mypy `__ | ≥1.5 | `MIT `__ | *Not yet evaluated.* | +| `mypy `__ | ≥1.13 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `typing-extensions `__ | ≥4.7.1 | `PSF-2.0 `__ | *Not yet evaluated.* | +| `typing-extensions `__ | ≥4.12 | `PSF-2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `lxml `__ | ≥4.9 | `BSD 3-Clause `__ | *Not yet evaluated.* | +| `lxml `__ | ≥5.3 | `BSD 3-Clause `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ @@ -95,15 +95,15 @@ the mandatory dependencies too. +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=================================================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥4.0.0 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥7.0 | `Apache License, 2.0 `__ | *None* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `Sphinx `__ | ≥5.3.0 | `BSD 3-Clause `__ | *Not yet evaluated.* | +| `Sphinx `__ | ≥8.1 | `BSD 3-Clause `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `sphinx_btd_theme `__ | ≥0.5.2 | `MIT `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | !! `sphinx_fontawesome `__ | ≥0.0.6 | `GPL 2.0 `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `sphinx_autodoc_typehints `__ | ≥1.19.5 | `MIT `__ | *Not yet evaluated.* | +| `sphinx_autodoc_typehints `__ | ≥2.5 | `MIT `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -131,9 +131,9 @@ install the mandatory dependencies too. +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +============================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥4.0.0 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥7.0 | `Apache License, 2.0 `__ | *None* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `wheel `__ | ≥0.40.0 | `MIT `__ | *Not yet evaluated.* | +| `wheel `__ | ≥0.44 | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -162,7 +162,7 @@ install the mandatory dependencies too. +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ | **Package** | **Version** | **License** | **Dependencies** | +==========================================================+==============+===========================================================================================+======================+ -| `wheel `__ | ≥0.40.0 | `MIT `__ | *Not yet evaluated.* | +| `wheel `__ | ≥0.44 | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ -| `Twine `__ | ≥4.0.2 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +| `Twine `__ | ≥5.1 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+ diff --git a/doc/LanguageModel/index.rst b/doc/LanguageModel/index.rst index 9fb550f..278b6a0 100644 --- a/doc/LanguageModel/index.rst +++ b/doc/LanguageModel/index.rst @@ -3,7 +3,7 @@ SystemRDL Language Model ######################## -.. topic:: Design Goal +.. topic:: Design Goals * Clearly named classes that model the semantics of SystemRDL. * All language constructs (statements, declarations, specifications, …) have their own classes. diff --git a/doc/conf.py b/doc/conf.py index 3dd05b2..f517b2c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -61,7 +61,7 @@ # ============================================================================== prologPath = Path("prolog.inc") try: - with prologPath.open("r") as fileHandle: + with prologPath.open("r", encoding="utf-8") as fileHandle: rst_prolog = fileHandle.read() except Exception as ex: print(f"[ERROR:] While reading '{prologPath}'.") @@ -204,8 +204,8 @@ # Sphinx.Ext.ExtLinks # ============================================================================== extlinks = { - "ghissue": ('https://GitHub.com/edaa-org/pySystemRDLModel/issues/%s', 'issue #'), - "ghpull": ('https://GitHub.com/edaa-org/pySystemRDLModel/pull/%s', 'pull request #'), + "ghissue": ('https://GitHub.com/edaa-org/pySystemRDLModel/issues/%s', 'issue #%s'), + "ghpull": ('https://GitHub.com/edaa-org/pySystemRDLModel/pull/%s', 'pull request #%s'), "ghsrc": ('https://GitHub.com/edaa-org/pySystemRDLModel/blob/main/%s?ts=2', None), } diff --git a/doc/index.rst b/doc/index.rst index 17fe507..433b40b 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -73,7 +73,7 @@ News * Moved ``SystemRDLVersion`` class from ``pyEDAA.ProjectModel`` to this new repository. -.. _contributors: +.. _CONTRIBUTORS: Contributors ************ @@ -82,6 +82,8 @@ Contributors * `and more... `__ +.. _LICENSE: + License ******* diff --git a/doc/requirements.txt b/doc/requirements.txt index 4017a3c..67860f4 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,12 +1,12 @@ -r ../requirements.txt -pyTooling >= 5.0.0, <6.0 - # Enforce latest version on ReadTheDocs -sphinx>=5.3.0 +sphinx ~= 8.1 +docutils ~= 0.21 +docutils_stubs ~= 0.0.22 # Sphinx Extenstions -sphinxcontrib-mermaid>=0.7.1 +sphinxcontrib-mermaid ~= 1.0 autoapi>=2.0.1 sphinx_fontawesome>=0.0.6 -sphinx_autodoc_typehints>=1.19.5 +sphinx_autodoc_typehints ~= 2.5 diff --git a/pySystemRDLModel/__init__.py b/pySystemRDLModel/__init__.py index 16b9635..44ce639 100644 --- a/pySystemRDLModel/__init__.py +++ b/pySystemRDLModel/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2023-2023 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2023-2024 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. # @@ -31,10 +31,10 @@ """ An abstract SystemRDL language model. -:copyright: Copyright 2023-2023 Patrick Lehmann - Bötzingen, Germany +:copyright: Copyright 2023-2024 Patrick Lehmann - Bötzingen, Germany :license: Apache License, Version 2.0 """ -from enum import unique, Enum +from enum import unique, Enum from typing import Dict, Union from pyTooling.Decorators import export @@ -42,9 +42,9 @@ __author__ = "Patrick Lehmann" __email__ = "Paebbels@gmail.com" -__copyright__ = "2023-2023, Patrick Lehmann" +__copyright__ = "2023-2024, Patrick Lehmann" __license__ = "Apache License, Version 2.0" -__version__ = "0.2.2" +__version__ = "0.3.0" @export diff --git a/pyproject.toml b/pyproject.toml index 387cfda..6e545a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools >= 68.0.0", - "wheel >= 0.40.0", - "pyTooling >= 5.0.0" + "setuptools ~= 75.3", + "wheel ~= 0.44", + "pyTooling ~= 7.0" ] build-backend = "setuptools.build_meta" @@ -10,15 +10,18 @@ build-backend = "setuptools.build_meta" line-length = 120 [tool.mypy] -python_version = "3.11" -namespace_packages = true - +files = ["pySystemRDLModel"] +python_version = "3.13" +#ignore_missing_imports = true +strict = true pretty = true show_error_context = true - +show_error_codes = true +namespace_packages = true html_report = "report/typing" [tool.pytest.ini_options] +addopts = "--tb=native" # Don't set 'python_classes = *' otherwise, pytest doesn't search for classes # derived from unittest.Testcase python_files = "*" @@ -27,13 +30,28 @@ filterwarnings = [ "error::DeprecationWarning", "error::PendingDeprecationWarning" ] +junit_logging = "all" + +[tool.interrogate] +color = true +verbose = 1 # possible values: 0 (minimal output), 1 (-v), 2 (-vv) +fail-under = 59 +exclude = [ + "build", + "dist", + "doc", + "tests", + "setup.py" +] +ignore-setters = true [tool.coverage.run] branch = true +relative_files = true omit = [ "*site-packages*", "setup.py", - "tests/*" + "tests/unit/*" ] [tool.coverage.report] @@ -47,9 +65,12 @@ omit = [ "tests/*" ] +[tool.coverage.xml] +output = "report/coverage/coverage.xml" + +[tool.coverage.json] +output = "report/coverage/coverage.json" + [tool.coverage.html] directory = "report/coverage/html" title="Code Coverage of pySystemRDLModel" - -[tool.coverage.xml] -output = "report/coverage/coverage.xml" diff --git a/requirements.txt b/requirements.txt index 013cc1f..ce027df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyTooling >= 5.0.0, <6.0 +pyTooling ~= 7.0 diff --git a/setup.py b/setup.py index 98a423e..eeba717 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2023-2023 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2023-2024 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. # @@ -29,6 +29,8 @@ # ==================================================================================================================== # # """Package installer for 'An abstract SystemRDL language model'.""" +from setuptools import setup + from pathlib import Path from pyTooling.Packaging import DescribePythonPackageHostedOnGitHub, DEFAULT_CLASSIFIERS @@ -37,7 +39,7 @@ packageDirectory = packageName packageInformationFile = Path(f"{packageDirectory}/__init__.py") -DescribePythonPackageHostedOnGitHub( +setup(**DescribePythonPackageHostedOnGitHub( packageName=packageName, description="An abstract SystemRDL language model.", gitHubNamespace=gitHubNamespace, @@ -48,5 +50,8 @@ "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Compilers" - ] -) + ], + dataFiles={ + packageName: ["py.typed"] + } +)) diff --git a/tests/requirements.txt b/tests/requirements.txt index 6904298..2ad659b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,13 +1,13 @@ -r ../requirements.txt # Coverage collection -Coverage >= 7.3 +Coverage ~= 7.6 # Test Runner -pytest >= 7.4.0 -pytest-cov >= 4.1.0 +pytest ~= 8.3 +pytest-cov ~= 6.0 # Static Type Checking -mypy >= 1.5 -typing_extensions >= 4.7.1 -lxml>=4.9 +mypy ~= 1.13 +typing_extensions ~= 4.12 +lxml ~= 5.3 diff --git a/tests/unit/Instantiate.py b/tests/unit/Instantiate.py index 5128fb8..2aee1aa 100644 --- a/tests/unit/Instantiate.py +++ b/tests/unit/Instantiate.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2023-2023 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2023-2024 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. # @@ -41,7 +41,7 @@ class SysRDLVersion(TestCase): - def test_Any(self): + def test_Any(self) -> None: versions = ( SystemRDLVersion.Parse(-1), SystemRDLVersion.Parse("Any"), @@ -54,7 +54,7 @@ def test_Any(self): print(version) print(version.value) - def test_2005(self): + def test_2005(self) -> None: versions = ( SystemRDLVersion.Parse(5), SystemRDLVersion.Parse(2005), @@ -69,7 +69,7 @@ def test_2005(self): print(version) print(version.value) - def test_2009(self): + def test_2009(self) -> None: versions = ( SystemRDLVersion.Parse(9), SystemRDLVersion.Parse(2009), @@ -84,7 +84,7 @@ def test_2009(self): print(version) print(version.value) - def test_2012(self): + def test_2012(self) -> None: versions = ( SystemRDLVersion.Parse(12), SystemRDLVersion.Parse(2012), @@ -99,7 +99,7 @@ def test_2012(self): print(version) print(version.value) - def test_2017(self): + def test_2017(self) -> None: versions = ( SystemRDLVersion.Parse(17), SystemRDLVersion.Parse(2017), @@ -114,14 +114,14 @@ def test_2017(self): print(version) print(version.value) - def test_IntError(self): + def test_IntError(self) -> None: with self.assertRaises(ValueError): _ = SystemRDLVersion.Parse(0) with self.assertRaises(ValueError): _ = SystemRDLVersion.Parse(13) - def test_StrError(self): + def test_StrError(self) -> None: with self.assertRaises(ValueError): _ = SystemRDLVersion.Parse("0") diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index d2b2394..ded5a7b 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2023-2023 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2023-2024 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/unit/requirements.txt b/tests/unit/requirements.txt new file mode 100644 index 0000000..3c8d7e7 --- /dev/null +++ b/tests/unit/requirements.txt @@ -0,0 +1 @@ +-r ../requirements.txt