Skip to content

Commit

Permalink
v0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels authored Sep 19, 2021
2 parents 913cded + 2be50d8 commit 14cb999
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file added doc/_extensions/.gitempty
Empty file.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
88 changes: 86 additions & 2 deletions pyVHDLModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, Dict

from pydecor import export


__version__ = "0.12.0"
__version__ = "0.13.0"

SimpleOrAttribute = Union['SimpleName', 'AttributeName']

Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/Instantiate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#
# Python unittest: Instantiation tests for the language model.
#
# Description:
# ------------------------------------
# TODO:
#
# License:
# ==============================================================================
# Copyright 2017-2021 Patrick Lehmann - Boetzingen, Germany
Expand Down

0 comments on commit 14cb999

Please sign in to comment.