mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Updating r6 from v6.7.0
This commit is contained in:
52
.github/workflows/CompletePipeline.yml
vendored
52
.github/workflows/CompletePipeline.yml
vendored
@@ -177,6 +177,58 @@ jobs:
|
||||
exclude_list: ${{ inputs.unittest_exclude_list }}
|
||||
disable_list: ${{ inputs.unittest_disable_list }}
|
||||
|
||||
VersionCheck:
|
||||
name: ''
|
||||
runs-on: 'ubuntu-24.04'
|
||||
needs:
|
||||
- Prepare
|
||||
- UnitTestingParams
|
||||
if: needs.Prepare.outputs.version != '' && needs.UnitTestingParams.outputs.package_version_file != ''
|
||||
outputs:
|
||||
code_version: ${{ steps.extract.outputs.code_version }}
|
||||
steps:
|
||||
- name: ⏬ Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
# The command 'git describe' (used for version) needs the history.
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🔧 Install pyTooling dependencies (native)
|
||||
run: |
|
||||
python -m pip install --disable-pip-version-check -U pyTooling
|
||||
|
||||
- name: Extract version from Python source file
|
||||
id: extract
|
||||
if: endsWith(needs.UnitTestingParams.outputs.package_version_file, '.py')
|
||||
shell: python
|
||||
run: |
|
||||
from pathlib import Path
|
||||
from sys import exit
|
||||
from pyTooling.Packaging import extractVersionInformation
|
||||
|
||||
expectedVersion = "${{ needs.Prepare.outputs.version }}".strip()
|
||||
|
||||
versionFile = Path("${{ needs.UnitTestingParams.outputs.package_version_file }}")
|
||||
if not versionFile.exists():
|
||||
print(f"::error title=CompletePipeline::Version file '{versionFile}' not found.")
|
||||
exit(1)
|
||||
|
||||
versionInformation = extractVersionInformation(versionFile)
|
||||
print(f"expected: {expectedVersion}")
|
||||
print(f"from code: {versionInformation.Version}")
|
||||
|
||||
if expectedVersion != versionInformation.Version:
|
||||
print(f"::error title=CompletePipeline::Expected version does not version in Python code.")
|
||||
exit(2)
|
||||
|
||||
# Write jobs to special file
|
||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||
print(f"GITHUB_OUTPUT: {github_output}")
|
||||
with github_output.open("a+", encoding="utf-8") as f:
|
||||
f.write(dedent(f"""\
|
||||
code_version={versionInformation.Version}
|
||||
"""))
|
||||
|
||||
UnitTesting:
|
||||
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r6
|
||||
needs:
|
||||
|
||||
40
.github/workflows/Parameters.yml
vendored
40
.github/workflows/Parameters.yml
vendored
@@ -45,6 +45,11 @@ on:
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
version_file:
|
||||
description: "Path to module containing the version ('__version__' variable)."
|
||||
required: false
|
||||
default: '__init__.py'
|
||||
type: string
|
||||
python_version:
|
||||
description: 'Python version.'
|
||||
required: false
|
||||
@@ -121,6 +126,9 @@ on:
|
||||
package_directory:
|
||||
description: "The package's directory."
|
||||
value: ${{ jobs.Parameters.outputs.package_directory }}
|
||||
package_version_file:
|
||||
description: "Path to the package's module containing the version ('__version__' variable)."
|
||||
value: ${{ jobs.Parameters.outputs.package_version_file }}
|
||||
artifact_basename:
|
||||
description: "Artifact base name."
|
||||
value: ${{ jobs.Parameters.outputs.artifact_basename }}
|
||||
@@ -139,11 +147,18 @@ jobs:
|
||||
python_version: ${{ steps.variables.outputs.python_version }}
|
||||
package_fullname: ${{ steps.variables.outputs.package_fullname }}
|
||||
package_directory: ${{ steps.variables.outputs.package_directory }}
|
||||
package_version_file: ${{ steps.variables.outputs.package_version_file }}
|
||||
artifact_basename: ${{ steps.variables.outputs.artifact_basename }}
|
||||
artifact_names: ${{ steps.artifacts.outputs.artifact_names }}
|
||||
python_jobs: ${{ steps.jobs.outputs.python_jobs }}
|
||||
|
||||
steps:
|
||||
- name: ⏬ Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
# The command 'git describe' (used for version) needs the history.
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate a startup delay of ${{ inputs.pipeline-delay }} seconds
|
||||
id: delay
|
||||
if: inputs.pipeline-delay >= 0
|
||||
@@ -162,6 +177,7 @@ jobs:
|
||||
python_version = "${{ inputs.python_version }}".strip()
|
||||
package_namespace = "${{ inputs.package_namespace }}".strip()
|
||||
package_name = "${{ inputs.package_name }}".strip()
|
||||
version_file = "${{ inputs.version_file }}".strip()
|
||||
name = "${{ inputs.name }}".strip()
|
||||
|
||||
if package_namespace == "":
|
||||
@@ -174,15 +190,27 @@ jobs:
|
||||
package_fullname = f"{package_namespace}.{package_name}"
|
||||
package_directory = f"{package_namespace}/{package_name}"
|
||||
|
||||
packageDirectory = Path(package_directory)
|
||||
packageVersionFile = packageDirectory / version_file
|
||||
print(f"Check if package version file '{packageVersionFile}' exists ... ", end="")
|
||||
if packageVersionFile.exists():
|
||||
print("✅")
|
||||
package_version_file = packageVersionFile.as_posix()
|
||||
else:
|
||||
print("❌")
|
||||
package_version_file = ""
|
||||
print(f"::warning title=Parameters::Version file '{packageVersionFile}' not found.")
|
||||
|
||||
artifact_basename = package_fullname if name == "" else name
|
||||
if artifact_basename == "" or artifact_basename == ".":
|
||||
print("::error title=Parameter::artifact_basename is empty.")
|
||||
print("::error title=Parameters::artifact_basename is empty.")
|
||||
exit(1)
|
||||
|
||||
print("Variables:")
|
||||
print(f" python_version: {python_version}")
|
||||
print(f" package_fullname: {package_fullname}")
|
||||
print(f" package_directory: {package_directory}")
|
||||
print(f" package_version_file: {package_directory}")
|
||||
print(f" artifact_basename: {artifact_basename}")
|
||||
|
||||
# Write jobs to special file
|
||||
@@ -193,6 +221,7 @@ jobs:
|
||||
python_version={python_version}
|
||||
package_fullname={package_fullname}
|
||||
package_directory={package_directory}
|
||||
package_version_file={package_version_file}
|
||||
artifact_basename={artifact_basename}
|
||||
"""))
|
||||
|
||||
@@ -263,7 +292,7 @@ jobs:
|
||||
currentAlphaRelease = "3.15.0-a.1"
|
||||
|
||||
if systems == "":
|
||||
print("::error title=Parameter::system_list is empty.")
|
||||
print("::error title=Parameters::system_list is empty.")
|
||||
else:
|
||||
systems = [sys.strip() for sys in systems.split(" ")]
|
||||
|
||||
@@ -431,9 +460,10 @@ jobs:
|
||||
printf "python_version: %s\n" '${{ steps.variables.outputs.python_version }}'
|
||||
printf "package_fullname: %s\n" '${{ steps.variables.outputs.package_fullname }}'
|
||||
printf "package_directory: %s\n" '${{ steps.variables.outputs.package_directory }}'
|
||||
printf "package_version_file: %s\n" '${{ steps.variables.outputs.package_version_file }}'
|
||||
printf "artifact_basename: %s\n" '${{ steps.variables.outputs.artifact_basename }}'
|
||||
printf "====================\n"
|
||||
printf "================================================================================\n"
|
||||
printf "artifact_names: %s\n" '${{ steps.artifacts.outputs.artifact_names }}'
|
||||
printf "====================\n"
|
||||
printf "================================================================================\n"
|
||||
printf "python_jobs: %s\n" '${{ steps.jobs.outputs.python_jobs }}'
|
||||
printf "====================\n"
|
||||
printf "================================================================================\n"
|
||||
|
||||
2
.github/workflows/PublishReleaseNotes.yml
vendored
2
.github/workflows/PublishReleaseNotes.yml
vendored
@@ -549,7 +549,7 @@ jobs:
|
||||
)" \
|
||||
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories, "latest": $jsonLatest}' \
|
||||
)" \
|
||||
'{"version": "$structVersion", "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
||||
'{"version": $structVersion, "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
5
.github/workflows/_Checking_JobTemplates.yml
vendored
5
.github/workflows/_Checking_JobTemplates.yml
vendored
@@ -15,9 +15,8 @@ jobs:
|
||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r6
|
||||
with:
|
||||
package_name: 'myPackage'
|
||||
python_version: '3.13' # workaround to use Sphinx in Python 3.13 for sphinx_reports not yet supporting lxml 6.0
|
||||
python_version_list: '3.10 3.11 3.12 3.13 3.14 pypy-3.10 pypy-3.11'
|
||||
disable_list: 'windows-arm:pypy-3.10 windows-arm:pypy-3.11'
|
||||
python_version_list: '3.11 3.12 3.13 3.14 pypy-3.11'
|
||||
disable_list: 'windows-arm:pypy-3.11'
|
||||
|
||||
PlatformTestingParams:
|
||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r6
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
with:
|
||||
package_namespace: 'myFramework'
|
||||
package_name: 'Extension'
|
||||
unittest_python_version: '3.13' # workaround to use Sphinx in Python 3.13 for sphinx_reports not yet supporting lxml 6.0
|
||||
unittest_python_version_list: '3.11 3.12 3.13 3.14 pypy-3.11'
|
||||
bandit: 'true'
|
||||
pylint: 'true'
|
||||
codecov: 'true'
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@r6
|
||||
with:
|
||||
package_name: 'myPackage'
|
||||
unittest_python_version: '3.13' # workaround to use Sphinx in Python 3.13 for sphinx_reports not yet supporting lxml 6.0
|
||||
unittest_python_version_list: '3.11 3.12 3.13 3.14 pypy-3.11'
|
||||
bandit: 'true'
|
||||
pylint: 'true'
|
||||
codecov: 'true'
|
||||
|
||||
@@ -164,7 +164,7 @@ Example Pipelines
|
||||
.. code-block:: toml
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools >= 80.0", "wheel ~= 0.45", "pyTooling ~= 8.7"]
|
||||
requires = ["setuptools >= 80.0", "wheel ~= 0.45", "pyTooling ~= 8.8"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.mypy]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-r ../requirements.txt
|
||||
|
||||
pyTooling ~= 8.7
|
||||
pyTooling ~= 8.8
|
||||
|
||||
# Enforce latest version on ReadTheDocs
|
||||
sphinx ~= 8.2
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
requires = [
|
||||
"setuptools >= 80.0",
|
||||
"wheel ~= 0.45",
|
||||
"pyTooling ~= 8.7"
|
||||
"pyTooling ~= 8.8"
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
@@ -38,23 +38,21 @@ junit_xml = "report/typing/StaticTypingSummary.xml"
|
||||
cobertura_xml_report = "report/typing"
|
||||
|
||||
[tool.pytest]
|
||||
junit_xml = "report/unit/UnittestReportSummary.xml"
|
||||
|
||||
[tool.pyedaa-reports]
|
||||
junit_xml = "report/unit/unittest.xml"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "--tb=native"
|
||||
addopts = ["--tb=native"]
|
||||
# Don't set 'python_classes = *' otherwise, pytest doesn't search for classes
|
||||
# derived from unittest.Testcase
|
||||
python_files = "*"
|
||||
python_functions = "test_*"
|
||||
python_files = ["*"]
|
||||
python_functions = ["test_*"]
|
||||
filterwarnings = [
|
||||
"error::DeprecationWarning",
|
||||
"error::PendingDeprecationWarning"
|
||||
]
|
||||
junit_xml = "report/unit/UnittestReportSummary.xml"
|
||||
junit_logging = "all"
|
||||
|
||||
[tool.pyedaa-reports]
|
||||
junit_xml = "report/unit/unittest.xml"
|
||||
|
||||
[tool.interrogate]
|
||||
color = true
|
||||
verbose = 1 # possible values: 0 (minimal output), 1 (-v), 2 (-vv)
|
||||
|
||||
@@ -1 +1 @@
|
||||
pyTooling ~= 8.7
|
||||
pyTooling ~= 8.8
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Coverage ~= 7.11
|
||||
|
||||
# Test Runner
|
||||
pytest ~= 8.4
|
||||
pytest ~= 9.0
|
||||
pytest-cov ~= 7.0
|
||||
|
||||
# Static Type Checking
|
||||
|
||||
Reference in New Issue
Block a user