Skip to content

Commit fb36154

Browse files
authored
v6.4.0
2 parents 2eebeec + fc08112 commit fb36154

11 files changed

Lines changed: 108 additions & 29 deletions

.github/workflows/ApplicationTesting.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,16 @@ jobs:
220220
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
221221
fi
222222
223-
- name: 🔧 Install wheel from artifact
223+
- name: 🔧 Install wheel from artifact (Ubuntu/macOS)
224+
if: ( matrix.system != 'windows' && matrix.system != 'windows-arm' )
224225
run: |
225-
ls -l install
226226
python -m pip install --disable-pip-version-check -U install/*.whl
227227
228+
- name: 🔧 Install wheel from artifact (Windows)
229+
if: ( matrix.system == 'windows' || matrix.system == 'windows-arm' )
230+
run: |
231+
python -m pip install -v --disable-pip-version-check (Get-Item .\install\*.whl).FullName
232+
228233
- name: ✅ Run application tests (Ubuntu/macOS)
229234
if: ( matrix.system != 'windows' && matrix.system != 'windows-arm' )
230235
run: |

.github/workflows/CompletePipeline.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ on:
9393
required: false
9494
default: 'windows-arm:pypy-3.10 windows-arm:pypy-3.11'
9595
type: string
96+
bandit:
97+
description: 'Run Static Application Security Testing (SAST) using Bandit.'
98+
required: false
99+
default: 'false'
100+
type: string
101+
pylint:
102+
description: 'Run Python linting using pylint.'
103+
required: false
104+
default: 'false'
105+
type: string
96106
codecov:
97107
description: 'Publish merged coverage and unittest reports to Codecov.'
98108
required: false
@@ -205,6 +215,8 @@ jobs:
205215
with:
206216
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
207217
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
218+
bandit: ${{ inputs.bandit }}
219+
pylint: ${{ inputs.pylint }}
208220
artifact: CodeQuality
209221

210222
DocCoverage:
@@ -219,7 +231,6 @@ jobs:
219231
uses: pyTooling/Actions/.github/workflows/Package.yml@main
220232
needs:
221233
- UnitTestingParams
222-
# - UnitTesting
223234
with:
224235
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
225236
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}

.github/workflows/ExtractConfiguration.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
coverageRC = "${{ inputs.coverage_config }}".strip()
115115
typingCoberturaFile = Path("report/typing/cobertura.xml")
116116
typingJUnitFile = Path("report/typing/StaticTypingSummary.xml")
117-
typingHTMLDirectory = Path("htmlmypy")
117+
typingHTMLDirectory = Path("report/typing/html")
118118
119119
# Read output paths from 'pyproject.toml' file
120120
if coverageRC == "pyproject.toml":
@@ -123,14 +123,34 @@ jobs:
123123
with pyProjectFile.open("rb") as file:
124124
pyProjectSettings = tomli_load(file)
125125
126-
unittestXMLFile = Path(pyProjectSettings["tool"]["pytest"]["junit_xml"])
127-
mergedUnittestXMLFile = Path(pyProjectSettings["tool"]["pyedaa-reports"]["junit_xml"])
128-
coverageHTMLDirectory = Path(pyProjectSettings["tool"]["coverage"]["html"]["directory"])
129-
coverageXMLFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
130-
coverageJSONFile= Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
131-
typingCoberturaFile = Path(pyProjectSettings["tool"]["mypy"]["cobertura_xml_report"]) / "cobertura.xml"
132-
typingJUnitFile = Path(pyProjectSettings["tool"]["mypy"]["junit_xml"])
133-
typingHTMLDirectory = Path(pyProjectSettings["tool"]["mypy"]["html_report"])
126+
toolSection = pyProjectSettings["tool"]
127+
if "pytest" in toolSection:
128+
section = toolSection["pytest"]
129+
if "junit_xml" in section:
130+
unittestXMLFile = Path(section["junit_xml"])
131+
132+
if "pyedaa-reports" in toolSection:
133+
section = toolSection["pyedaa-reports"]
134+
if "junit_xml" in section:
135+
mergedUnittestXMLFile = Path(section["junit_xml"])
136+
137+
if "coverage" in toolSection:
138+
section = toolSection["coverage"]
139+
if "html" in section:
140+
coverageHTMLDirectory = Path(section["html"]["directory"])
141+
if "xml" in section:
142+
coverageXMLFile = Path(section["xml"]["output"])
143+
if "json" in section:
144+
coverageJSONFile= Path(section["json"]["output"])
145+
146+
if "mypy" in toolSection:
147+
section = toolSection["mypy"]
148+
if "cobertura_xml_report" in section:
149+
typingCoberturaFile = Path(section["cobertura_xml_report"]) / "cobertura.xml"
150+
if "junit_xml" in section:
151+
typingJUnitFile = Path(section["junit_xml"])
152+
if "html_report" in section:
153+
typingHTMLDirectory = Path(section["html_report"])
134154
else:
135155
print(f"File '{pyProjectFile}' not found.")
136156
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")

.github/workflows/Parameters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
package_name = "${{ inputs.package_name }}".strip()
165165
name = "${{ inputs.name }}".strip()
166166
167-
if package_namespace == "": # or package_namespace == ".":
167+
if package_namespace == "":
168168
package_fullname = package_name
169169
package_directory = package_name
170170
elif package_namespace[-2:] == ".*":

.github/workflows/PrepareJob.yml

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,14 @@ jobs:
191191
printf "${ANSI_LIGHT_GREEN} [OK]\n"
192192
193193
default_branch="${defaultBranch}"
194-
printf " default_branch=%s\n" "${default_branch}"
194+
printf " Default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${default_branch}"
195195
else
196196
printf "${ANSI_LIGHT_RED} [FAILED]\n"
197-
printf " %s\n" "${default_branch}"
197+
printf " ${ANSI_LIGHT_RED}%s${ANSI_NOCOLOR}\n" "${default_branch}"
198198
fi
199199
200200
printf "Commit checks:\n"
201+
printf " Commit: %s\n" "${{ github.sha }}"
201202
printf " Commit kind "
202203
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
203204
is_regular_commit="true"
@@ -208,24 +209,37 @@ jobs:
208209
fi
209210
210211
printf "Branch checks:\n"
212+
printf " Branch: %s\n" "${branch}"
213+
printf " Commit on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${defaultBranch}"
211214
if [[ "${branch}" == "${defaultBranch}" ]]; then
212215
on_default_branch="true"
213-
printf " Commit on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${defaultBranch}"
216+
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
217+
else
218+
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
214219
fi
215220
221+
printf " Commit on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.main_branch }}"
216222
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
217223
on_main_branch="true"
218-
printf " Commit on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
224+
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
225+
else
226+
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
219227
fi
220228
229+
printf " Commit on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.release_branch }}"
221230
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
222231
on_release_branch="true"
223-
printf " Commit on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
232+
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
233+
else
234+
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
224235
fi
225236
237+
printf " Commit on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.development_branch }}"
226238
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
227239
on_dev_branch="true"
228-
printf " Commit on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
240+
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
241+
else
242+
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
229243
fi
230244
231245
if [[ "${is_merge_commit}" == "true" ]]; then
@@ -261,11 +275,14 @@ jobs:
261275
262276
NIGHTLY_TAG_PATTERN='^${{ inputs.nightly_tag_pattern }}$'
263277
RELEASE_TAG_PATTERN='^${{ inputs.release_tag_pattern }}$'
264-
printf " Check tag name against regexp '%s' ... " "${RELEASE_TAG_PATTERN}"
265-
if [[ "${tag}" =~ NIGHTLY_TAG_PATTERN ]]; then
278+
279+
printf "Tag checks:\n"
280+
printf " Tag: %s\n" "${tag}"
281+
printf " Check tag '%s' against regexp ... " "${tag}"
282+
if [[ "${tag}" =~ ${NIGHTLY_TAG_PATTERN} ]]; then
266283
printf "${ANSI_LIGHT_GREEN}[NIGHTLY]${ANSI_NOCOLOR}\n"
267284
is_nightly_tag="true"
268-
elif [[ "${tag}" =~ $RELEASE_TAG_PATTERN ]]; then
285+
elif [[ "${tag}" =~ ${RELEASE_TAG_PATTERN} ]]; then
269286
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
270287
version="${tag}"
271288
is_release_tag="true"
@@ -277,6 +294,30 @@ jobs:
277294
printf "::error title=RexExpCheck::Tag name '%s' doesn't conform to regexp '%s' nor '%s'.\n" "${tag}" "${NIGHTLY_TAG_PATTERN}" "${RELEASE_TAG_PATTERN}"
278295
exit 1
279296
fi
297+
298+
if [[ "${is_nightly_tag}" == "true" ]]; then
299+
printf " Check if nightly tag is on main branch '%s' ... " "${{ inputs.main_branch }}"
300+
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.main_branch }}" > /dev/null
301+
if [[ $? -eq 0 ]]; then
302+
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
303+
else
304+
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
305+
printf " ${ANSI_LIGHT_RED}Tag '%s' isn't on branch '%s'.${ANSI_NOCOLOR}\n" "${tag}" "${{ inputs.main_branch }}"
306+
printf "::error title=TagCheck::Tag '%s' isn't on branch '%s'.\n" "${tag}" "${{ inputs.main_branch }}"
307+
exit 1
308+
fi
309+
elif [[ "${is_release_tag}" == "true" ]]; then
310+
printf " Check if release tag is on main branch '%s' ... " "${{ inputs.main_branch }}"
311+
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.main_branch }}" > /dev/null
312+
if [[ $? -eq 0 ]]; then
313+
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
314+
else
315+
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
316+
printf " ${ANSI_LIGHT_RED}Tag '%s' isn't on branch '%s'.${ANSI_NOCOLOR}\n" "${tag}" "${{ inputs.main_branch }}"
317+
printf "::error title=TagCheck::Tag '%s' isn't on branch '%s'.\n" "${tag}" "${{ inputs.main_branch }}"
318+
exit 1
319+
fi
320+
fi
280321
elif [[ "${ref:0:10}" == "refs/pull/" ]]; then
281322
printf "${ANSI_LIGHT_YELLOW}[PULL REQUEST]\n"
282323
ref_kind="pullrequest"

dist/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
wheel ~= 0.45
2-
twine ~= 6.1
2+
twine ~= 6.2

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Example Pipelines
164164
.. code-block:: toml
165165
166166
[build-system]
167-
requires = ["setuptools >= 80.0", "wheel ~= 0.45", "pyTooling ~= 8.5"]
167+
requires = ["setuptools >= 80.0", "wheel ~= 0.45", "pyTooling ~= 8.7"]
168168
build-backend = "setuptools.build_meta"
169169
170170
[tool.mypy]

doc/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r ../requirements.txt
22

3-
pyTooling ~= 8.5
3+
pyTooling ~= 8.7
44

55
# Enforce latest version on ReadTheDocs
66
sphinx ~= 8.2
@@ -13,7 +13,7 @@ sphinx_rtd_theme ~= 3.0
1313
# Sphinx Extenstions
1414
sphinxcontrib-mermaid ~= 1.0
1515
autoapi >= 2.0.1
16-
sphinx_design ~= 0.6.1
17-
sphinx-copybutton >= 0.5.2
16+
sphinx_design ~= 0.6
17+
sphinx-copybutton >= 0.5
1818
sphinx_autodoc_typehints ~= 3.2
1919
sphinx_reports ~= 0.9

myPackage/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
__keywords__ = ["GitHub Actions"]
4141
__issue_tracker__ = "https://GitHub.com/pyTooling/Actions/issues"
4242

43+
from pickle import dumps
4344
from subprocess import check_call
4445

4546
from pyTooling.Decorators import export, readonly

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
requires = [
33
"setuptools >= 80.0",
44
"wheel ~= 0.45",
5-
"pyTooling ~= 8.5"
5+
"pyTooling ~= 8.7"
66
]
77
build-backend = "setuptools.build_meta"
88

99
[tool.pylint.format]
1010
indent-string="\t"
1111
max-line-length = 120
12+
ignore-long-lines = "^.{0,110}#: .*"
1213

1314
[tool.pylint.basic]
1415
argument-naming-style = "camelCase"

0 commit comments

Comments
 (0)