From ace3d05032cb8d8c00cbeb5cba9564d7de756b16 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 9 Jan 2022 22:44:03 +0100 Subject: [PATCH 01/27] Bumped version to v0.3.0. --- pyEDAA/ToolSetup/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyEDAA/ToolSetup/__init__.py b/pyEDAA/ToolSetup/__init__.py index 8b6d6905..085c7d57 100644 --- a/pyEDAA/ToolSetup/__init__.py +++ b/pyEDAA/ToolSetup/__init__.py @@ -33,7 +33,7 @@ __email__ = "Paebbels@gmail.com" __copyright__ = "2014-2021, Patrick Lehmann" __license__ = "Apache License, Version 2.0" -__version__ = "0.2.0" +__version__ = "0.3.0" __keywords__ = ["configuration", "eda", "installation", "selection"] From a64d8dbf4e40bb663bc57ec3aa2df004168cf753 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 16 Jan 2022 21:52:23 +0100 Subject: [PATCH 02/27] ci/Params: override python_version_list, since 3.6 was deprecated in pyTooling/Actions --- .github/workflows/Pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 15277cff..7a51b590 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -13,6 +13,7 @@ jobs: with: name: pyEDAA.ToolSetup system_list: 'ubuntu windows macos' + python_version_list: "3.6 3.7 3.8 3.9 3.10" UnitTesting: uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r0 @@ -122,15 +123,18 @@ jobs: with: package: ${{ fromJson(needs.Params.outputs.params).artifacts.package }} remaining: | + ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.6 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.7 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.8 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.9 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.10 + ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.6 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.7 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.8 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.9 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.10 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-msys2-3.9 + ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.6 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.7 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.8 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.9 From ea93e878ebf69351c95d56f22f4d4e572682d3fb Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 16 Jan 2022 22:55:38 +0100 Subject: [PATCH 03/27] ci/UnitTesting: override pacboy packages --- .github/workflows/Pipeline.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 7a51b590..e61a0f25 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -22,6 +22,13 @@ jobs: with: jobs: ${{ needs.Params.outputs.python_jobs }} artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }} + pacboy: >- + python-pip:p + python-wheel:p + python-coverage:p + python-lxml:p + python-ruamel-yaml:p + python-ruamel.yaml.clib:p Coverage: uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@r0 From 23cf9d9f8ebc56538080093b0d492d272da5384a Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 16 Jan 2022 22:58:56 +0100 Subject: [PATCH 04/27] ci/Params: do not override system_list --- .github/workflows/Pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index e61a0f25..c1e73a9d 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -12,7 +12,6 @@ jobs: uses: pyTooling/Actions/.github/workflows/Parameters.yml@r0 with: name: pyEDAA.ToolSetup - system_list: 'ubuntu windows macos' python_version_list: "3.6 3.7 3.8 3.9 3.10" UnitTesting: From b8bf22620c94888406c7ff926ab835da100b5b89 Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 17 Jan 2022 01:45:41 +0100 Subject: [PATCH 05/27] bump dependencies --- doc/requirements.txt | 2 +- pyproject.toml | 2 +- requirements.txt | 2 +- tests/requirements.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 48fdad5f..da29f705 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ -r ../requirements.txt -pyTooling>=1.9.2 +pyTooling>=1.9.4 # Enforce latest version on ReadTheDocs sphinx>=4.3.0 diff --git a/pyproject.toml b/pyproject.toml index 4fbec4ea..24fd949a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "pyTooling >= 1.9.2", + "pyTooling >= 1.9.4", "setuptools >= 35.0.2", "wheel >= 0.29.0" ] diff --git a/requirements.txt b/requirements.txt index bda7c250..b72a3ac3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pyTooling[yaml]>=1.9.2 +pyTooling[yaml]>=1.9.4 pyTooling.TerminalUI>=1.5.6 pyAttributes>=2.5.0 diff --git a/tests/requirements.txt b/tests/requirements.txt index 71a1471d..e71c276a 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -9,4 +9,4 @@ pytest-cov>=3.0.0 # Static Type Checking mypy>=0.931 -lxml>=4.6.4 +lxml>=4.6 From 21ac5ae0952a72aeca43a8288b4ca095ed62026d Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 17 Jan 2022 01:56:44 +0100 Subject: [PATCH 06/27] ci/Params: do not override python_version_list, since 3.6 was deprecated in pyTooling/Actions --- .github/workflows/Pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index c1e73a9d..8d31cc48 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -12,7 +12,6 @@ jobs: uses: pyTooling/Actions/.github/workflows/Parameters.yml@r0 with: name: pyEDAA.ToolSetup - python_version_list: "3.6 3.7 3.8 3.9 3.10" UnitTesting: uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r0 From 1f95cf979f1d275fd48a329f58abb6cd89d22677 Mon Sep 17 00:00:00 2001 From: umarcor Date: Mon, 17 Jan 2022 02:04:00 +0100 Subject: [PATCH 07/27] ci/ArtifactCleanUp: it's not tested on 3.6 anymore --- .github/workflows/Pipeline.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 8d31cc48..032ce010 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -128,18 +128,15 @@ jobs: with: package: ${{ fromJson(needs.Params.outputs.params).artifacts.package }} remaining: | - ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.6 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.7 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.8 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.9 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.10 - ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.6 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.7 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.8 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.9 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.10 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-msys2-3.9 - ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.6 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.7 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.8 ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.9 From 10d82ff5e5821c29c8002a5cdac6e887a9824e4a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 25 Jan 2022 07:47:10 +0100 Subject: [PATCH 08/27] Bumped dependencies and minor repository updates. --- doc/Dependency.rst | 6 +++--- doc/coverage/index.rst | 4 ++++ doc/index.rst | 4 ++-- doc/typing/index.rst | 4 ++++ pyEDAA/ToolSetup/CLI/Configure.py | 2 +- pyEDAA/ToolSetup/CLI/__init__.py | 2 +- pyEDAA/ToolSetup/DataModel.py | 2 +- pyEDAA/ToolSetup/__init__.py | 4 ++-- setup.py | 2 +- tests/unit/DataModel.py | 2 +- tests/unit/YamlToDataModel.py | 2 +- tests/unit/__init__.py | 4 ++-- 12 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 doc/coverage/index.rst create mode 100644 doc/typing/index.rst diff --git a/doc/Dependency.rst b/doc/Dependency.rst index fe5b07e0..433072f5 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -27,7 +27,7 @@ pyEDAA.ToolSetup Package +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +===============================================================================+=============+======================================================================================================+========================================================================================================================================================+ -| `pyTooling[yaml] `__ | ≥1.9.2 | `Apache License, 2.0 `__ | * `ruamel.yaml `__ (`MIT `__) | +| `pyTooling[yaml] `__ | ≥1.9.4 | `Apache License, 2.0 `__ | * `ruamel.yaml `__ (`MIT `__) | +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | `pyTooling.TerminalUI `__ | ≥1.5.6 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | | | | | * `colorama `__ (`BSD-3-Clause `__) | @@ -97,7 +97,7 @@ the mandatory dependencies too. +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=================================================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥1.9.2 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥1.9.4 | `Apache License, 2.0 `__ | *None* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `Sphinx `__ | ≥4.3.0 | `BSD 3-Clause `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -133,7 +133,7 @@ install the mandatory dependencies too. +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +============================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥1.9.2 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥1.9.4 | `Apache License, 2.0 `__ | *None* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `wheel `__ | any | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/doc/coverage/index.rst b/doc/coverage/index.rst new file mode 100644 index 00000000..80bbad2e --- /dev/null +++ b/doc/coverage/index.rst @@ -0,0 +1,4 @@ +Coverage Report +############### + +*Placeholder for the Coverage report generated with* ``pytest`` *and* ``coverage``. diff --git a/doc/index.rst b/doc/index.rst index 7609300d..f877c23b 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -141,8 +141,8 @@ License :caption: Appendix :hidden: - Coverage Report ➚ - Static Type Check Report ➚ + Coverage Report ➚ + Static Type Check Report ➚ License Doc-License Glossary diff --git a/doc/typing/index.rst b/doc/typing/index.rst new file mode 100644 index 00000000..97d4ae2a --- /dev/null +++ b/doc/typing/index.rst @@ -0,0 +1,4 @@ +Static Type Checking Report +########################### + +*Placeholder for the Static Type Checking report generated with* ``mypy``. diff --git a/pyEDAA/ToolSetup/CLI/Configure.py b/pyEDAA/ToolSetup/CLI/Configure.py index a0452cff..2dcf0ce9 100644 --- a/pyEDAA/ToolSetup/CLI/Configure.py +++ b/pyEDAA/ToolSetup/CLI/Configure.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2014-2021 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2014-2022 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/pyEDAA/ToolSetup/CLI/__init__.py b/pyEDAA/ToolSetup/CLI/__init__.py index b08f1ae1..56ea2ae8 100644 --- a/pyEDAA/ToolSetup/CLI/__init__.py +++ b/pyEDAA/ToolSetup/CLI/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2014-2021 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2014-2022 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/pyEDAA/ToolSetup/DataModel.py b/pyEDAA/ToolSetup/DataModel.py index d00bc3dc..26df066a 100644 --- a/pyEDAA/ToolSetup/DataModel.py +++ b/pyEDAA/ToolSetup/DataModel.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2021-2021 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2021-2022 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/pyEDAA/ToolSetup/__init__.py b/pyEDAA/ToolSetup/__init__.py index 085c7d57..113538a0 100644 --- a/pyEDAA/ToolSetup/__init__.py +++ b/pyEDAA/ToolSetup/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2014-2021 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2014-2022 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,7 +31,7 @@ """Package to support configuring EDA tools for usage with pyEDAA.CLITool.""" __author__ = "Patrick Lehmann" __email__ = "Paebbels@gmail.com" -__copyright__ = "2014-2021, Patrick Lehmann" +__copyright__ = "2014-2022, Patrick Lehmann" __license__ = "Apache License, Version 2.0" __version__ = "0.3.0" __keywords__ = ["configuration", "eda", "installation", "selection"] diff --git a/setup.py b/setup.py index 3a4312f0..45491402 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2014-2021 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2014-2022 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/DataModel.py b/tests/unit/DataModel.py index 8decc6c8..71ee6c4f 100644 --- a/tests/unit/DataModel.py +++ b/tests/unit/DataModel.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2021-2021 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2021-2022 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/YamlToDataModel.py b/tests/unit/YamlToDataModel.py index 9983cd8f..910b6edc 100644 --- a/tests/unit/YamlToDataModel.py +++ b/tests/unit/YamlToDataModel.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2021-2021 Patrick Lehmann - Boetzingen, Germany # +# Copyright 2021-2022 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/__init__.py b/tests/unit/__init__.py index 98f5fed3..9fb02328 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -11,7 +11,7 @@ # # # License: # # ==================================================================================================================== # -# Copyright 2017-2021 Patrick Lehmann - Bötzingen, Germany # +# Copyright 2017-2022 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. # @@ -31,6 +31,6 @@ """ Helper classes for unit tests. -:copyright: Copyright 2007-2021 Patrick Lehmann - Bötzingen, Germany +:copyright: Copyright 2007-2022 Patrick Lehmann - Bötzingen, Germany :license: Apache License, Version 2.0 """ From 2604036fb0e8b63a93131cd69d7cc6dcfae09f5b Mon Sep 17 00:00:00 2001 From: umarcor Date: Sat, 19 Feb 2022 11:51:16 +0100 Subject: [PATCH 09/27] doc/index: fix list spacing --- doc/index.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index f877c23b..22471b50 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -61,13 +61,19 @@ Features ******** * Find tool installations: + * at default installation locations (based on operating system). + * in ``PATH``. + * via environment variables. + * Support multiple versions of the same tool. E.g. Vivado 2018.3, 2021.2 + * Support multiple variants of the same tool. E.g. ModelSim Altera Edition vs. ModelSim SE vs. QuestaSim + * Configuring a default version/variant per tool. From 840e16319061eab631da0ec0b6a6455c2632eb08 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 21 Feb 2022 22:25:28 +0100 Subject: [PATCH 10/27] Restructured configuration classes. --- pyEDAA/ToolSetup/Aldec/__init__.py | 31 +++++ pyEDAA/ToolSetup/IntelFPGA/__init__.py | 30 +++++ pyEDAA/ToolSetup/Lattice/__init__.py | 33 +++++ pyEDAA/ToolSetup/OpenSource/GHDL.py | 20 +++ pyEDAA/ToolSetup/OpenSource/GTKWave.py | 8 ++ pyEDAA/ToolSetup/OpenSource/__init__.py | 25 ++++ pyEDAA/ToolSetup/SiemensEDA/__init__.py | 34 +++++ pyEDAA/ToolSetup/SystemTools/__init__.py | 21 +++ pyEDAA/ToolSetup/Xilinx/__init__.py | 51 ++++++++ pyEDAA/ToolSetup/__init__.py | 159 +++++------------------ 10 files changed, 286 insertions(+), 126 deletions(-) create mode 100644 pyEDAA/ToolSetup/Aldec/__init__.py create mode 100644 pyEDAA/ToolSetup/IntelFPGA/__init__.py create mode 100644 pyEDAA/ToolSetup/Lattice/__init__.py create mode 100644 pyEDAA/ToolSetup/OpenSource/GHDL.py create mode 100644 pyEDAA/ToolSetup/OpenSource/GTKWave.py create mode 100644 pyEDAA/ToolSetup/OpenSource/__init__.py create mode 100644 pyEDAA/ToolSetup/SiemensEDA/__init__.py create mode 100644 pyEDAA/ToolSetup/SystemTools/__init__.py create mode 100644 pyEDAA/ToolSetup/Xilinx/__init__.py diff --git a/pyEDAA/ToolSetup/Aldec/__init__.py b/pyEDAA/ToolSetup/Aldec/__init__.py new file mode 100644 index 00000000..dd92be19 --- /dev/null +++ b/pyEDAA/ToolSetup/Aldec/__init__.py @@ -0,0 +1,31 @@ +from typing import Dict + +from pyTooling.Decorators import export + +from .. import Tool, Vendor + + +@export +class ActiveHDL(Tool): + pass + + +@export +class RivieraPRO(Tool): + pass + + +@export +class Aldec(Vendor): + _toolClasses: Dict[str, Tool] = { + "Active-HDL": ActiveHDL, + "Riviera-PRO": RivieraPRO, + } + + @property + def ActiveHDL(self) -> ActiveHDL: + return self.__getitem__("Active-HDL") + + @property + def RivieraPRO(self) -> RivieraPRO: + return self.__getitem__("Riviera-PRO") diff --git a/pyEDAA/ToolSetup/IntelFPGA/__init__.py b/pyEDAA/ToolSetup/IntelFPGA/__init__.py new file mode 100644 index 00000000..a2176c55 --- /dev/null +++ b/pyEDAA/ToolSetup/IntelFPGA/__init__.py @@ -0,0 +1,30 @@ +from typing import Dict + +from pyTooling.Decorators import export + +from .. import Tool, Vendor +from ..SiemensEDA import ModelSim + + +@export +class Quartus(Tool): + pass + + +@export +class IntelFPGA(Vendor): + _toolClasses: Dict[str, Tool] = { + "Quartus": Quartus, + "ModelSim": ModelSim, + } + + @property + def Quartus(self) -> Quartus: + return self.__getitem__("Quartus") + + @property + def ModelSim(self) -> ModelSim: + return self.__getitem__("ModelSim") + + +Altera = IntelFPGA diff --git a/pyEDAA/ToolSetup/Lattice/__init__.py b/pyEDAA/ToolSetup/Lattice/__init__.py new file mode 100644 index 00000000..0e4cd464 --- /dev/null +++ b/pyEDAA/ToolSetup/Lattice/__init__.py @@ -0,0 +1,33 @@ +from typing import Dict + +from pyTooling.Decorators import export + +from .. import Tool, Vendor +from ..Aldec import ActiveHDL +from ..SiemensEDA import ModelSim + + +@export +class Diamond(Tool): + pass + + +@export +class Lattice(Vendor): + _toolClasses: Dict[str, Tool] = { + "Diamond": Diamond, + "Active-HDL": ActiveHDL, + "ModelSim": ModelSim, + } + + @property + def Diamond(self) -> Diamond: + return self.__getitem__("Diamond") + + @property + def ActiveHDL(self) -> ActiveHDL: + return self.__getitem__("Active-HDL") + + @property + def ModelSim(self) -> ModelSim: + return self.__getitem__("ModelSim") diff --git a/pyEDAA/ToolSetup/OpenSource/GHDL.py b/pyEDAA/ToolSetup/OpenSource/GHDL.py new file mode 100644 index 00000000..339b123f --- /dev/null +++ b/pyEDAA/ToolSetup/OpenSource/GHDL.py @@ -0,0 +1,20 @@ +from pathlib import Path +from re import compile as re_compile + +from pyTooling.Decorators import export + +from pyEDAA.ToolSetup import Tool, ToolInstance + + +@export +class GHDL(Tool): + pass + + +@export +class GHDLInstance(ToolInstance): + _backend: str + + @property + def Backend(self) -> str: + return self._backend diff --git a/pyEDAA/ToolSetup/OpenSource/GTKWave.py b/pyEDAA/ToolSetup/OpenSource/GTKWave.py new file mode 100644 index 00000000..03e8d773 --- /dev/null +++ b/pyEDAA/ToolSetup/OpenSource/GTKWave.py @@ -0,0 +1,8 @@ +from pyTooling.Decorators import export + +from pyEDAA.ToolSetup import Tool + + +@export +class GTKWave(Tool): + pass diff --git a/pyEDAA/ToolSetup/OpenSource/__init__.py b/pyEDAA/ToolSetup/OpenSource/__init__.py new file mode 100644 index 00000000..cd6c9bf4 --- /dev/null +++ b/pyEDAA/ToolSetup/OpenSource/__init__.py @@ -0,0 +1,25 @@ +from typing import Dict + +from pyTooling.Decorators import export + +from .. import Vendor, Tool +from ..OpenSource.GHDL import GHDL +from ..OpenSource.GTKWave import GTKWave + + +@export +class OpenSource(Vendor): + _vendorName = "Open Source" + _vendorKey = "OpenSource" + _toolClasses: Dict[str, Tool] = { + "GHDL": GHDL, + "GTKWave": GTKWave, + } + + @property + def GHDL(self) -> GHDL: + return self.__getitem__("GHDL") + + @property + def GTKWave(self) -> GTKWave: + return self.__getitem__("GTKWave") diff --git a/pyEDAA/ToolSetup/SiemensEDA/__init__.py b/pyEDAA/ToolSetup/SiemensEDA/__init__.py new file mode 100644 index 00000000..7228ed86 --- /dev/null +++ b/pyEDAA/ToolSetup/SiemensEDA/__init__.py @@ -0,0 +1,34 @@ +from typing import Dict + +from pyTooling.Decorators import export + +from .. import Tool, Vendor + + +@export +class ModelSim(Tool): + pass + + +@export +class QuestaSim(Tool): + pass + + +@export +class SiemensEDA(Vendor): + _toolClasses: Dict[str, Tool] = { + "ModelSim": ModelSim, + "QuestaSim": QuestaSim, + } + + @property + def ModelSim(self) -> ModelSim: + return self.__getitem__("ModelSim") + + @property + def QuestaSim(self) -> QuestaSim: + return self.__getitem__("QuestaSim") + + +MentorGraphics = SiemensEDA diff --git a/pyEDAA/ToolSetup/SystemTools/__init__.py b/pyEDAA/ToolSetup/SystemTools/__init__.py new file mode 100644 index 00000000..84d4bcde --- /dev/null +++ b/pyEDAA/ToolSetup/SystemTools/__init__.py @@ -0,0 +1,21 @@ +from typing import Dict + +from pyTooling.Decorators import export + +from .. import Tool, Vendor + + +@export +class Git(Tool): + pass + + +@export +class SystemTools(Vendor): + _toolClasses: Dict[str, Tool] = { + "Git": Git, + } + + @property + def Git(self) -> Git: + return self.__getitem__("Git") diff --git a/pyEDAA/ToolSetup/Xilinx/__init__.py b/pyEDAA/ToolSetup/Xilinx/__init__.py new file mode 100644 index 00000000..ff2dacde --- /dev/null +++ b/pyEDAA/ToolSetup/Xilinx/__init__.py @@ -0,0 +1,51 @@ +from typing import Dict + +from pyTooling.Decorators import export + +from .. import Tool, Vendor + + +@export +class ISE(Tool): + pass + + +@export +class Vivado(Tool): + pass + + +@export +class VivadoSDK(Tool): + pass + + +@export +class Vitis(Tool): + pass + + +@export +class Xilinx(Vendor): + _toolClasses: Dict[str, Tool] = { + "ISE": ISE, + "Vivado": Vivado, + "VivadoSDK": VivadoSDK, + "Vitis": Vitis, + } + + @property + def ISE(self) -> ISE: + return self.__getitem__("ISE") + + @property + def Vivado(self) -> Vivado: + return self.__getitem__("Vivado") + + @property + def VivadoSDK(self) -> VivadoSDK: + return self.__getitem__("Vivado-SDK") + + @property + def Vitis(self) -> Vitis: + return self.__getitem__("Vitis") diff --git a/pyEDAA/ToolSetup/__init__.py b/pyEDAA/ToolSetup/__init__.py index 113538a0..bf06eafd 100644 --- a/pyEDAA/ToolSetup/__init__.py +++ b/pyEDAA/ToolSetup/__init__.py @@ -85,16 +85,6 @@ def _LoadVariant(self, key: str) -> ToolInstance: return instance -@export -class ActiveHDL(Tool): - pass - - -@export -class RivieraPRO(Tool): - pass - - @export class Vendor(DM_Vendor, ConfigurationMixIn): _toolClasses: ClassVar[Dict[str, Tool]] @@ -114,105 +104,18 @@ def _LoadTool(self, key: str) -> Tool: return tool -@export -class Aldec(Vendor): - _toolClasses: Dict[str, Tool] = { - "Active-HDL": ActiveHDL, - "Riviera-PRO": RivieraPRO, - } - - @property - def ActiveHDL(self) -> Tool: - return self.__getitem__("Active-HDL") - - @property - def RivieraPRO(self) -> Tool: - return self.__getitem__("Riviera-PRO") - - -@export -class Altera(Vendor): - @property - def Quartus(self) -> Tool: - return self.__getitem__("Quartus") - - @property - def ModelSim(self) -> Tool: - return self.__getitem__("ModelSim") - - -@export -class IntelFPGA(Vendor): - @property - def Quartus(self) -> Tool: - return self.__getitem__("Quartus") - - @property - def ModelSim(self) -> Tool: - return self.__getitem__("ModelSim") - - -@export -class Lattice(Vendor): - @property - def Diamond(self) -> Tool: - return self.__getitem__("Diamond") - - @property - def ActiveHDL(self) -> Tool: - return self.__getitem__("Active-HDL") - - -@export -class MentorGraphics(Vendor): - @property - def ModelSim(self) -> Tool: - return self.__getitem__("ModelSim") - - @property - def QuestaSim(self) -> Tool: - return self.__getitem__("QuestaSim") - - -@export -class Xilinx(Vendor): - @property - def ISE(self) -> Tool: - return self.__getitem__("ISE") - - @property - def Vivado(self) -> Tool: - return self.__getitem__("Vivado") - - @property - def VivadoSDK(self) -> Tool: - return self.__getitem__("Vivado-SDK") - - @property - def Vitis(self) -> Tool: - return self.__getitem__("Vitis") - - -@export -class SystemTools(Vendor): - @property - def Git(self) -> Tool: - return self.__getitem__("Git") - - -@export -class OpenSource(Vendor): - @property - def GHDL(self) -> Tool: - return self.__getitem__("GHDL") - - @property - def GTKWave(self) -> Tool: - return self.__getitem__("GTKWave") - - @export class Installations(DM_Installation): + from .Aldec import ActiveHDL, RivieraPRO, Aldec + from .OpenSource.GHDL import GHDL + from .IntelFPGA import Quartus, Altera, IntelFPGA + from .Lattice import Diamond, Lattice + from .OpenSource import OpenSource + from .OpenSource.GTKWave import GTKWave + from .SiemensEDA import ModelSim, QuestaSim, MentorGraphics + from .SystemTools import Git, SystemTools + from .Xilinx import ISE, Vivado, VivadoSDK, Vitis, Xilinx + _config: Configuration _vendorClasses: Dict[str, Vendor] = { "Aldec": Aldec, @@ -237,69 +140,73 @@ def _LoadVendor(self, key: str) -> Vendor: return vendor @property - def Aldec(self) -> Vendor: + def Aldec(self) -> Aldec: return self.__getitem__("Aldec") @property - def Altera(self) -> Vendor: + def Altera(self) -> Altera: return self.__getitem__("Altera") @property - def IntelFPGA(self) -> Vendor: + def IntelFPGA(self) -> IntelFPGA: return self.__getitem__("IntelFPGA") @property - def Lattice(self) -> Vendor: + def Lattice(self) -> Lattice: return self.__getitem__("Lattice") @property - def MentorGraphics(self) -> Vendor: + def MentorGraphics(self) -> MentorGraphics: return self.__getitem__("MentorGraphics") @property - def Xilinx(self) -> Vendor: - return self.__getitem__("Xilinx") + def OpenSource(self) -> OpenSource: + return self.__getitem__("OpenSource") @property - def SystemTools(self) -> Vendor: + def SiemensEDA(self) -> SiemensEDA: + return self.__getitem__("SiemensEDA") + + @property + def SystemTools(self) -> SystemTools: return self.__getitem__("SystemTools") @property - def OpenSource(self) -> Vendor: - return self.__getitem__("OpenSource") + def Xilinx(self) -> Xilinx: + return self.__getitem__("Xilinx") @property - def ActiveHDL(self) -> ToolInstance: + def ActiveHDL(self) -> ActiveHDL: raise NotImplementedError() @property - def RivieraPRO(self) -> ToolInstance: + def RivieraPRO(self) -> RivieraPRO: raise NotImplementedError() @property - def Diamond(self) -> ToolInstance: + def Diamond(self) -> Diamond: raise NotImplementedError() @property - def Quartus(self) -> ToolInstance: + def Quartus(self) -> Quartus: raise NotImplementedError() @property - def ModelSim(self) -> ToolInstance: + def ModelSim(self) -> ModelSim: raise NotImplementedError() @property - def QuestaSim(self) -> ToolInstance: + def QuestaSim(self) -> QuestaSim: raise NotImplementedError() @property - def Vivado(self) -> ToolInstance: + def Vivado(self) -> Vivado: raise NotImplementedError() @property - def VivadoSDK(self) -> ToolInstance: + def VivadoSDK(self) -> VivadoSDK: raise NotImplementedError() @property - def Vitis(self) -> ToolInstance: + def Vitis(self) -> Vitis: raise NotImplementedError() From 4fc9a953fad301ecedc1684d96fe80f56657b865 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 22 Feb 2022 13:42:29 +0100 Subject: [PATCH 11/27] Better loading from YAML. Default handling. --- pyEDAA/ToolSetup/DataModel.py | 35 ++++++++++- pyEDAA/ToolSetup/OpenSource/GHDL.py | 47 ++++++++++++--- pyEDAA/ToolSetup/__init__.py | 92 ++++++++++++++++++++++------- tests/configuration.yml | 32 +++++++--- 4 files changed, 168 insertions(+), 38 deletions(-) diff --git a/pyEDAA/ToolSetup/DataModel.py b/pyEDAA/ToolSetup/DataModel.py index 26df066a..52476b8e 100644 --- a/pyEDAA/ToolSetup/DataModel.py +++ b/pyEDAA/ToolSetup/DataModel.py @@ -30,7 +30,7 @@ # """Abstract data model for tool configurations.""" from pathlib import Path -from typing import Optional as Nullable, Dict +from typing import Optional as Nullable, Dict, ClassVar, Type from pyTooling.Decorators import export @@ -94,14 +94,18 @@ def Tool(self) -> "Tool": class Tool: _vendor: Nullable["Vendor"] _name: str + _allLoaded: bool _variants: Dict[str, ToolInstance] + _instanceClass: ClassVar[Type[ToolInstance]] def __init__(self, name: str, parent: "Vendor" = None): self._vendor = parent self._name = name + self._allLoaded = False self._variants = {} def __contains__(self, key: str) -> bool: + self._LoadAllVariants() return key in self._variants def __getitem__(self, key: str) -> ToolInstance: @@ -114,23 +118,38 @@ def __getitem__(self, key: str) -> ToolInstance: def Vendor(self) -> "Vendor": return self._vendor + @property + def Variants(self) -> Dict[str, ToolInstance]: + self._LoadAllVariants() + return self._variants + + @property + def Default(self) -> ToolInstance: + raise NotImplementedError() + def _LoadVariant(self, key: str) -> ToolInstance: raise NotImplementedError() + def _LoadAllVariants(self) -> None: + raise NotImplementedError() + @export class Vendor(VendorInformation): _installation: Nullable["Installation"] _name: str + _allLoaded: bool _tools: Dict[str, Tool] def __init__(self, name: str, installationDirectory: Path, parent: "Installation" = None): super().__init__(installationDirectory) self._installation = parent self._name = name + self._allLoaded = False self._tools = {} def __contains__(self, key: str) -> bool: + self._LoadAllTools() return key in self._tools def __getitem__(self, key: str) -> Tool: @@ -142,19 +161,30 @@ def __getitem__(self, key: str) -> Tool: def _LoadTool(self, key: str) -> Tool: raise NotImplementedError() + def _LoadAllTools(self) -> None: + raise NotImplementedError() + @property def Installation(self) -> "Installation": return self._installation + @property + def Tools(self) -> Dict[str, Tool]: + self._LoadAllTools() + return self._tools + @export class Installation: + _allLoaded: bool _vendors: Dict[str, Vendor] def __init__(self): + self._allLoaded = False self._vendors = {} def __contains__(self, key: str) -> bool: + self._LoadAllVendors() return key in self._vendor def __getitem__(self, key: str) -> Vendor: @@ -165,3 +195,6 @@ def __getitem__(self, key: str) -> Vendor: def _LoadVendor(self, key: str) -> Vendor: raise NotImplementedError() + + def _LoadAllVendors(self) -> None: + raise NotImplementedError() diff --git a/pyEDAA/ToolSetup/OpenSource/GHDL.py b/pyEDAA/ToolSetup/OpenSource/GHDL.py index 339b123f..efd95085 100644 --- a/pyEDAA/ToolSetup/OpenSource/GHDL.py +++ b/pyEDAA/ToolSetup/OpenSource/GHDL.py @@ -1,20 +1,51 @@ -from pathlib import Path -from re import compile as re_compile +from typing import cast from pyTooling.Decorators import export +from pyTooling.Configuration.YAML import Dictionary -from pyEDAA.ToolSetup import Tool, ToolInstance - - -@export -class GHDL(Tool): - pass +from .. import Tool, ToolInstance +from pyEDAA.CLITool.GHDL import GHDL as CLI_GHDL @export class GHDLInstance(ToolInstance): + _platform: str + _runtime: str _backend: str + def __init__(self, config: Dictionary, parent: 'GHDL'): + super().__init__(config, parent) + + self._platform = config["Platform"] + self._runtime = config["Runtime"] + self._backend = config["Backend"] + + @property + def Platform(self) -> str: + """Platform GHDL runs on: ``win32``, ``win64``, ``lin64``.""" + return self._platform + + @property + def Runtime(self) -> str: + """Runtime used to run GHDL: ``mingw32``, ``mingw64``, ``ucrt64``, ``gnatgpl32``, ``lin64``.""" + return self._runtime + @property def Backend(self) -> str: + """GHDL's backend (``mcode``, ``llvm`` or ``gcc``.""" return self._backend + + def GetGHDL(self) -> CLI_GHDL: + return CLI_GHDL(binaryDirectoryPath=self.BinaryDirectory) + + +@export +class GHDL(Tool): + _vendorKey = "OpenSource" #: Key of the parent node (vendor) in the configuration structure. + _key = "GHDL" #: Key used in the configuration structure. + + _instanceClass = GHDLInstance + + @property + def Default(self) -> GHDLInstance: + return cast(GHDLInstance, super().Default) diff --git a/pyEDAA/ToolSetup/__init__.py b/pyEDAA/ToolSetup/__init__.py index bf06eafd..02fbff27 100644 --- a/pyEDAA/ToolSetup/__init__.py +++ b/pyEDAA/ToolSetup/__init__.py @@ -38,11 +38,12 @@ from pathlib import Path -from typing import Dict, ClassVar +from typing import Dict, ClassVar, cast from pyTooling.Configuration import Dictionary from pyTooling.Decorators import export from pyTooling.Configuration.YAML import Configuration + from .DataModel import ( Installation as DM_Installation, Vendor as DM_Vendor, @@ -60,13 +61,13 @@ def __init__(self, config: Dictionary): @export class ToolInstance(DM_ToolInstance, ConfigurationMixIn): - def __init__(self, config: Dictionary, parent: "Vendor"): + def __init__(self, config: Dictionary, parent: "Tool"): name = config.Key - installationDirectory = config["InstallationDirectory"] - binaryDirectory = config["BinaryDirectory"] -# version = config["Version"] + installationDirectory = Path(config["InstallationDirectory"]) + binaryDirectory = Path(config["BinaryDirectory"]) + version = config["Version"] - super().__init__(installationDirectory, binaryDirectory, parent=parent) + super().__init__(installationDirectory, binaryDirectory, version, parent=parent) ConfigurationMixIn.__init__(self, config) @@ -78,12 +79,29 @@ def __init__(self, config: Dictionary, parent: "Vendor"): super().__init__(name, parent=parent) ConfigurationMixIn.__init__(self, config) + @property + def Default(self) -> ToolInstance: + return self._LoadVariant("Default") + def _LoadVariant(self, key: str) -> ToolInstance: - instance = ToolInstance(self._config[key], parent=self) - self._variants[key] = instance + if key not in self._variants: + instance = self._instanceClass(self._config[key], parent=self) + self._variants[key] = instance + else: + instance = self._variants[key] return instance + def _LoadAllVariants(self) -> None: + if self._allLoaded: + return + + for key in self._config: + if key not in self._variants: + self._variants[key] = ToolInstance(self._config[key], parent=self) + + self._allLoaded = True + @export class Vendor(DM_Vendor, ConfigurationMixIn): @@ -97,12 +115,26 @@ def __init__(self, config: Dictionary, parent: "Installations"): ConfigurationMixIn.__init__(self, config) def _LoadTool(self, key: str) -> Tool: - cls = self._toolClasses[key] - tool = cls(self._config[key], parent=self) - self._tools[key] = tool + if key not in self._tools: + cls = self._toolClasses[key] + tool = cls(self._config[key], parent=self) + self._tools[key] = tool + else: + tool = self._tools[key] return tool + def _LoadAllTools(self) -> None: + if self._allLoaded: + return + + for key in self._config: + if key not in self._tools: + cls = self._toolClasses[key] + self._tools[key] = cls(self._config[key], parent=self) + + self._allLoaded = True + @export class Installations(DM_Installation): @@ -139,41 +171,61 @@ def _LoadVendor(self, key: str) -> Vendor: return vendor + def _LoadAllVendors(self) -> None: + if self._allLoaded: + return + + for key in self._config["Installations"]: + if key not in self._vendors: + cls = self._vendorClasses[key] + self._vendors[key] = cls(self._config["Installations"][key], parent=self) + + self._allLoaded = True + @property def Aldec(self) -> Aldec: - return self.__getitem__("Aldec") + from .Aldec import Aldec + return cast(Aldec, self.__getitem__("Aldec")) @property def Altera(self) -> Altera: - return self.__getitem__("Altera") + from .IntelFPGA import Altera + return cast(Altera, self.__getitem__("Altera")) @property def IntelFPGA(self) -> IntelFPGA: - return self.__getitem__("IntelFPGA") + from .IntelFPGA import IntelFPGA + return cast(IntelFPGA, self.__getitem__("IntelFPGA")) @property def Lattice(self) -> Lattice: - return self.__getitem__("Lattice") + from .Lattice import Lattice + return cast(Lattice, self.__getitem__("Lattice")) @property def MentorGraphics(self) -> MentorGraphics: - return self.__getitem__("MentorGraphics") + from .SiemensEDA import MentorGraphics + return cast(MentorGraphics, self.__getitem__("MentorGraphics")) @property def OpenSource(self) -> OpenSource: - return self.__getitem__("OpenSource") + from .OpenSource import OpenSource + return cast(OpenSource, self.__getitem__("OpenSource")) @property def SiemensEDA(self) -> SiemensEDA: - return self.__getitem__("SiemensEDA") + from .SiemensEDA import SiemensEDA + return cast(SiemensEDA, self.__getitem__("SiemensEDA")) @property def SystemTools(self) -> SystemTools: - return self.__getitem__("SystemTools") + from .SystemTools import SystemTools + return cast(SystemTools, self.__getitem__("SystemTools")) @property def Xilinx(self) -> Xilinx: - return self.__getitem__("Xilinx") + from .Xilinx import Xilinx + return cast(Xilinx, self.__getitem__("Xilinx")) @property def ActiveHDL(self) -> ActiveHDL: diff --git a/tests/configuration.yml b/tests/configuration.yml index d961e1cb..6df3d414 100644 --- a/tests/configuration.yml +++ b/tests/configuration.yml @@ -118,13 +118,13 @@ Installations: InstallationDirectory: '${..:InstallationDirectory}\Riviera-PRO' Selection: - Version: '10.5d' + Version: '10.3' InstallationDirectory: '${..:${Version}:InstallationDirectory}' BinaryDirectory: '${..:${Version}:BinaryDirectory}' Edition: '${..:${Version}:Edition}' '10.3': - DiamondVersion: '3.8' + DiamondVersion: '10.3' InstallationDirectory: '${..:..:${DiamondVersion}:InstallationDirectory}\active-hdl' BinaryDirectory: '${InstallationDirectory}\BIN' Edition: 'Active-HDL Lattice Edition' @@ -205,19 +205,33 @@ Installations: ghdl: InstallationDirectory: '${..:InstallationDirectory}\GHDL' - '2.0.0-dev': - Version: '2.0.0-dev' - InstallationDirectory: '${..:InstallationDirectory}\${Version}' + Default: + Version: '2.0.0.dev0' + Platform: 'win32' + Runtime: 'mingw32' + Backend: 'mcode' + InstallationDirectory: '${..:${Version}-${Runtime}-${Backend}:InstallationDirectory}' + BinaryDirectory: '${..:${Version}-${Runtime}-${Backend}:BinaryDirectory}' + + '2.0.0.dev0-mingw32-mcode': + Version: '2.0.0.dev0' + Platform: 'win32' + Runtime: 'mingw32' + Backend: 'mcode' + InstallationDirectory: '${..:InstallationDirectory}\${Version}-${Runtime}-${Backend}' BinaryDirectory: '${InstallationDirectory}\bin' # ScriptDirectory: '${InstallationDirectory}\scripts' -# Backend: mcode -# Runtime: GTKWave: InstallationDirectory: '${..:InstallationDirectory}\GTKWave' - '3.3.78': - Version: '3.3.78' + Default: + Version: '3.3.111' + InstallationDirectory: '${..:${Version}:InstallationDirectory}' + BinaryDirectory: '${..:${Version}:BinaryDirectory}' + + '3.3.111': + Version: '3.3.111' InstallationDirectory: '${..:InstallationDirectory}\${Version}' BinaryDirectory: '${InstallationDirectory}\bin' From 59250f57768c8f720ced07d577f58e09c5345065 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 23 Feb 2022 00:11:45 +0100 Subject: [PATCH 12/27] Added HDLSimulator interface. --- pyEDAA/ToolSetup/OpenSource/GHDL.py | 54 ++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/pyEDAA/ToolSetup/OpenSource/GHDL.py b/pyEDAA/ToolSetup/OpenSource/GHDL.py index efd95085..a971c3f8 100644 --- a/pyEDAA/ToolSetup/OpenSource/GHDL.py +++ b/pyEDAA/ToolSetup/OpenSource/GHDL.py @@ -2,20 +2,23 @@ from pyTooling.Decorators import export from pyTooling.Configuration.YAML import Dictionary - -from .. import Tool, ToolInstance +from pyTooling.CLIAbstraction import Executable +from .. import Tool, ToolInstance +from ..Interface import HDLSimulator from pyEDAA.CLITool.GHDL import GHDL as CLI_GHDL @export -class GHDLInstance(ToolInstance): +class GHDLInstance(ToolInstance, HDLSimulator): _platform: str _runtime: str _backend: str + _ghdl: CLI_GHDL def __init__(self, config: Dictionary, parent: 'GHDL'): super().__init__(config, parent) + self._ghdl = None self._platform = config["Platform"] self._runtime = config["Runtime"] self._backend = config["Backend"] @@ -35,12 +38,35 @@ def Backend(self) -> str: """GHDL's backend (``mcode``, ``llvm`` or ``gcc``.""" return self._backend + def _CreateGHDLCLIInstance(self) -> CLI_GHDL: + if self._ghdl is None: + self._ghdl = CLI_GHDL(binaryDirectoryPath=self.BinaryDirectory) + return self._ghdl + def GetGHDL(self) -> CLI_GHDL: - return CLI_GHDL(binaryDirectoryPath=self.BinaryDirectory) + return self._CreateGHDLCLIInstance() + + # def GetLibraryCreator(self) -> Executable: + # raise NotImplementedError(f"") + # + # def GetLibraryMapper(self) -> Executable: + # raise NotImplementedError(f"") + # + # def GetLibraryDeleter(self) -> Executable: + # raise NotImplementedError(f"") + + def GetVHDLAnalyzer(self) -> Executable: + return self._CreateGHDLCLIInstance().GetGHDLAsAnalyzer() + + def GetEloborator(self) -> Executable: + return self._CreateGHDLCLIInstance().GetGHDLAsElaborator() + + def GetSimulator(self) -> Executable: + return self._CreateGHDLCLIInstance().GetGHDLAsSimulator() @export -class GHDL(Tool): +class GHDL(Tool, HDLSimulator): _vendorKey = "OpenSource" #: Key of the parent node (vendor) in the configuration structure. _key = "GHDL" #: Key used in the configuration structure. @@ -49,3 +75,21 @@ class GHDL(Tool): @property def Default(self) -> GHDLInstance: return cast(GHDLInstance, super().Default) + + # def GetLibraryCreator(self) -> Executable: + # raise NotImplementedError(f"") + # + # def GetLibraryMapper(self) -> Executable: + # raise NotImplementedError(f"") + # + # def GetLibraryDeleter(self) -> Executable: + # raise NotImplementedError(f"") + + def GetVHDLAnalyzer(self) -> Executable: + raise NotImplementedError(f"") + + def GetEloborator(self) -> Executable: + raise NotImplementedError(f"") + + def GetSimulator(self) -> Executable: + raise NotImplementedError(f"") From 73d8326385fce0c543862e72d701e60b9ff96935 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Feb 2022 08:16:56 +0100 Subject: [PATCH 13/27] Added VSCode configuration file. --- .vscode/settings.json | 3 +++ tests/configuration.yml | 1 + 2 files changed, 4 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..bc220501 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ +"files.trimTrailingWhitespace": false, +} diff --git a/tests/configuration.yml b/tests/configuration.yml index 6df3d414..f5a122e8 100644 --- a/tests/configuration.yml +++ b/tests/configuration.yml @@ -28,6 +28,7 @@ Installations: Version: '2021.04' InstallationDirectory: '${..:InstallationDirectory}\${Version}' BinaryDirectory: '${InstallationDirectory}\bin' + '2021.10': Version: '2021.10' InstallationDirectory: '${..:InstallationDirectory}\${Version}' From 54b6ed32e6ed3980c79691ce0574f162b73f6a7f Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Feb 2022 08:17:16 +0100 Subject: [PATCH 14/27] Added modified Jinja template for autoapi. --- doc/_templates/autoapi/module.rst | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 doc/_templates/autoapi/module.rst diff --git a/doc/_templates/autoapi/module.rst b/doc/_templates/autoapi/module.rst new file mode 100644 index 00000000..d41ca8ab --- /dev/null +++ b/doc/_templates/autoapi/module.rst @@ -0,0 +1,108 @@ +=={{ '=' * node.name|length }}== +``{{ node.name }}`` +=={{ '=' * node.name|length }}== + +.. #automodule:: {{ node.name }} + + .. contents:: + :local: +{##} +{%- block modules -%} +{%- if subnodes %} + +**Submodules** + + +.. toctree:: +{% for item in subnodes %} + {{ item.name }} +{%- endfor %} +{##} +{%- endif -%} +{%- endblock -%} +{##} +.. currentmodule:: {{ node.name }} +{##} +{%- block functions -%} +{%- if node.functions %} + +**Functions** + +{% for item, obj in node.functions.items() -%} +- :py:func:`{{ item }}`: + {{ obj|summary }} + +{% endfor -%} + +{% for item in node.functions %} +.. autofunction:: {{ item }} +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} + +{%- block classes -%} +{%- if node.classes %} + +**Classes** + +{% for item, obj in node.classes.items() -%} +- :py:class:`{{ item }}`: + {{ obj|summary }} + +{% endfor -%} + +{% for item in node.classes %} +.. autoclass:: {{ item }} + :members: + + .. rubric:: Inheritance + .. inheritance-diagram:: {{ item }} + :parts: 1 +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} + +{%- block exceptions -%} +{%- if node.exceptions %} + +**Exceptions** + +{% for item, obj in node.exceptions.items() -%} +- :py:exc:`{{ item }}`: + {{ obj|summary }} + +{% endfor -%} + +{% for item in node.exceptions %} +.. autoexception:: {{ item }} + + .. rubric:: Inheritance + .. inheritance-diagram:: {{ item }} + :parts: 1 +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} + +{%- block variables -%} +{%- if node.variables %} + +**Variables** + +{% for item, obj in node.variables.items() -%} +- :py:data:`{{ item }}` +{% endfor -%} + +{% for item, obj in node.variables.items() %} +.. autodata:: {{ item }} + :annotation: + + .. code-block:: text + + {{ obj|pprint|indent(6) }} +{##} +{%- endfor -%} +{%- endif -%} +{%- endblock -%} From 87bb31d87110ec46728e42e1acba1872b2235768 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Feb 2022 08:18:32 +0100 Subject: [PATCH 15/27] Fixed test cases. --- pyEDAA/ToolSetup/Aldec/__init__.py | 16 +++++++++++++--- pyEDAA/ToolSetup/Interface.py | 27 +++++++++++++++++++++++++++ tests/unit/YamlToDataModel.py | 4 ++-- 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 pyEDAA/ToolSetup/Interface.py diff --git a/pyEDAA/ToolSetup/Aldec/__init__.py b/pyEDAA/ToolSetup/Aldec/__init__.py index dd92be19..8afc91c3 100644 --- a/pyEDAA/ToolSetup/Aldec/__init__.py +++ b/pyEDAA/ToolSetup/Aldec/__init__.py @@ -2,19 +2,29 @@ from pyTooling.Decorators import export -from .. import Tool, Vendor +from .. import Vendor, Tool, ToolInstance @export -class ActiveHDL(Tool): +class ActiveHDLInstance(ToolInstance): pass @export -class RivieraPRO(Tool): +class RivieraPROInstance(ToolInstance): pass +@export +class ActiveHDL(Tool): + _instanceClass = ActiveHDLInstance + + +@export +class RivieraPRO(Tool): + _instanceClass = RivieraPROInstance + + @export class Aldec(Vendor): _toolClasses: Dict[str, Tool] = { diff --git a/pyEDAA/ToolSetup/Interface.py b/pyEDAA/ToolSetup/Interface.py new file mode 100644 index 00000000..05dad95b --- /dev/null +++ b/pyEDAA/ToolSetup/Interface.py @@ -0,0 +1,27 @@ +from pyTooling.Decorators import export + +from pyTooling.CLIAbstraction import Executable + + +@export +class HDLSimulator: + def GetLibraryCreator(self) -> Executable: + raise NotImplementedError(f"") + + def GetLibraryMapper(self) -> Executable: + raise NotImplementedError(f"") + + def GetLibraryDeleter(self) -> Executable: + raise NotImplementedError(f"") + + def GetVHDLAnalyzer(self) -> Executable: + raise NotImplementedError(f"") + + def GetVerilogCompiler(self) -> Executable: + raise NotImplementedError(f"") + + def GetEloborator(self) -> Executable: + raise NotImplementedError(f"") + + def GetSimulator(self) -> Executable: + raise NotImplementedError(f"") diff --git a/tests/unit/YamlToDataModel.py b/tests/unit/YamlToDataModel.py index 910b6edc..f40cb6a4 100644 --- a/tests/unit/YamlToDataModel.py +++ b/tests/unit/YamlToDataModel.py @@ -50,8 +50,8 @@ def test_AccessByNameAsIndex(self): activeHDLVersion = activeHDL["10.3"] self.assertIs(activeHDL, activeHDLVersion.Tool) - self.assertEqual(r"C:\Aldec\Active-HDL\10.3", activeHDLVersion.InstallationDirectory) - self.assertEqual(r"C:\Aldec\Active-HDL\10.3\bin", activeHDLVersion.BinaryDirectory) + self.assertEqual(r"C:\Aldec\Active-HDL\10.3", str(activeHDLVersion.InstallationDirectory)) + self.assertEqual(r"C:\Aldec\Active-HDL\10.3\bin", str(activeHDLVersion.BinaryDirectory)) # self.assertEqual(r"10.3", activeHDLVersion.Version) def test_AccessByProperty(self): From 113a1d5d5295b7a83a426597d9dcb76dd0cc5f77 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 1 Mar 2022 12:52:33 +0100 Subject: [PATCH 16/27] Bumped dependencies. --- .github/dependabot.yml | 2 +- .github/pull_request_template.md | 8 ++++++++ doc/Dependency.rst | 14 +++++++------- doc/index.rst | 4 +--- doc/requirements.txt | 6 +++--- pyproject.toml | 6 +++--- requirements.txt | 2 +- tests/requirements.txt | 4 ++-- 8 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0896e81d..bc1dfd59 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,7 @@ updates: commit-message: prefix: "[Dependabot]" labels: - - Dependencies + - Dependencies assignees: - Paebbels reviewers: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7a345ae6..ac698f89 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,8 +1,16 @@ # New Features + * tbd # Changes + * tbd # Bug Fixes + +* tbd + +---------- +# Related PRs: + * tbd diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 433072f5..620e11a2 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -27,7 +27,7 @@ pyEDAA.ToolSetup Package +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +===============================================================================+=============+======================================================================================================+========================================================================================================================================================+ -| `pyTooling[yaml] `__ | ≥1.9.4 | `Apache License, 2.0 `__ | * `ruamel.yaml `__ (`MIT `__) | +| `pyTooling[yaml] `__ | ≥1.9.5 | `Apache License, 2.0 `__ | * `ruamel.yaml `__ (`MIT `__) | +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | `pyTooling.TerminalUI `__ | ≥1.5.6 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | | | | | * `colorama `__ (`BSD-3-Clause `__) | @@ -61,7 +61,7 @@ the mandatory dependencies too. +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | **Package** | **Version** | **License** | **Dependencies** | +===========================================================+=============+========================================================================================+======================+ -| `pytest `__ | ≥6.2.5 | `MIT `__ | *Not yet evaluated.* | +| `pytest `__ | ≥7.0.1 | `MIT `__ | *Not yet evaluated.* | +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `pytest-cov `__ | ≥3.0.0 | `MIT `__ | *Not yet evaluated.* | +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ @@ -69,7 +69,7 @@ the mandatory dependencies too. +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `mypy `__ | ≥0.931 | `MIT `__ | *Not yet evaluated.* | +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `lxml `__ | ≥4.6.4 | `BSD 3-Clause `__ | *Not yet evaluated.* | +| `lxml `__ | ≥4.8 | `BSD 3-Clause `__ | *Not yet evaluated.* | +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ @@ -97,15 +97,15 @@ the mandatory dependencies too. +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=================================================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥1.9.4 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥1.9.5 | `Apache License, 2.0 `__ | *None* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `Sphinx `__ | ≥4.3.0 | `BSD 3-Clause `__ | *Not yet evaluated.* | +| `Sphinx `__ | ≥4.4.0 | `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.14.1 | `MIT `__ | *Not yet evaluated.* | +| `sphinx_autodoc_typehints `__ | ≥1.17.0 | `MIT `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -133,7 +133,7 @@ install the mandatory dependencies too. +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +============================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥1.9.4 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥1.9.5 | `Apache License, 2.0 `__ | *None* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `wheel `__ | any | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/doc/index.rst b/doc/index.rst index 22471b50..ebdba8f5 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -65,7 +65,7 @@ Features * at default installation locations (based on operating system). * in ``PATH``. - + * via environment variables. * Support multiple versions of the same tool. @@ -116,7 +116,6 @@ License Installation Dependency - .. raw:: latex \part{Main Documentation} @@ -128,7 +127,6 @@ License DataModel YAML - .. raw:: latex \part{References} diff --git a/doc/requirements.txt b/doc/requirements.txt index da29f705..fe32d144 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,12 +1,12 @@ -r ../requirements.txt -pyTooling>=1.9.4 +pyTooling>=1.9.5 # Enforce latest version on ReadTheDocs -sphinx>=4.3.0 +sphinx>=4.4.0 # Sphinx Extenstions sphinxcontrib-mermaid>=0.7.1 autoapi>=2.0.1 sphinx_fontawesome>=0.0.6 -sphinx_autodoc_typehints>=1.14.1 +sphinx_autodoc_typehints>=1.17.0 diff --git a/pyproject.toml b/pyproject.toml index 24fd949a..c8eb2c39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "pyTooling >= 1.9.4", - "setuptools >= 35.0.2", - "wheel >= 0.29.0" + "pyTooling >= 1.9.5", + "setuptools >= 60.9.3", + "wheel >= 0.37.1" ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index b72a3ac3..20828625 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pyTooling[yaml]>=1.9.4 +pyTooling[yaml]>=1.9.5 pyTooling.TerminalUI>=1.5.6 pyAttributes>=2.5.0 diff --git a/tests/requirements.txt b/tests/requirements.txt index e71c276a..0320e3aa 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,9 +4,9 @@ Coverage>=6.2 # Test Runner -pytest>=6.2.5 +pytest>=7.0.1 pytest-cov>=3.0.0 # Static Type Checking mypy>=0.931 -lxml>=4.6 +lxml>=4.8 From 09429e26d81e7ae1e8b9c7e9e58b31acd75e1743 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 1 Mar 2022 12:53:22 +0100 Subject: [PATCH 17/27] Added headline "Python Class Reference". --- doc/pyEDAA.ToolSetup/index.rst | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/pyEDAA.ToolSetup/index.rst diff --git a/doc/pyEDAA.ToolSetup/index.rst b/doc/pyEDAA.ToolSetup/index.rst new file mode 100644 index 00000000..3c578f0b --- /dev/null +++ b/doc/pyEDAA.ToolSetup/index.rst @@ -0,0 +1,8 @@ +Python Class Reference +###################### + +Reference of all packages and modules: + +.. toctree:: + + pyEDAA.ToolSetup From 3e8f8a898ef688be026f98fe347453208959e066 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 1 Mar 2022 12:59:24 +0100 Subject: [PATCH 18/27] Updated Sphinx configuration. --- doc/conf.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 2a402603..263655c8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,7 +14,6 @@ sys_path.insert(0, abspath('.')) sys_path.insert(0, abspath('..')) sys_path.insert(0, abspath('../pyEDAA/ToolSetup')) -#sys_path.insert(0, abspath('_extensions')) # ============================================================================== @@ -95,11 +94,11 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -html_logo = str(Path(html_static_path[0]) / "logo.svg") +html_logo = str(Path(html_static_path[0]) / "logo_on_dark.svg") html_favicon = str(Path(html_static_path[0]) / "favicon.svg") # Output file base name for HTML help builder. -htmlhelp_basename = 'pyEDAACLIToolDoc' +htmlhelp_basename = 'pyEDAAToolSetupDoc' # If not None, a 'Last updated on:' timestamp is inserted at every page # bottom, using the given strftime format. @@ -146,8 +145,8 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( master_doc, - 'pyEDAA.CLITool.tex', - 'The pyEDAA.CLITool Documentation', + 'pyEDAA.ToolSetup.tex', + 'The pyEDAA.ToolSetup Documentation', 'Patrick Lehmann', 'manual' ), @@ -158,8 +157,22 @@ # Extensions # ============================================================================== extensions = [ +# Standard Sphinx extensions + "sphinx.ext.autodoc", 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx', + 'sphinx.ext.inheritance_diagram', + 'sphinx.ext.todo', + 'sphinx.ext.graphviz', + 'sphinx.ext.mathjax', + 'sphinx.ext.ifconfig', + 'sphinx.ext.viewcode', +# SphinxContrib extensions + 'sphinxcontrib.mermaid', +# Other extensions + 'sphinx_fontawesome', + 'sphinx_autodoc_typehints', + 'autoapi.sphinx', ] @@ -171,11 +184,49 @@ } +# ============================================================================== +# Sphinx.Ext.AutoDoc +# ============================================================================== +# see: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration +autodoc_default_options = { + "private-members": True, + "special-members": True, + "inherited-members": True, + "exclude-members": "__weakref__" +} +#autodoc_class_signature = "separated" +autodoc_member_order = "bysource" # alphabetical, groupwise, bysource +autodoc_typehints = "both" +#autoclass_content = "both" + + # ============================================================================== # Sphinx.Ext.ExtLinks # ============================================================================== extlinks = { - 'ghissue': ('https://GitHub.com/edaa-org/pyEDAA.CLITool/issues/%s', 'issue #'), - 'ghpull': ('https://GitHub.com/edaa-org/pyEDAA.CLITool/pull/%s', 'pull request #'), - 'ghsrc': ('https://GitHub.com/edaa-org/pyEDAA.CLITool/blob/main/%s', ''), + "ghissue": ("https://GitHub.com/edaa-org/pyEDAA.ToolSetup/issues/%s", "issue #"), + "ghpull": ("https://GitHub.com/edaa-org/pyEDAA.ToolSetup/pull/%s", "pull request #"), + "ghsrc": ("https://GitHub.com/edaa-org/pyEDAA.ToolSetup/blob/main/%s", ""), +} + + +# ============================================================================== +# Sphinx.Ext.Graphviz +# ============================================================================== +graphviz_output_format = "svg" + + +# ============================================================================== +# Sphinx.Ext.ToDo +# ============================================================================== +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True +todo_link_only = True + + +# ============================================================================== +# AutoAPI.Sphinx +# ============================================================================== +autoapi_modules = { + 'pyEDAA.ToolSetup': {'output': "pyEDAA.ToolSetup", "override": True} } From 61d0df2b715c3204baa9432a45e298fe20538f17 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 1 Mar 2022 15:55:23 +0100 Subject: [PATCH 19/27] Added missing package classifiers. And set package state. --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 45491402..ec725ec9 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ # """Package installer for 'EDA tool detection, configuration and selection layer'.""" from pathlib import Path -from pyTooling.Packaging import DescribePythonPackageHostedOnGitHub +from pyTooling.Packaging import DescribePythonPackageHostedOnGitHub, DEFAULT_CLASSIFIERS gitHubNamespace = "edaa-org" packageName = "pyEDAA.ToolSetup" @@ -42,4 +42,8 @@ description="EDA tool detection, configuration and selection layer.", gitHubNamespace=gitHubNamespace, sourceFileWithVersion=packageInformationFile, + developmentStatus="alpha", + classifiers=list(DEFAULT_CLASSIFIERS) + [ + "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)" + ], ) From 733948461f57edabe684fc800af3509d5f40cc3a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 1 Mar 2022 17:33:41 +0100 Subject: [PATCH 20/27] Added comment to autoapi template. --- doc/_templates/autoapi/module.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/_templates/autoapi/module.rst b/doc/_templates/autoapi/module.rst index d41ca8ab..5f9e361b 100644 --- a/doc/_templates/autoapi/module.rst +++ b/doc/_templates/autoapi/module.rst @@ -1,11 +1,11 @@ +.. # Template modified by Patrick Lehmann + * removed automodule on top, because private members are activated for autodoc (no doubled documentation). + * Made sections like 'submodules' bold text, but no headlines to reduce number of ToC levels. + =={{ '=' * node.name|length }}== ``{{ node.name }}`` =={{ '=' * node.name|length }}== -.. #automodule:: {{ node.name }} - - .. contents:: - :local: {##} {%- block modules -%} {%- if subnodes %} From 54b4cbf2cfacd7fd8dbbaea9c5e2d8caad307246 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 1 Mar 2022 18:22:48 +0100 Subject: [PATCH 21/27] Fixed banner file name. --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 263655c8..207ddb2d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -94,7 +94,7 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -html_logo = str(Path(html_static_path[0]) / "logo_on_dark.svg") +html_logo = str(Path(html_static_path[0]) / "logo.svg") html_favicon = str(Path(html_static_path[0]) / "favicon.svg") # Output file base name for HTML help builder. From dedd551d4916fa7de65f89e119fa56ec931df93a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 1 Mar 2022 22:30:54 +0100 Subject: [PATCH 22/27] Bumped coverage version to v6.3. --- doc/Dependency.rst | 2 +- tests/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 620e11a2..d959244e 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -65,7 +65,7 @@ the mandatory dependencies too. +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `pytest-cov `__ | ≥3.0.0 | `MIT `__ | *Not yet evaluated.* | +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `Coverage `__ | ≥6.2 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +| `Coverage `__ | ≥6.3 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `mypy `__ | ≥0.931 | `MIT `__ | *Not yet evaluated.* | +-----------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ diff --git a/tests/requirements.txt b/tests/requirements.txt index 0320e3aa..f861877e 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,7 +1,7 @@ -r ../requirements.txt # Coverage collection -Coverage>=6.2 +Coverage>=6.3 # Test Runner pytest>=7.0.1 From c4b1f3a48166d7d85a7a4fc21cdc1dc45734373c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 3 Mar 2022 11:55:10 +0100 Subject: [PATCH 23/27] Added dependabot rule for GH actions and bumped dependencies. --- .github/dependabot.yml | 40 +++++++++++++++++++++++++++------------- doc/Dependency.rst | 4 ++-- requirements.txt | 4 ++-- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bc1dfd59..0e75a2d3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,15 +1,29 @@ version: 2 updates: -- package-ecosystem: pip - directory: "/" - target-branch: dev - commit-message: - prefix: "[Dependabot]" - labels: - - Dependencies - assignees: - - Paebbels - reviewers: - - Paebbels - schedule: - interval: daily + # Maintain Python packages + - package-ecosystem: "pip" + directory: "/" + target-branch: dev + commit-message: + prefix: "[Dependabot]" + labels: + - Dependencies + reviewers: + - Paebbels + - Umarcor + schedule: + interval: "daily" # Checks on Monday trough Friday. + + # Maintain GitHub Action runners + - package-ecosystem: "github-actions" + directory: "/" + target-branch: dev + commit-message: + prefix: "[Dependabot]" + labels: + - Dependencies + reviewers: + - Paebbels + - Umarcor + schedule: + interval: "weekly" diff --git a/doc/Dependency.rst b/doc/Dependency.rst index d959244e..6b3ff0f3 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -29,10 +29,10 @@ pyEDAA.ToolSetup Package +===============================================================================+=============+======================================================================================================+========================================================================================================================================================+ | `pyTooling[yaml] `__ | ≥1.9.5 | `Apache License, 2.0 `__ | * `ruamel.yaml `__ (`MIT `__) | +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `pyTooling.TerminalUI `__ | ≥1.5.6 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | +| `pyTooling.TerminalUI `__ | ≥1.5.7 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | | | | | * `colorama `__ (`BSD-3-Clause `__) | +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `pyAttributes `__ | ≥2.5.0 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | +| `pyAttributes `__ | ≥2.5.1 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | | | | | * `argcomplete `__ (`Apache License, 2.0 `__) | +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/requirements.txt b/requirements.txt index 20828625..63a40bfc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pyTooling[yaml]>=1.9.5 -pyTooling.TerminalUI>=1.5.6 -pyAttributes>=2.5.0 +pyTooling.TerminalUI>=1.5.7 +pyAttributes>=2.5.1 From 89e849c88f9087ede5c76f1331629974b5ee24fd Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 10 Mar 2022 23:06:09 +0100 Subject: [PATCH 24/27] Fixed f-string. --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 207ddb2d..880b4754 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -64,7 +64,7 @@ with open(prologPath, "r") as prologFile: rst_prolog = prologFile.read() except Exception as ex: - print("[ERROR:] While reading '{0!s}'.".format(prologPath)) + print(f"[ERROR:] While reading '{prologPath}'.") print(ex) rst_prolog = "" From 13c76fee930fdb8a5331b7cc3f8f4ba16588b22f Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 10 Mar 2022 23:45:42 +0100 Subject: [PATCH 25/27] Added missing dependencies. --- doc/Dependency.rst | 2 ++ requirements.txt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 6b3ff0f3..9ad4a7bb 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -36,6 +36,8 @@ pyEDAA.ToolSetup Package | | | | * `argcomplete `__ (`Apache License, 2.0 `__) | +-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +.. todo:: Document pyTooling.CLIAbstraction and pyEDAA.CLITool + .. _dependency-testing: diff --git a/requirements.txt b/requirements.txt index 63a40bfc..529c3ae8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +pyAttributes>=2.5.1 pyTooling[yaml]>=1.9.5 +pyTooling.CLIAbstraction>=0.4.0 pyTooling.TerminalUI>=1.5.7 -pyAttributes>=2.5.1 +pyEDAA.CLITool>=0.2.0 From 46583f4bcaa3f021e163a9ad3b3742cd54f0e496 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 10 Mar 2022 23:54:33 +0100 Subject: [PATCH 26/27] Updated dependencies list. --- doc/Dependency.rst | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 9ad4a7bb..af782243 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -24,19 +24,34 @@ Dependency pyEDAA.ToolSetup Package ************************ -+-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ -| **Package** | **Version** | **License** | **Dependencies** | -+===============================================================================+=============+======================================================================================================+========================================================================================================================================================+ -| `pyTooling[yaml] `__ | ≥1.9.5 | `Apache License, 2.0 `__ | * `ruamel.yaml `__ (`MIT `__) | -+-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `pyTooling.TerminalUI `__ | ≥1.5.7 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | -| | | | * `colorama `__ (`BSD-3-Clause `__) | -+-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ -| `pyAttributes `__ | ≥2.5.1 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | -| | | | * `argcomplete `__ (`Apache License, 2.0 `__) | -+-------------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ - -.. todo:: Document pyTooling.CLIAbstraction and pyEDAA.CLITool ++---------------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| **Package** | **Version** | **License** | **Dependencies** | ++=======================================================================================+=============+==========================================================================================================+=================================================================================================================================================================================================+ +| `pyAttributes `__ | ≥2.5.1 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | +| | | | * `argcomplete `__ (`Apache License, 2.0 `__) | ++---------------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `pyTooling[yaml] `__ | ≥1.9.5 | `Apache License, 2.0 `__ | * `ruamel.yaml `__ (`MIT `__) | ++---------------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `pyTooling.CLIAbstraction `__ | ≥0.4.0 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | +| | | | * `pyAttributes `__ (`Apache License, 2.0 `__) | +| | | | | +| | | | * `pyTooling `__ (`Apache License, 2.0 `__) | +| | | | * `argcomplete `__ (`Apache License, 2.0 `__) | ++---------------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `pyTooling.TerminalUI `__ | ≥1.5.7 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | +| | | | * `colorama `__ (`BSD-3-Clause `__) | ++---------------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| `pyEDAA.CLITool `__ | ≥0.2.0 | `Apache License, 2.0 `__ | * `pyTooling `__ (`Apache License, 2.0 `__) | +| | | | * `pyTooling.CLIAbstraction `__ (`Apache License, 2.0 `__) | +| | | | | +| | | | * `pyTooling `__ (`Apache License, 2.0 `__) | +| | | | * `pyAttributes `__ (`Apache License, 2.0 `__) | +| | | | | +| | | | * `pyTooling `__ (`Apache License, 2.0 `__) | +| | | | * `argcomplete `__ (`Apache License, 2.0 `__) | +| | | | | +| | | | * `pyVHDLModel `__ (`Apache License, 2.0 `__) | ++---------------------------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. _dependency-testing: From 3fc04eaa47f5a8cea2548051e84728d3a4302845 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 11 Mar 2022 00:03:19 +0100 Subject: [PATCH 27/27] Disabled unit tests on MSYS2/MinGW64. --- .github/workflows/Pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 032ce010..4a2a0267 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -12,6 +12,7 @@ jobs: uses: pyTooling/Actions/.github/workflows/Parameters.yml@r0 with: name: pyEDAA.ToolSetup + system_list: 'ubuntu windows macos' # disabled: "msys2" UnitTesting: uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r0