Skip to content

Commit 12abe3d

Browse files
authored
v1.5.0
2 parents 0f53fe4 + 565083b commit 12abe3d

26 files changed

+406
-172
lines changed

.btd.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
input: doc
2+
output: _build
3+
requirements: requirements.txt
4+
target: gh-pages
5+
formats: [ html, pdf, man ]
6+
images:
7+
base: edaa/doc
8+
latex: btdi/latex
9+
theme: https://codeload.github.com/buildthedocs/sphinx.theme/tar.gz/v1

.github/workflows/Pipeline.yml

Lines changed: 220 additions & 15 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,16 +43,18 @@ 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"
54+
ARTIFACT: pyTooling.TerminalUI-coverage-html
5255
outputs:
5356
python: ${{ env.PYTHON }}
57+
artifact: ${{ env.ARTIFACT }}
5458

5559
steps:
5660
- name: ⏬ Checkout repository
@@ -69,12 +73,17 @@ jobs:
6973
- name: Collect coverage
7074
continue-on-error: true
7175
run: |
72-
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
7377
7478
- name: Convert to cobertura format
7579
run: |
7680
coverage xml
7781
82+
- name: Convert to HTML format
83+
run: |
84+
coverage html
85+
rm htmlcov/.gitignore
86+
7887
- name: 📊 Publish coverage at CodeCov
7988
continue-on-error: true
8089
uses: codecov/codecov-action@v1
@@ -90,6 +99,56 @@ jobs:
9099
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
91100
coverage-reports: ./coverage.xml
92101

102+
- name: 📤 Upload 'Coverage Report' artifact
103+
continue-on-error: true
104+
uses: actions/upload-artifact@v2
105+
with:
106+
name: ${{ env.ARTIFACT }}
107+
path: htmlcov
108+
if-no-files-found: error
109+
retention-days: 1
110+
111+
StaticTypeCheck:
112+
name: 👀 Check Static Typing using Python 3.10
113+
runs-on: ubuntu-latest
114+
115+
env:
116+
PYTHON: "3.10"
117+
ARTIFACT: pyTooling.TerminalUI-typing-html
118+
outputs:
119+
python: ${{ env.PYTHON }}
120+
artifact: ${{ env.ARTIFACT }}
121+
122+
steps:
123+
- name: ⏬ Checkout repository
124+
uses: actions/checkout@v2
125+
126+
- name: 🐍 Setup Python ${{ env.PYTHON }}
127+
uses: actions/setup-python@v2
128+
with:
129+
python-version: ${{ env.PYTHON }}
130+
131+
- name: 🗂 Install dependencies
132+
run: |
133+
python -m pip install --upgrade pip
134+
pip install -r tests/requirements.txt
135+
136+
- name: Check Static Typing
137+
continue-on-error: true
138+
run: |
139+
pwd
140+
mypy --html-report htmlmypy -m pyTooling.TerminalUI
141+
142+
- name: 📤 Upload 'Static Typing Report' artifact
143+
continue-on-error: true
144+
uses: actions/upload-artifact@v2
145+
with:
146+
name: ${{ env.ARTIFACT }}
147+
path: htmlmypy
148+
if-no-files-found: error
149+
retention-days: 1
150+
151+
93152
Release:
94153
name: 📝 Create 'Release Page' on GitHub
95154
runs-on: ubuntu-latest
@@ -98,6 +157,7 @@ jobs:
98157
needs:
99158
- UnitTesting
100159
- Coverage
160+
- StaticTypeCheck
101161

102162
env:
103163
PYTHON: ${{ needs.Coverage.outputs.python }}
@@ -152,7 +212,7 @@ jobs:
152212

153213
env:
154214
PYTHON: ${{ needs.Coverage.outputs.python }}
155-
ARTIFACT: pyTerminalUI-wheel
215+
ARTIFACT: pyTooling.TerminalUI-wheel
156216
outputs:
157217
python: ${{ env.PYTHON }}
158218
artifact: ${{ env.ARTIFACT }}
@@ -179,7 +239,7 @@ jobs:
179239
run: |
180240
python setup.py bdist_wheel
181241
182-
- name: 📤 Upload 'pyTerminalUI' artifact
242+
- name: 📤 Upload 'pyTooling.TerminalUI' artifact
183243
uses: actions/upload-artifact@v2
184244
with:
185245
name: ${{ env.ARTIFACT }}
@@ -193,6 +253,7 @@ jobs:
193253

194254
if: startsWith(github.ref, 'refs/tags')
195255
needs:
256+
- Release
196257
- Package
197258

198259
env:
@@ -226,20 +287,164 @@ jobs:
226287
run: |
227288
twine upload dist/*
228289
290+
- name: 🗑️ Delete packaging Artifacts
291+
uses: geekyeggo/delete-artifact@v1
292+
with:
293+
name: |
294+
${{ env.ARTIFACT }}
295+
296+
# VerifyDocs:
297+
# name: 👍 Verify example snippets using Python 3.10
298+
# runs-on: ubuntu-latest
299+
#
300+
# env:
301+
# PYTHON: "3.10"
302+
# outputs:
303+
# python: ${{ env.PYTHON }}
304+
#
305+
# steps:
306+
# - name: ⏬ Checkout repository
307+
# uses: actions/checkout@v2
308+
#
309+
# - name: 🐍 Setup Python
310+
# uses: actions/setup-python@v2
311+
# with:
312+
# python-version: ${{ env.PYTHON }}
313+
#
314+
# - name: 🐍 Install dependencies
315+
# run: |
316+
# pip3 install .
317+
#
318+
# - name: ✂ Extract code snippet from README
319+
# shell: python
320+
# run: |
321+
# from pathlib import Path
322+
# import re
323+
#
324+
# ROOT = Path('.')
325+
#
326+
# with (ROOT / 'README.md').open('r') as rptr:
327+
# content = rptr.read()
328+
#
329+
# m = re.search(r"```py(thon)?(?P<code>.*?)```", content, re.MULTILINE|re.DOTALL)
330+
#
331+
# if m is None:
332+
# raise Exception("Regular expression did not find the example in the README!")
333+
#
334+
# with (ROOT / 'tests/docs/example.py').open('w') as wptr:
335+
# wptr.write(m["code"])
336+
#
337+
# - name: Print example.py
338+
# run: cat tests/docs/example.py
339+
#
340+
# - name: ☑ Run example snippet
341+
# working-directory: tests/docs
342+
# run: |
343+
# python3 example.py
344+
345+
BuildTheDocs:
346+
name: 📓 Run BuildTheDocs
347+
runs-on: ubuntu-latest
348+
# needs:
349+
# - VerifyDocs
350+
351+
env:
352+
ARTIFACT: pyTooling.TerminalUI-documentation
353+
outputs:
354+
artifact: ${{ env.ARTIFACT }}
355+
356+
steps:
357+
- name: Checkout repository
358+
uses: actions/checkout@v2
359+
360+
- name: 🚢 Build container image 'vhdl/doc'
361+
run: |
362+
docker build -t edaa/doc - <<-EOF
363+
FROM btdi/sphinx:featured
364+
RUN apk add -U --no-cache graphviz
365+
EOF
366+
367+
- name: 🛳️ Build documentation using container edaa/doc
368+
uses: buildthedocs/btd@v0
369+
with:
370+
skip-deploy: true
371+
372+
- name: 📤 Upload 'documentation' artifacts
373+
uses: actions/upload-artifact@master
374+
with:
375+
name: ${{ env.ARTIFACT }}
376+
path: doc/_build/html
377+
retention-days: 7
378+
379+
PublishToGitHubPages:
380+
name: 📚 Publish to GH-Pages
381+
runs-on: ubuntu-latest
382+
needs:
383+
- BuildTheDocs
384+
- Coverage
385+
# - StaticTypeCheck
386+
387+
env:
388+
DOC: ${{ needs.BuildTheDocs.outputs.artifact }}
389+
COVERAGE: ${{ needs.Coverage.outputs.artifact }}
390+
# TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
391+
outputs:
392+
artifact: ${{ env.ARTIFACT }}
393+
394+
steps:
395+
- name: Checkout repository
396+
uses: actions/checkout@v2
397+
398+
- name: 📥 Download artifacts '${{ env.DOC }}' from 'BuildTheDocs' job
399+
uses: actions/download-artifact@v2
400+
with:
401+
name: ${{ env.DOC }}
402+
path: public
403+
404+
- name: 📥 Download artifacts '${{ env.COVERAGE }}' from 'Coverage' job
405+
uses: actions/download-artifact@v2
406+
with:
407+
name: ${{ env.COVERAGE }}
408+
path: public/coverage
409+
410+
# - name: 📥 Download artifacts '${{ env.TYPING }}' from 'StaticTypeCheck' job
411+
# uses: actions/download-artifact@v2
412+
# with:
413+
# name: ${{ env.TYPING }}
414+
# path: public/typing
415+
416+
- name: '📓 Publish site to GitHub Pages'
417+
if: github.event_name != 'pull_request'
418+
run: |
419+
cd public
420+
touch .nojekyll
421+
git init
422+
cp ../.git/config ./.git/config
423+
git add .
424+
git config --local user.email "BuildTheDocs@GitHubActions"
425+
git config --local user.name "GitHub Actions"
426+
git commit -a -m "update ${{ github.sha }}"
427+
git push -u origin +HEAD:gh-pages
428+
229429
ArtifactCleanUp:
230430
name: 🗑️ Artifact Cleanup
231431
runs-on: ubuntu-latest
232-
233432
needs:
234-
- Package
235-
- PublishOnPyPI
433+
- Coverage
434+
# - StaticTypeCheck
435+
- BuildTheDocs
436+
- PublishToGitHubPages
236437

237438
env:
238-
ARTIFACT: ${{ needs.Package.outputs.artifact }}
439+
COVERAGE: ${{ needs.Coverage.outputs.artifact }}
440+
# TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
441+
DOC: ${{ needs.BuildTheDocs.outputs.artifact }}
239442

240443
steps:
241444
- name: 🗑️ Delete all Artifacts
242445
uses: geekyeggo/delete-artifact@v1
243446
with:
244447
name: |
245-
${{ env.ARTIFACT }}
448+
${{ env.COVERAGE }}
449+
${{ env.DOC }}
450+
# ${{ env.TYPING }}

.gitignore

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@ __pycache__/
44

55
# Coverage.py
66
.coverage
7+
.cov
78
coverage.xml
8-
/.cov
99

10-
# Sphinx documentation
11-
doc/_build
10+
# setuptools
11+
/build
12+
/dist
13+
/*.egg-info
1214

13-
# PyCharm project
15+
# Sphinx
16+
doc/_build/
17+
doc/pyTooling.TerminalUI/**/*.*
18+
!doc/pyTooling.TerminalUI/index.rst
19+
20+
# BuildTheDocs
21+
doc/_theme/**/*.*
22+
23+
# IntelliJ project files
1424
/.idea/workspace.xml

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/pyTerminalUI.iml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)