From e191fae0566fe89324076b79f6ad02240e213487 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 30 Jun 2021 22:40:47 +0200 Subject: [PATCH 1/9] Bump version to v0.11.2. --- doc/conf.py | 2 +- pyVHDLModel/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index be24127f6..a4079f33f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -37,7 +37,7 @@ def _LatestTagName(): # The full version, including alpha/beta/rc tags version = "0.11" # The short X.Y version. -release = "0.11.1" # The full version, including alpha/beta/rc tags. +release = "0.11.2" # 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 b9cdeba5d..346286d13 100644 --- a/pyVHDLModel/__init__.py +++ b/pyVHDLModel/__init__.py @@ -40,4 +40,4 @@ :copyright: Copyright 2007-2021 Patrick Lehmann - BΓΆtzingen, Germany :license: Apache License, Version 2.0 """ -__version__ = "0.11.1" +__version__ = "0.11.2" diff --git a/setup.py b/setup.py index f8249e037..bdfbc4e0f 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ # Assemble all package information setuptools_setup( name=projectName, - version="0.11.1", + version="0.11.2", author="Patrick Lehmann", author_email="Paebbels@gmail.com", From af76c6206f8baadb07499004fe86be0b1d21f985 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 30 Jun 2021 23:10:47 +0200 Subject: [PATCH 2/9] Added News section for July. --- doc/index.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index 183cbbb49..abd85b7ce 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -57,6 +57,22 @@ Use Cases News **** +.. only:: html + + Jul. 2021 - First adoption and enhancements + =========================================== + +.. only:: latex + + .. rubric:: First adoption and enhancements + +* `GHDL's `__ is the first big adopter with `pyGHDL.dom `__ + to generate a network of instantiated classes derived from ``pyVHDLModel``. |br| + It uses `pyGHDL `__ as a backend (GHDL build as shared object and + loaded into CPython via C-binding API (``ctypes``). +* ... + + .. only:: html Jun. 2021 - Model and documentation enhancements From 13467656f5257413f206c69f3ff92a2f12edb550 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 14 Jul 2021 23:10:20 +0200 Subject: [PATCH 3/9] readme: update example code --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6f1b34990..f9c081561 100644 --- a/README.md +++ b/README.md @@ -57,21 +57,21 @@ from pyGHDL.dom.NonStandard import Design, Document sourceFile = Path("example.vhdl") design = Design() -library = Design.GetLibrary("lib") +library = design.GetLibrary("lib") document = Document(sourceFile) design.AddDocument(document, library) for entity in document.Entities: - print("{}".format(entity.Name)) + print("{}".format(entity.Identifier)) print(" generics:") - for generic in entity.Generics: + for generic in entity.GenericItems: print(" - {} : {!s} {}".format( - generic.Identifier, generic.Mode, generic.SubTypeIndication) + generic.Identifier, generic.Mode, generic.Subtype) ) print(" ports:") - for port in entity.Ports: + for port in entity.PortItems: print(" - {} : {!s} {}".format( - port.Identifier, port.Mode, port.SubTypeIndication) + port.Identifier, port.Mode, port.Subtype) ) ``` From 7455a2bc2e936b892c4c78fc0cdcbf2e2874709e Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 14 Jul 2021 23:45:35 +0200 Subject: [PATCH 4/9] ci: add job 'VerifyDocs' --- .github/workflows/Pipeline.yml | 53 ++++++++++++++++++++++++++++++++++ tests/docs/example.vhdl | 32 ++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 tests/docs/example.vhdl diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 0002483e3..ccd3f3a83 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -222,9 +222,62 @@ jobs: run: | twine upload dist/* + VerifyDocs: + name: πŸ““ Verify that example(s) is/are runnable + runs-on: ubuntu-latest + steps: + + - name: πŸ“₯ Checkout repository + uses: actions/checkout@v2 + + - name: 'βš™οΈ Setup GHDL' + uses: ghdl/setup-ghdl-ci@master + + - name: '🐍 Setup Python' + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: '🐍 Install dependencies' + run: | + pip3 install pytest + pip3 install git+https://github.com/ghdl/ghdl.git@$(ghdl version hash) + + - name: 'Extract example from README' + shell: python + run: | + from pathlib import Path + import re + + ROOT = Path('.') + + with (ROOT / 'README.md').open('r') as rptr: + content = rptr.read() + + m = re.search(r"```py(thon)?(?P.*?)```", content, re.MULTILINE|re.DOTALL) + + if m is None: + raise Exception("Regular expression did not find the example in the README!") + + with (ROOT / 'tests/docs/example.py').open('w') as wptr: + wptr.write(m["code"]) + + - name: 'Print example.py' + run: cat tests/docs/example.py + + - name: 'Run example.py' + run: | + cd tests/docs + python3 example.py + + BuildTheDocs: name: πŸ““ Run BuildTheDocs and publish to GH-Pages runs-on: ubuntu-latest + + needs: + - VerifyDocs + steps: - name: Checkout repository diff --git a/tests/docs/example.vhdl b/tests/docs/example.vhdl new file mode 100644 index 000000000..931599086 --- /dev/null +++ b/tests/docs/example.vhdl @@ -0,0 +1,32 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity entity_1 is + generic ( + FREQ : real := (100.0 * 1024.0 * 1024.0); + BITS : positive := 8 + ); + port ( + Clock: in std_logic; + Reset: in std_logic := '0'; + Q: out std_logic_vector(BITS - 1 downto 0) + ); +end entity entity_1; + +architecture behav of entity_1 is + signal Reset_n : std_logic; +begin + Reset_n <= (not Reset); + + process(Clock) + begin + if rising_edge(Clock) then + if Reset_n = '0' then + Q <= (others => '0'); + else + Q <= std_logic_vector(unsigned(Q) + 1); + end if; + end if; + end process; +end architecture behav; From b8cba43cdb2a160ea35a84e9827348658e2dc523 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 14 Jul 2021 23:49:33 +0200 Subject: [PATCH 5/9] ci: fix indentation --- .github/workflows/Pipeline.yml | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index ccd3f3a83..c9ac24cab 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -280,26 +280,26 @@ jobs: steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: 🚒 Build documentation in 'pyVHDLModel/doc' - run: | - docker build -t vhdl/doc - <<-EOF - FROM btdi/sphinx:featured - RUN apk add -U --no-cache graphviz - EOF - - - name: πŸ›³οΈ Unknown - uses: buildthedocs/btd@v0 - with: - token: ${{ github.token }} - - - name: Upload artifacts to GitHub Pages - uses: actions/upload-artifact@master - with: - name: doc - path: doc/_build/html + - name: Checkout repository + uses: actions/checkout@v2 + + - name: 🚒 Build documentation in 'pyVHDLModel/doc' + run: | + docker build -t vhdl/doc - <<-EOF + FROM btdi/sphinx:featured + RUN apk add -U --no-cache graphviz + EOF + + - name: πŸ›³οΈ Unknown + uses: buildthedocs/btd@v0 + with: + token: ${{ github.token }} + + - name: Upload artifacts to GitHub Pages + uses: actions/upload-artifact@master + with: + name: doc + path: doc/_build/html ArtifactCleanUp: name: πŸ—‘οΈ Artifact Cleanup @@ -313,8 +313,8 @@ jobs: ARTIFACT: ${{ needs.Package.outputs.artifact }} steps: - - name: πŸ—‘οΈ Delete all Artifacts - uses: geekyeggo/delete-artifact@v1 - with: - name: | - ${{ env.ARTIFACT }} + - name: πŸ—‘οΈ Delete all Artifacts + uses: geekyeggo/delete-artifact@v1 + with: + name: | + ${{ env.ARTIFACT }} From 893619cb9222161036761616e0f61444ccb31324 Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 15 Jul 2021 00:32:52 +0200 Subject: [PATCH 6/9] ci: update step names of 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 c9ac24cab..2a80ca66f 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -283,14 +283,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: 🚒 Build documentation in 'pyVHDLModel/doc' + - name: 🚒 Build container image 'vhdl/doc' run: | docker build -t vhdl/doc - <<-EOF FROM btdi/sphinx:featured RUN apk add -U --no-cache graphviz EOF - - name: πŸ›³οΈ Unknown + - name: πŸ›³οΈ Build documentation in 'pyVHDLModel/doc' uses: buildthedocs/btd@v0 with: token: ${{ github.token }} From 0835c956b16c8674a32de2ad1c92a788a00ceaf2 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 16 Jul 2021 07:59:43 +0200 Subject: [PATCH 7/9] Fixed typo. --- pyVHDLModel/VHDLModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 19cacf1c5..0e10a7b91 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -1312,7 +1312,7 @@ class AscendingRangeExpression(RangeExpression): @export class DescendingRangeExpression(RangeExpression): - _direction = Direction.To + _direction = Direction.DownTo _FORMAT = ("", " downto ", "") From 49d80a1678b8c3bf09c89d17a57e74fafb2855a7 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 16 Jul 2021 08:58:51 +0200 Subject: [PATCH 8/9] YAML modifications. --- .github/workflows/Pipeline.yml | 64 ++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 2a80ca66f..5632e7888 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -2,6 +2,13 @@ name: Unit Testing, Coverage Collection, Package, Release, Documentation and Pub on: [ push ] +env: + PYTHON_LATEST: 3.9 + +defaults: + run: + shell: bash + jobs: UnitTesting: name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }} @@ -22,7 +29,7 @@ jobs: python: ${{ env.PYTHON }} steps: - - name: Checkout repository + - name: ⏬ Checkout repository uses: actions/checkout@v2 - name: 🐍 Setup Python ${{ matrix.python }} @@ -35,7 +42,7 @@ jobs: python -m pip install --upgrade pip pip install -r tests/requirements.txt - - name: Run unit tests + - name: β˜‘ Run unit tests run: | python -m pytest -rA tests/unit @@ -44,12 +51,12 @@ jobs: runs-on: ubuntu-latest env: - PYTHON: 3.9 + PYTHON: ${{ env.PYTHON_LATEST }} outputs: python: ${{ env.PYTHON }} steps: - - name: πŸ”‹ Checkout repository + - name: ⏬ Checkout repository uses: actions/checkout@v2 - name: 🐍 Setup Python ${{ env.PYTHON }} @@ -199,7 +206,7 @@ jobs: artifact: ${{ env.ARTIFACT }} steps: - - name: Download artifacts '${{ env.ARTIFACT }}' from 'Package' job + - name: πŸ“₯ Download artifacts '${{ env.ARTIFACT }}' from 'Package' job uses: actions/download-artifact@v2 with: name: ${{ env.ARTIFACT }} @@ -223,27 +230,31 @@ jobs: twine upload dist/* VerifyDocs: - name: πŸ““ Verify that example(s) is/are runnable + name: πŸ‘ Verify example snippets runs-on: ubuntu-latest - steps: - - name: πŸ“₯ Checkout repository + env: + PYTHON: ${{ env.PYTHON_LATEST }} + outputs: + python: ${{ env.PYTHON }} + + steps: + - name: ⏬ Checkout repository uses: actions/checkout@v2 - - name: 'βš™οΈ Setup GHDL' + - name: βš™ Setup GHDL uses: ghdl/setup-ghdl-ci@master - - name: '🐍 Setup Python' + - name: 🐍 Setup Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: ${{ env.PYTHON }} - - name: '🐍 Install dependencies' + - name: 🐍 Install dependencies run: | - pip3 install pytest pip3 install git+https://github.com/ghdl/ghdl.git@$(ghdl version hash) - - - name: 'Extract example from README' + + - name: βœ‚ Extract code snippet from README shell: python run: | from pathlib import Path @@ -253,21 +264,21 @@ jobs: with (ROOT / 'README.md').open('r') as rptr: content = rptr.read() - + m = re.search(r"```py(thon)?(?P.*?)```", content, re.MULTILINE|re.DOTALL) - + if m is None: raise Exception("Regular expression did not find the example in the README!") - + with (ROOT / 'tests/docs/example.py').open('w') as wptr: wptr.write(m["code"]) - - - name: 'Print example.py' - run: cat tests/docs/example.py - - name: 'Run example.py' +# - name: Print example.py +# run: cat tests/docs/example.py + + - name: β˜‘ Run example snippet + working-directory: tests/docs run: | - cd tests/docs python3 example.py @@ -277,9 +288,8 @@ jobs: needs: - VerifyDocs - - steps: + steps: - name: Checkout repository uses: actions/checkout@v2 @@ -290,12 +300,12 @@ jobs: RUN apk add -U --no-cache graphviz EOF - - name: πŸ›³οΈ Build documentation in 'pyVHDLModel/doc' + - name: πŸ›³οΈ Build documentation from './pyVHDLModel/doc' uses: buildthedocs/btd@v0 with: token: ${{ github.token }} - - name: Upload artifacts to GitHub Pages + - name: πŸ“€ Upload artifacts to GitHub Pages uses: actions/upload-artifact@master with: name: doc From a0e6c2e26b3005dea651a83ebe96e77fee5780fd Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 16 Jul 2021 09:18:12 +0200 Subject: [PATCH 9/9] Fixed YAML problem. --- .github/workflows/Pipeline.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 5632e7888..155183dd7 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -2,9 +2,6 @@ name: Unit Testing, Coverage Collection, Package, Release, Documentation and Pub on: [ push ] -env: - PYTHON_LATEST: 3.9 - defaults: run: shell: bash @@ -51,7 +48,7 @@ jobs: runs-on: ubuntu-latest env: - PYTHON: ${{ env.PYTHON_LATEST }} + PYTHON: 3.9 outputs: python: ${{ env.PYTHON }} @@ -94,7 +91,7 @@ jobs: coverage-reports: ./coverage.xml Release: - name: Release Page on GitHub + name: πŸ“ Create 'Release Page' on GitHub runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags') @@ -191,7 +188,7 @@ jobs: retention-days: 1 PublishOnPyPI: - name: Publish to PyPI + name: πŸš€ Publish to PyPI runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags') @@ -230,11 +227,11 @@ jobs: twine upload dist/* VerifyDocs: - name: πŸ‘ Verify example snippets + name: πŸ‘ Verify example snippets using Python 3.9 runs-on: ubuntu-latest env: - PYTHON: ${{ env.PYTHON_LATEST }} + PYTHON: 3.9 outputs: python: ${{ env.PYTHON }}