update helpers from pygitversionhelper

This commit is contained in:
cclecle
2023-03-23 01:17:18 +00:00
parent cbfc9949b2
commit d91599b010
5 changed files with 15 additions and 75 deletions

View File

@@ -4,4 +4,4 @@
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Unported License.
#
# You should have received a copy of the license along with this
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.

View File

@@ -40,63 +40,24 @@ if __name__ == "__main__":
pyproject = tomli.load(fp)
parser = argparse.ArgumentParser(
prog="continuous-integration-helper",
description="A tiny set of scripts to help continous integration on python",
prog="continuous-integration-helper", description="A tiny set of scripts to help continous integration on python"
)
parser.add_argument("-tc", "--type-check", dest="typecheck", action="store_true", help="enable static typing check")
parser.add_argument("-ut", "--unit-test", dest="unittest", action="store_true", help="enable unit-test")
parser.add_argument(
"-tc",
"--type-check",
dest="typecheck",
action="store_true",
help="enable static typing check",
"-cc", "--coverage-check", dest="coveragecheck", action="store_true", help="enable unit-test coverage check (requires unit-test)"
)
parser.add_argument("-qc", "--quality-check", dest="qualitycheck", action="store_true", help="enable code quality check")
parser.add_argument("-dg", "--doc-gen", dest="docgen", action="store_true", help="enable documentation generation using MkDoc")
parser.add_argument(
"-ut",
"--unit-test",
dest="unittest",
action="store_true",
help="enable unit-test",
)
parser.add_argument(
"-cc",
"--coverage-check",
dest="coveragecheck",
action="store_true",
help="enable unit-test coverage check (requires unit-test)",
"-pdf", "--doc-gen-pdf", dest="docgenpdf", action="store_true", help="enable pdf documentation export (requires doc-gen)"
)
parser.add_argument(
"-qc",
"--quality-check",
dest="qualitycheck",
action="store_true",
help="enable code quality check",
)
parser.add_argument(
"-dg",
"--doc-gen",
dest="docgen",
action="store_true",
help="enable documentation generation using MkDoc",
)
parser.add_argument(
"-pdf",
"--doc-gen-pdf",
dest="docgenpdf",
action="store_true",
help="enable pdf documentation export (requires doc-gen)",
)
parser.add_argument(
"-clg",
"--changelog-gen",
dest="changeloggen",
action="store_true",
help="enable changelog generation",
)
parser.add_argument("-clg", "--changelog-gen", dest="changeloggen", action="store_true", help="enable changelog generation")
args = parser.parse_args()

View File

@@ -69,16 +69,7 @@ class doc_gen(helper_withresults_base):
identifier = "src." + ".".join(parts)
print("::: " + identifier, file=fd)
cmdopts = [
f"{sys.executable}",
"-m",
"mkdocs",
"-v",
"build",
"--site-dir",
str(site_path),
"--clean",
]
cmdopts = [f"{sys.executable}", "-m", "mkdocs", "-v", "build", "--site-dir", str(site_path), "--clean"]
# little hack here, to enable / disable pdf generation using own class config
# => reason is mkdocs seems to try loading the plugin even if we disable it, so we need to
@@ -95,7 +86,6 @@ class doc_gen(helper_withresults_base):
"cover_logo": str(cls.project_rootdir_path / "docs-static" / "Library.jpg"),
"verbose": False,
"media_type": "print",
"headless_chrome_path": "chromium",
"exclude_pages": ["LICENSE"],
"output_path": str(site_path / "pdf" / "manual.pdf"),
}

View File

@@ -53,13 +53,7 @@ class helper_base(ABC):
@classmethod
def run_cmd_(cls, cmdarray):
process = subprocess.run(
cmdarray,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True,
check=True,
)
process = subprocess.run(cmdarray, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, check=True)
return process.stdout
@classmethod

View File

@@ -40,16 +40,11 @@ class unit_test(helper_withresults_base):
# we start coverage now because module files discovery is part of the coverage measurement
CoverageReportPath = Path(str(cls.get_result_dir()) + "_coverage")
cls._reset_dir(CoverageReportPath)
cov = coverage.Coverage(
cover_pylib=False,
branch=True,
source_pkgs=["src." + cls.pyproject["project"]["name"]],
)
cov = coverage.Coverage(cover_pylib=False, branch=True, source_pkgs=["src." + cls.pyproject["project"]["name"]])
cov.start()
package_tests = test_loader.discover(
start_dir=str(cls.project_rootdir_path / "test"),
top_level_dir=str(cls.project_rootdir_path / "test"),
start_dir=str(cls.project_rootdir_path / "test"), top_level_dir=str(cls.project_rootdir_path / "test")
)
if cls.enable_xml_export:
testRunner = xmlrunner.XMLTestRunner(output=str(str(cls.get_result_dir())))