Skip to content

Commit

Permalink
Exchanged parent element of design units from document to library.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Jul 29, 2024
1 parent c19d6e0 commit 5305e90
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 65 deletions.
2 changes: 1 addition & 1 deletion dist/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
wheel ~= 0.43
twine ~= 5.0
twine ~= 5.1
6 changes: 3 additions & 3 deletions doc/Dependency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ the mandatory dependencies too.
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| **Package** | **Version** | **License** | **Dependencies** |
+=====================================================================+=============+========================================================================================+======================+
| `pytest <https://GitHub.com/pytest-dev/pytest>`__ | ≥8.2 | `MIT <https://GitHub.com/pytest-dev/pytest/blob/master/LICENSE>`__ | *Not yet evaluated.* |
| `pytest <https://GitHub.com/pytest-dev/pytest>`__ | ≥8.3 | `MIT <https://GitHub.com/pytest-dev/pytest/blob/master/LICENSE>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `pytest-cov <https://GitHub.com/pytest-dev/pytest-cov>`__ | ≥5.0 | `MIT <https://GitHub.com/pytest-dev/pytest-cov/blob/master/LICENSE>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `Coverage <https://GitHub.com/nedbat/coveragepy>`__ | ≥7.6 | `Apache License, 2.0 <https://GitHub.com/nedbat/coveragepy/blob/master/LICENSE.txt>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `mypy <https://GitHub.com/python/mypy>`__ | ≥1.10 | `MIT <https://GitHub.com/python/mypy/blob/master/LICENSE>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `typing-extensions <https://GitHub.com/python/typing_extensions>`__ | ≥4.11 | `PSF-2.0 <https://github.com/python/typing_extensions/blob/main/LICENSE>`__ | *Not yet evaluated.* |
| `typing-extensions <https://GitHub.com/python/typing_extensions>`__ | ≥4.12 | `PSF-2.0 <https://github.com/python/typing_extensions/blob/main/LICENSE>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
| `lxml <https://GitHub.com/lxml/lxml>`__ | ≥5.2 | `BSD 3-Clause <https://GitHub.com/lxml/lxml/blob/master/LICENSE.txt>`__ | *Not yet evaluated.* |
+---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+
Expand Down Expand Up @@ -162,5 +162,5 @@ install the mandatory dependencies too.
+==========================================================+==============+===========================================================================================+======================+
| `wheel <https://GitHub.com/pypa/wheel>`__ | ≥0.43 | `MIT <https://github.com/pypa/wheel/blob/main/LICENSE.txt>`__ | *Not yet evaluated.* |
+----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+
| `Twine <https://GitHub.com/pypa/twine/>`__ | ≥5.0 | `Apache License, 2.0 <https://github.com/pypa/twine/blob/main/LICENSE>`__ | *Not yet evaluated.* |
| `Twine <https://GitHub.com/pypa/twine/>`__ | ≥5.1 | `Apache License, 2.0 <https://github.com/pypa/twine/blob/main/LICENSE>`__ | *Not yet evaluated.* |
+----------------------------------------------------------+--------------+-------------------------------------------------------------------------------------------+----------------------+
2 changes: 1 addition & 1 deletion doc/Doc-License.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ licensed under their terms and conditions, or any related information. Creative
Commons disclaims all liability for damages resulting from their use to the
fullest extent possible.

.. rubric:: Using Creative Commons Public Licenses
.. topic:: Using Creative Commons Public Licenses

Creative Commons public licenses provide a standard set of terms and conditions
that creators and other rights holders may use to share original works of
Expand Down
18 changes: 14 additions & 4 deletions doc/_static/css/override.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
margin-bottom: 6px
}

.rst-content .topic-title {
font-size: larger;
font-weight: 700;
margin-top: 18px;
margin-bottom: 6px;
}

.rst-content p.rubric {
text-decoration: underline;
font-weight: 700;
margin-top: 18px;
margin-bottom: 16px;
}

/* general overrides */
html {
font-size: 15px;
Expand All @@ -39,10 +53,6 @@ section > p,
text-align: justify
}

p.rubric {
text-decoration: underline
}

/* wyrm overrides */
.wy-menu-vertical header,
.wy-menu-vertical p.caption {
Expand Down
6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
# ==============================================================================
# Restructured Text settings
# ==============================================================================
prologPath = "prolog.inc"
prologPath = Path("prolog.inc")
try:
with open(prologPath, "r") as prologFile:
rst_prolog = prologFile.read()
with prologPath.open("r", encoding="utf-8") as fileHandle:
rst_prolog = fileHandle.read()
except Exception as ex:
print(f"[ERROR:] While reading '{prologPath}'.")
print(ex)
Expand Down
4 changes: 3 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ News
* `pyVHDLModel` was split from `pyVHDLParser <https://GitHub.com/Paebbels/pyVHDLParser>`__ (v0.6.0) as an independent Python package.


.. _contributors:
.. _CONTRIBUTORS:

Contributors
************
Expand All @@ -179,6 +179,8 @@ Contributors
* `and more... <https://GitHub.com/VHDL/pyVHDLModel/graphs/contributors>`__


.. _LICENSE:

License
*******

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

pyTooling ~= 6.4
pyTooling ~= 6.5

# Enforce latest version on ReadTheDocs
sphinx ~= 7.4
Expand Down
43 changes: 17 additions & 26 deletions pyVHDLModel/DesignUnit.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class DesignUnit(ModelEntity, NamedEntityMixin, DocumentedEntityMixin):
* :class:`~pyVHDLModel.DesignUnit.PackageBody`
"""

_library: 'Library' #: The VHDL library, the design unit was analyzed into.
_document: 'Document' #: The VHDL library, the design unit was analyzed into.

# Either written as statements before (e.g. entity, architecture, package, ...), or as statements inside (context)
_contextItems: List['ContextUnion'] #: List of all context items (library, use and context clauses).
Expand Down Expand Up @@ -199,7 +199,7 @@ def __init__(self, identifier: str, contextItems: Nullable[Iterable[ContextUnion
NamedEntityMixin.__init__(self, identifier)
DocumentedEntityMixin.__init__(self, documentation)

self._library = None
self._document = None

self._contextItems = []
self._libraryReferences = []
Expand Down Expand Up @@ -227,19 +227,19 @@ def __init__(self, identifier: str, contextItems: Nullable[Iterable[ContextUnion

@readonly
def Document(self) -> 'Document':
return self._parent
return self._document

@Document.setter
def Document(self, document: 'Document') -> None:
self._parent = document
self._document = document

@property
def Library(self) -> 'Library':
return self._library
return self._parent

@Library.setter
def Library(self, library: 'Library') -> None:
self._library = library
self._parent = library

@property
def ContextItems(self) -> List['ContextUnion']:
Expand Down Expand Up @@ -407,7 +407,7 @@ def ContextReferences(self) -> List[ContextReference]:
return self._contextReferences

def __str__(self) -> str:
lib = self._library.Identifier + "?" if self._library is not None else ""
lib = self._parent._identifier + "?" if self._parent is not None else ""

return f"Context: {lib}.{self._identifier}"

Expand Down Expand Up @@ -488,12 +488,12 @@ def _IndexOtherDeclaredItem(self, item):
super()._IndexOtherDeclaredItem(item)

def __str__(self) -> str:
lib = self._library.Identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"

return f"Package: '{lib}.{self._identifier}'"

def __repr__(self) -> str:
lib = self._library.Identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"

return f"{lib}.{self._identifier}"

Expand Down Expand Up @@ -541,12 +541,12 @@ def LinkDeclaredItemsToPackage(self) -> None:
pass

def __str__(self) -> str:
lib = self._library._identifier + "?" if self._library is not None else ""
lib = self._parent._identifier + "?" if self._parent is not None else ""

return f"Package Body: {lib}.{self._identifier}(body)"

def __repr__(self) -> str:
lib = self._library._identifier + "?" if self._library is not None else ""
lib = self._parent._identifier + "?" if self._parent is not None else ""

return f"{lib}.{self._identifier}(body)"

Expand Down Expand Up @@ -617,13 +617,13 @@ def Architectures(self) -> Dict[str, 'Architecture']:
return self._architectures

def __str__(self) -> str:
lib = self._library._identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"
archs = ', '.join(self._architectures.keys()) if self._architectures else "%"

return f"Entity: '{lib}.{self._identifier}({archs})'"

def __repr__(self) -> str:
lib = self._library._identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"
archs = ', '.join(self._architectures.keys()) if self._architectures else "%"

return f"{lib}.{self._identifier}({archs})"
Expand Down Expand Up @@ -669,23 +669,14 @@ def __init__(
def Entity(self) -> EntitySymbol:
return self._entity

# TODO: move to Design Unit
@property
def Library(self) -> 'Library':
return self._library

@Library.setter
def Library(self, library: 'Library') -> None:
self._library = library

def __str__(self) -> str:
lib = self._library._identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"
ent = self._entity._name._identifier if self._entity is not None else "%"

return f"Architecture: {lib}.{ent}({self._identifier})"

def __repr__(self) -> str:
lib = self._library._identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"
ent = self._entity._name._identifier if self._entity is not None else "%"

return f"{lib}.{ent}({self._identifier})"
Expand Down Expand Up @@ -780,11 +771,11 @@ def __init__(
DesignUnitWithContextMixin.__init__(self)

def __str__(self) -> str:
lib = self._library._identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"

return f"Configuration: {lib}.{self._identifier}"

def __repr__(self) -> str:
lib = self._library._identifier if self._library is not None else "%"
lib = self._parent._identifier if self._parent is not None else "%"

return f"{lib}.{self._identifier}"
8 changes: 4 additions & 4 deletions pyVHDLModel/PSLModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ class PSLPrimaryUnit(PrimaryUnit):

@export
class VerificationUnit(PSLPrimaryUnit):
def __init__(self, identifier: str):
def __init__(self, identifier: str) -> None:
super().__init__(identifier)


@export
class VerificationProperty(PSLPrimaryUnit):
def __init__(self, identifier: str):
def __init__(self, identifier: str) -> None:
super().__init__(identifier)


@export
class VerificationMode(PSLPrimaryUnit):
def __init__(self, identifier: str):
def __init__(self, identifier: str) -> None:
super().__init__(identifier)


@export
class DefaultClock(PSLEntity, NamedEntityMixin):
def __init__(self, identifier: str):
def __init__(self, identifier: str) -> None:
super().__init__()
NamedEntityMixin.__init__(self, identifier)
Loading

0 comments on commit 5305e90

Please sign in to comment.