Skip to content

Commit 614445b

Browse files
authored
v0.2.0
2 parents 77fd434 + 9e2c78b commit 614445b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1967
-84
lines changed

.github/workflows/Pipeline.yml

Lines changed: 121 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ defaults:
77
shell: bash
88

99
jobs:
10+
1011
UnitTesting:
1112
name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
1213
runs-on: ubuntu-latest
@@ -15,10 +16,11 @@ jobs:
1516
fail-fast: false
1617
matrix:
1718
include:
18-
# - {python: 3.6, icon: 🔴}
19-
- {python: 3.7, icon: 🟠}
20-
- {python: 3.8, icon: 🟡}
21-
- {python: 3.9, icon: 🟢}
19+
# - {python: "3.6", icon: 🔴} # until 23.12.2021
20+
- {python: "3.7", icon: 🟠} # until 27.06.2023
21+
- {python: "3.8", icon: 🟡} # until Oct. 2024
22+
- {python: "3.9", icon: 🟢} # until Oct. 2025
23+
- {python: "3.10", icon: 🟢} # until Oct. 2026
2224

2325
env:
2426
PYTHON: ${{ matrix.python }}
@@ -41,14 +43,14 @@ jobs:
4143
4244
- name: ☑ Run unit tests
4345
run: |
44-
python -m pytest -rA tests/unit
46+
python -m pytest -rA tests/unit --color=yes
4547
4648
Coverage:
47-
name: 📈 Collect Coverage Data using Python 3.9
49+
name: 📈 Collect Coverage Data using Python 3.10
4850
runs-on: ubuntu-latest
4951

5052
env:
51-
PYTHON: 3.9
53+
PYTHON: "3.10"
5254
ARTIFACT: pyEDAA-ProjectModel-coverage-html
5355
outputs:
5456
python: ${{ env.PYTHON }}
@@ -71,7 +73,7 @@ jobs:
7173
- name: Collect coverage
7274
continue-on-error: true
7375
run: |
74-
python -m pytest -rA --cov=.. --cov-config=tests/.coveragerc tests/unit
76+
python -m pytest -rA --cov=.. --cov-config=tests/.coveragerc tests/unit --color=yes
7577
7678
- name: Convert to cobertura format
7779
run: |
@@ -106,11 +108,11 @@ jobs:
106108
retention-days: 1
107109

108110
StaticTypeCheck:
109-
name: 📈 Check Static Typing using Python 3.9
111+
name: 👀 Check Static Typing using Python 3.10
110112
runs-on: ubuntu-latest
111113

112114
env:
113-
PYTHON: 3.9
115+
PYTHON: "3.10"
114116
ARTIFACT: pyEDAA-ProjectModel-typing-html
115117
outputs:
116118
python: ${{ env.PYTHON }}
@@ -282,12 +284,61 @@ jobs:
282284
run: |
283285
twine upload dist/*
284286
287+
VerifyDocs:
288+
name: 👍 Verify example snippets using Python 3.10
289+
runs-on: ubuntu-latest
290+
291+
env:
292+
PYTHON: "3.10"
293+
outputs:
294+
python: ${{ env.PYTHON }}
295+
296+
steps:
297+
- name: ⏬ Checkout repository
298+
uses: actions/checkout@v2
299+
300+
- name: 🐍 Setup Python
301+
uses: actions/setup-python@v2
302+
with:
303+
python-version: ${{ env.PYTHON }}
304+
305+
- name: 🐍 Install dependencies
306+
run: |
307+
pip3 install .
308+
309+
- name: ✂ Extract code snippet from README
310+
shell: python
311+
run: |
312+
from pathlib import Path
313+
import re
314+
315+
ROOT = Path('.')
316+
317+
with (ROOT / 'README.md').open('r') as rptr:
318+
content = rptr.read()
319+
320+
m = re.search(r"```py(thon)?(?P<code>.*?)```", content, re.MULTILINE|re.DOTALL)
321+
322+
if m is None:
323+
raise Exception("Regular expression did not find the example in the README!")
324+
325+
with (ROOT / 'tests/docs/example.py').open('w') as wptr:
326+
wptr.write(m["code"])
327+
328+
- name: Print example.py
329+
run: cat tests/docs/example.py
330+
331+
- name: ☑ Run example snippet
332+
working-directory: tests/docs
333+
run: |
334+
python3 example.py
335+
285336
BuildTheDocs:
286-
name: 📓 Run BuildTheDocs and publish to GH-Pages
337+
name: 📓 Run BuildTheDocs
287338
runs-on: ubuntu-latest
339+
needs:
340+
- VerifyDocs
288341

289-
# needs:
290-
# - VerifyDocs
291342
env:
292343
ARTIFACT: pyEDAA-ProjectModel-documentation
293344
outputs:
@@ -304,10 +355,10 @@ jobs:
304355
RUN apk add -U --no-cache graphviz
305356
EOF
306357
307-
- name: 🛳️ Build documentation using container edaa/doc and publish to GitHub Pages
358+
- name: 🛳️ Build documentation using container edaa/doc
308359
uses: buildthedocs/btd@v0
309360
with:
310-
token: ${{ github.token }}
361+
skip-deploy: true
311362

312363
- name: 📤 Upload 'documentation' artifacts
313364
uses: actions/upload-artifact@master
@@ -316,27 +367,76 @@ jobs:
316367
path: doc/_build/html
317368
retention-days: 7
318369

319-
ArtifactCleanUp:
320-
name: 🗑️ Artifact Cleanup
370+
PublishToGitHubPages:
371+
name: 📚 Publish to GH-Pages
321372
runs-on: ubuntu-latest
322-
323373
needs:
374+
- BuildTheDocs
324375
- Coverage
325376
- StaticTypeCheck
377+
378+
env:
379+
DOC: ${{ needs.BuildTheDocs.outputs.artifact }}
380+
COVERAGE: ${{ needs.Coverage.outputs.artifact }}
381+
TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
382+
outputs:
383+
artifact: ${{ env.ARTIFACT }}
384+
385+
steps:
386+
- name: Checkout repository
387+
uses: actions/checkout@v2
388+
389+
- name: 📥 Download artifacts '${{ env.DOC }}' from 'StaticTypeCheck' job
390+
uses: actions/download-artifact@v2
391+
with:
392+
name: ${{ env.DOC }}
393+
path: public
394+
395+
- name: 📥 Download artifacts '${{ env.COVERAGE }}' from 'Coverage' job
396+
uses: actions/download-artifact@v2
397+
with:
398+
name: ${{ env.COVERAGE }}
399+
path: public/coverage
400+
401+
- name: 📥 Download artifacts '${{ env.TYPING }}' from 'StaticTypeCheck' job
402+
uses: actions/download-artifact@v2
403+
with:
404+
name: ${{ env.TYPING }}
405+
path: public/typing
406+
407+
- name: '📓 Publish site to GitHub Pages'
408+
if: github.event_name != 'pull_request'
409+
run: |
410+
cd public
411+
touch .nojekyll
412+
git init
413+
cp ../.git/config ./.git/config
414+
git add .
415+
git config --local user.email "BuildTheDocs@GitHubActions"
416+
git config --local user.name "GitHub Actions"
417+
git commit -a -m "update ${{ github.sha }}"
418+
git push -u origin +HEAD:gh-pages
419+
420+
ArtifactCleanUp:
421+
name: 🗑️ Artifact Cleanup
422+
runs-on: ubuntu-latest
423+
needs:
326424
- Package
327425
- PublishOnPyPI
426+
- PublishToGitHubPages
328427

329428
env:
330429
COVERAGE: ${{ needs.Coverage.outputs.artifact }}
331430
TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
332431
PACKAGE: ${{ needs.Package.outputs.artifact }}
432+
DOC: ${{ needs.BuildTheDocs.outputs.artifact }}
333433

334434
steps:
335435
- name: 🗑️ Delete all Artifacts
336436
uses: geekyeggo/delete-artifact@v1
337437
with:
338438
name: |
439+
${{ env.COVERAGE }}
440+
${{ env.TYPING }}
339441
${{ env.PACKAGE }}
340-
341-
# ${{ env.COVERAGE }}
342-
# ${{ env.TYPING }}
442+
${{ env.DOC }}

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[![Sourcecode on GitHub](https://img.shields.io/badge/edaa-org-pyEDAA.ProjectModel-323131.svg?logo=github&longCache=true)](https://github.com/edaa-org/pyEDAA.ProjectModel)
2-
[![Sourcecode License](https://img.shields.io/pypi/l/pyEDAA.ProjectModel?logo=GitHub&label=code%20license)](LICENSE.md)
1+
[![Sourcecode on GitHub](https://img.shields.io/badge/edaa--org-pyEDAA.ProjectModel-323131.svg?logo=github&longCache=true)](https://github.com/edaa-org/pyEDAA.ProjectModel)
2+
[![Sourcecode License](https://img.shields.io/pypi/l/pyEDAA.ProjectModel?logo=Github&label=code%20license)](LICENSE.md)
33
[![GitHub tag (latest SemVer incl. pre-release)](https://img.shields.io/github/v/tag/edaa-org/pyEDAA.ProjectModel?logo=GitHub&include_prereleases)](https://github.com/edaa-org/pyEDAA.ProjectModel/tags)
44
[![GitHub release (latest SemVer incl. including pre-releases)](https://img.shields.io/github/v/release/edaa-org/pyEDAA.ProjectModel?logo=GitHub&include_prereleases)](https://github.com/edaa-org/pyEDAA.ProjectModel/releases/latest)
55
[![GitHub release date](https://img.shields.io/github/release-date/edaa-org/pyEDAA.ProjectModel?logo=GitHub&)](https://github.com/edaa-org/pyEDAA.ProjectModel/releases)
66
[![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/pypi/pyEDAA.ProjectModel?logo=GitHub)](https://github.com/edaa-org/pyEDAA.ProjectModel/network/dependents)
77
[![GitHub Workflow - Build and Test Status](https://img.shields.io/github/workflow/status/edaa-org/pyEDAA.ProjectModel/Test%20and%20Coverage?label=build%20and%20test&logo=GitHub%20Actions&logoColor=FFFFFF)](https://github.com/edaa-org/pyEDAA.ProjectModel/actions?query=workflow%3A%22Test+and+Coverage%22)
8-
[![Codacy - Quality](https://img.shields.io/codacy/grade/2286426d2b11417e90010427b7fed8e7?logo=Codacy)](https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel)
9-
[![Codacy - Coverage](https://img.shields.io/codacy/coverage/2286426d2b11417e90010427b7fed8e7?logo=Codacy)](https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel)
8+
[![Codacy - Quality](https://img.shields.io/codacy/grade/c2635df20fa840bc85639ca2fa1d9cb4?logo=Codacy)](https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel)
9+
[![Codacy - Coverage](https://img.shields.io/codacy/coverage/c2635df20fa840bc85639ca2fa1d9cb4?logo=Codacy)](https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel)
1010
[![Codecov - Branch Coverage](https://img.shields.io/codecov/c/github/edaa-org/pyEDAA.ProjectModel?logo=Codecov)](https://codecov.io/gh/edaa-org/pyEDAA.ProjectModel)
1111
[![Libraries.io SourceRank](https://img.shields.io/librariesio/sourcerank/pypi/pyEDAA.ProjectModel)](https://libraries.io/github/edaa-org/pyEDAA.ProjectModel/sourcerank)
1212
[![GitHub Workflow Release Status](https://img.shields.io/github/workflow/status/edaa-org/pyEDAA.ProjectModel/Release?label=release&logo=GitHub%20Actions&logoColor=FFFFFF)](https://github.com/edaa-org/pyEDAA.ProjectModel/actions?query=workflow%3A%22Release%22)
@@ -31,19 +31,27 @@
3131

3232
## Examples
3333

34-
3534
```python
3635
from pathlib import Path
3736
from pyEDAA.ProjectModel import Project, Design, FileSet, VHDLSourceFile
3837

39-
projectPath = Path("temp/project")
40-
project = Project("project", rootDirectory=projectPath)
41-
design = Design("design", project=project)
42-
fileset = FileSet("uart", Path("src/uart"), design=design)
38+
print(f"Current working directory: {Path.cwd()}")
39+
projectDirectory = Path.cwd() / "../project"
40+
print(f"Project directory: {projectDirectory!s} - {projectDirectory.exists()}")
41+
42+
project = Project("myProject", rootDirectory=projectDirectory)
43+
designA = Design("designA", project=project, directory=Path("designA"))
44+
designAFileset = FileSet("srcA", design=designA)
45+
for vhdlFilePath in designAFileset.ResolvedPath.glob("*.vhdl"):
46+
designAFileset.AddFile(VHDLSourceFile(vhdlFilePath))
47+
48+
libFileset = FileSet("lib", Path("../lib"), design=designA)
49+
for vhdlFilePath in libFileset.ResolvedPath.glob("*.vhdl"):
50+
libFileset.AddFile(VHDLSourceFile(vhdlFilePath))
4351

44-
for vhdlFilePath in fileset.ResolvedPath.glob("*.vhdl"):
45-
vhdlFile = VHDLSourceFile(vhdlFilePath)
46-
fileset.AddFile(vhdlFile)
52+
print(f"All VHDL files in {designA.Name}:")
53+
for file in designA.Files(fileType=VHDLSourceFile):
54+
print(f" {file.Path}")
4755
```
4856

4957

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def _LatestTagName():
3636
return check_output(["git", "describe", "--abbrev=0", "--tags"], universal_newlines=True).strip()
3737

3838
# The full version, including alpha/beta/rc tags
39-
version = "0.1" # The short X.Y version.
40-
release = "0.1.0" # The full version, including alpha/beta/rc tags.
39+
version = "0.2" # The short X.Y version.
40+
release = "0.2.0" # The full version, including alpha/beta/rc tags.
4141
try:
4242
if _IsUnderGitControl:
4343
latestTagName = _LatestTagName()[1:] # remove prefix "v"

doc/shields.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@
7474
:target: https://github.com/edaa-org/pyEDAA.ProjectModel/actions?query=workflow%3A%22Test+and+Coverage%22
7575

7676
.. # Codacy - quality
77-
.. |SHIELD:svg:ProjectModel-codacy-quality| image:: https://img.shields.io/codacy/grade/2286426d2b11417e90010427b7fed8e7?logo=codacy
77+
.. |SHIELD:svg:ProjectModel-codacy-quality| image:: https://img.shields.io/codacy/grade/c2635df20fa840bc85639ca2fa1d9cb4?logo=codacy
7878
:alt: Codacy - Quality
7979
:height: 22
8080
:target: https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel
81-
.. |SHIELD:png:ProjectModel-codacy-quality| image:: https://raster.shields.io/codacy/grade/2286426d2b11417e90010427b7fed8e7?logo=codacy
81+
.. |SHIELD:png:ProjectModel-codacy-quality| image:: https://raster.shields.io/codacy/grade/c2635df20fa840bc85639ca2fa1d9cb4?logo=codacy
8282
:alt: Codacy - Quality
8383
:height: 22
8484
:target: https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel
8585

8686
.. # Codacy - coverage
87-
.. |SHIELD:svg:ProjectModel-codacy-coverage| image:: https://img.shields.io/codacy/coverage/2286426d2b11417e90010427b7fed8e7?logo=codacy
87+
.. |SHIELD:svg:ProjectModel-codacy-coverage| image:: https://img.shields.io/codacy/coverage/c2635df20fa840bc85639ca2fa1d9cb4?logo=codacy
8888
:alt: Codacy - Line Coverage
8989
:height: 22
9090
:target: https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel
91-
.. |SHIELD:png:ProjectModel-codacy-coverage| image:: https://raster.shields.io/codacy/coverage/2286426d2b11417e90010427b7fed8e7?logo=codacy
91+
.. |SHIELD:png:ProjectModel-codacy-coverage| image:: https://raster.shields.io/codacy/coverage/c2635df20fa840bc85639ca2fa1d9cb4?logo=codacy
9292
:alt: Codacy - Line Coverage
9393
:height: 22
9494
:target: https://www.codacy.com/manual/edaa-org/pyEDAA.ProjectModel

0 commit comments

Comments
 (0)