From 4bbb0243a4ad88f88c93fadfbfc68cbdbd30098d Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 27 Aug 2021 08:03:59 +0200 Subject: [PATCH 1/3] Bump version to v0.13.0. --- doc/conf.py | 4 ++-- pyVHDLModel/__init__.py | 4 ++-- setup.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 6e13ad593..387ba9039 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -36,8 +36,8 @@ def _LatestTagName(): return check_output(["git", "describe", "--abbrev=0", "--tags"], universal_newlines=True).strip() # The full version, including alpha/beta/rc tags -version = "0.12" # The short X.Y version. -release = "0.12.0" # The full version, including alpha/beta/rc tags. +version = "0.13" # The short X.Y version. +release = "0.13.0" # The full version, including alpha/beta/rc tags. try: if _IsUnderGitControl: latestTagName = _LatestTagName()[1:] # remove prefix "v" diff --git a/pyVHDLModel/__init__.py b/pyVHDLModel/__init__.py index e4fba2bc9..3c9b80cf6 100644 --- a/pyVHDLModel/__init__.py +++ b/pyVHDLModel/__init__.py @@ -41,12 +41,12 @@ :license: Apache License, Version 2.0 """ from enum import IntEnum, unique, Enum -from typing import List, Iterable, Union, Optional as Nullable +from typing import List, Iterable, Union, Optional as Nullable from pydecor import export -__version__ = "0.12.0" +__version__ = "0.13.0" SimpleOrAttribute = Union['SimpleName', 'AttributeName'] diff --git a/setup.py b/setup.py index 8f90bd7ee..dd6ae4414 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ # Assemble all package information setuptools_setup( name=projectName, - version="0.12.0", + version="0.13.0", author="Patrick Lehmann", author_email="Paebbels@gmail.com", From d3d22ac562b0dd7a2f759f29ab86f4f008a85b33 Mon Sep 17 00:00:00 2001 From: umarcor Date: Sun, 5 Sep 2021 06:47:10 +0200 Subject: [PATCH 2/3] ci: update descriptions of steps in job BuildTheDocs --- .github/workflows/Pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 155183dd7..775526b2e 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -297,12 +297,12 @@ jobs: RUN apk add -U --no-cache graphviz EOF - - name: 🛳️ Build documentation from './pyVHDLModel/doc' + - name: 🛳️ Build documentation from './pyVHDLModel/doc' and publish to GitHub Pages uses: buildthedocs/btd@v0 with: token: ${{ github.token }} - - name: 📤 Upload artifacts to GitHub Pages + - name: 📤 Upload artifacts uses: actions/upload-artifact@master with: name: doc From 2be50d81cc692908f974503967b28279641e25c5 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 19 Sep 2021 08:25:17 +0200 Subject: [PATCH 3/3] Moved enumeration VHDLVersion from ProjectModel (former part of pyIPCMI) to pyVHDLModel. --- doc/_extensions/.gitempty | 0 doc/requirements.txt | 2 +- pyVHDLModel/__init__.py | 86 ++++++++++++++++++++++++++++++++++++++- tests/unit/Instantiate.py | 4 -- 4 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 doc/_extensions/.gitempty diff --git a/doc/_extensions/.gitempty b/doc/_extensions/.gitempty new file mode 100644 index 000000000..e69de29bb diff --git a/doc/requirements.txt b/doc/requirements.txt index da63251ac..210a45816 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ -r ../requirements.txt # Enforce latest version on ReadTheDocs -sphinx>=4.1.2 +sphinx>=4.2.0 # Sphinx Extenstions #sphinx.ext.coverage diff --git a/pyVHDLModel/__init__.py b/pyVHDLModel/__init__.py index 3c9b80cf6..d62310e54 100644 --- a/pyVHDLModel/__init__.py +++ b/pyVHDLModel/__init__.py @@ -41,7 +41,7 @@ :license: Apache License, Version 2.0 """ from enum import IntEnum, unique, Enum -from typing import List, Iterable, Union, Optional as Nullable +from typing import List, Iterable, Union, Optional as Nullable, Dict from pydecor import export @@ -86,6 +86,90 @@ 'ContextReference' ] + +@export +@unique +class VHDLVersion(Enum): + """ + An enumeration for all possible version numbers for VHDL. + + A version can be given as integer or string and is represented as a unified + enumeration value. + + This enumeration supports compare operators. + """ + + VHDL87 = 87 + VHDL93 = 93 + VHDL2002 = 2002 + VHDL2008 = 2008 + VHDL2019 = 2019 + + __VERSION_MAPPINGS__: Dict[Union[int, str], Enum] = { + 87: VHDL87, + 93: VHDL93, + 2: VHDL2002, + 8: VHDL2008, + 19: VHDL2019, + 1987: VHDL87, + 1993: VHDL93, + 2002: VHDL2002, + 2008: VHDL2008, + 2019: VHDL2019, + "87": VHDL87, + "93": VHDL93, + "02": VHDL2002, + "08": VHDL2008, + "19": VHDL2019, + "1987": VHDL87, + "1993": VHDL93, + "2002": VHDL2002, + "2008": VHDL2008, + "2019": VHDL2019 + } + + def __init__(self, *_) -> None: + """Patch the embedded MAP dictionary""" + for k, v in self.__class__.__VERSION_MAPPINGS__.items(): + if ((not isinstance(v, self.__class__)) and (v == self.value)): + self.__class__.__VERSION_MAPPINGS__[k] = self + + @classmethod + def Parse(cls, value: Union[int, str]) -> 'Enum': + try: + return cls.__VERSION_MAPPINGS__[value] + except KeyError: + ValueError("Value '{0!s}' cannot be parsed to member of {1}.".format(value, cls.__name__)) + + def __lt__(self, other: Enum) -> bool: + return self.value < other.value + + def __le__(self, other: Enum) -> bool: + return self.value <= other.value + + def __gt__(self, other: Enum) -> bool: + return self.value > other.value + + def __ge__(self, other: Enum) -> bool: + return self.value >= other.value + + def __ne__(self, other: Enum) -> bool: + return self.value != other.value + + def __eq__(self, other: Enum) -> bool: + if ((self is self.__class__.Any) or (other is self.__class__.Any)): + return True + else: + return (self.value == other.value) + + + def __str__(self) -> str: + return "VHDL'" + str(self.value)[-2:] + + def __repr__(self) -> str: + return str(self.value) + + @export @unique class Direction(Enum): diff --git a/tests/unit/Instantiate.py b/tests/unit/Instantiate.py index a021ca1d1..60bf68abd 100644 --- a/tests/unit/Instantiate.py +++ b/tests/unit/Instantiate.py @@ -10,10 +10,6 @@ # # Python unittest: Instantiation tests for the language model. # -# Description: -# ------------------------------------ -# TODO: -# # License: # ============================================================================== # Copyright 2017-2021 Patrick Lehmann - Boetzingen, Germany