diff --git a/helpers/complexity_check.py b/helpers/complexity_check.py index a61959a..529e872 100644 --- a/helpers/complexity_check.py +++ b/helpers/complexity_check.py @@ -19,6 +19,7 @@ from radon.cli import Config from radon.cli.harvest import CCHarvester, HCHarvester, MIHarvester from .helper_base import helper_withresults_base +from pprint import pprint class complexity_check(helper_withresults_base): diff --git a/helpers/doc_gen.py b/helpers/doc_gen.py index 232278e..7c86dd9 100644 --- a/helpers/doc_gen.py +++ b/helpers/doc_gen.py @@ -50,6 +50,7 @@ class doc_gen(helper_withresults_base): reference_path = doc_path / "reference" cls._reset_dir(reference_path) + # create one .md per python module for path in sorted((cls.project_rootdir_path / "src").rglob("*.py")): module_path = path.relative_to(cls.project_rootdir_path / "src").with_suffix("") doc_path = path.relative_to(cls.project_rootdir_path / "src").with_suffix(".md") @@ -57,14 +58,12 @@ class doc_gen(helper_withresults_base): parts = list(module_path.parts) - if parts[-1] == "__init__": - parts = parts[:-1] - elif parts[-1] == "__main__": + if parts[-1] in ("__init__", "__main__"): continue - cls._reset_dir(os.path.dirname(full_doc_path)) + cls._create_dir(full_doc_path.parent.resolve()) with open(full_doc_path, "w+") as fd: - identifier = "src." + ".".join(parts) + identifier = ".".join(parts) print("::: " + identifier, file=fd) cmdopts = [f"{sys.executable}", "-m", "mkdocs", "-v", "build", "--site-dir", str(site_path), "--clean"] @@ -93,6 +92,7 @@ class doc_gen(helper_withresults_base): with open(cls.project_rootdir_path / "mkdocs.yml", "w") as mkdocsCfgFile: mkdocsCfgFile.write(yaml.dump(mkdocsCfg, Dumper=Dumper, default_flow_style=False, sort_keys=False)) + print(" !! start doc generation") res = cls.run_cmd(cmdopts) print(res.decode()) print(" !! done") diff --git a/helpers/helper_base.py b/helpers/helper_base.py index ab88e6a..e1bf5db 100644 --- a/helpers/helper_base.py +++ b/helpers/helper_base.py @@ -11,6 +11,7 @@ from typing import TYPE_CHECKING from abc import ABC, abstractmethod import os +import shutil from pathlib import Path import subprocess @@ -34,11 +35,17 @@ class helper_base(ABC): return None @staticmethod - def _reset_dir(dirpath: Path): + def _create_dir(dirpath: Path): dirpath = Path(dirpath) if not os.path.exists(dirpath): os.makedirs(dirpath) - [f.unlink() for f in Path(dirpath).glob("*") if f.is_file()] + + @staticmethod + def _reset_dir(dirpath: Path): + dirpath = Path(dirpath) + if os.path.exists(dirpath): + shutil.rmtree(dirpath) + os.makedirs(dirpath) @classmethod def reset_result_dir(cls): diff --git a/helpers/quality_check.py b/helpers/quality_check.py index 4028148..c63207b 100644 --- a/helpers/quality_check.py +++ b/helpers/quality_check.py @@ -63,7 +63,7 @@ class quality_check(helper_withresults_base): [ "--load-plugins=pylint.extensions.mccabe", "--output-format=json,parseable", - "--disable=invalid-name", + "--disable=invalid-name,too-few-public-methods,too-many-arguments", # ignore "--ignore=_version.py", "--reports=y", "--score=yes", diff --git a/helpers/types_check.py b/helpers/types_check.py index e909464..26b7942 100644 --- a/helpers/types_check.py +++ b/helpers/types_check.py @@ -31,7 +31,6 @@ class types_check(helper_withresults_base): "--explicit-package-bases", # "--strict-equality", # "--check-untyped-defs", - "--enable-incomplete-feature=Unpack", # reports generation "--cobertura-xml-report", str(cls.get_result_dir()), diff --git a/mkdocs.yml b/mkdocs.yml index d730766..a40920c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,11 +15,11 @@ theme: - navigation.tabs - navigation.tabs.sticky - navigation.footer - - toc.integrate + - navigation.path - navigation.top - navigation.section - content.code.annotate - - navigation.prune + - navigation.expand - toc.follow palette: - media: '(prefers-color-scheme: dark)' @@ -45,19 +45,23 @@ plugins: default_handler: python handlers: python: + path: + - src options: filters: - '!^_[^_]' - inherited_members: true + inherited_members: false show_if_no_docstring: true show_signature_annotations: true show_source: false show_category_heading: true group_by_category: true - docstring_section_style: spacy show_root_full_path: false merge_init_into_class: true separate_signature: true + heading_level: 2 + docstring_section_style: spacy + show_root_toc_entry: false - with-pdf: cover_subtitle: User Manual cover_logo: C:\Users\chacha\git\pychangelogfactory\docs-static\Library.jpg @@ -115,4 +119,4 @@ markdown_extensions: emoji_generator: !!python/name:materialx.emoji.to_svg extra: branch: master - repository: pygitversionhelper + repository: pychangelogfactory diff --git a/pyproject.toml b/pyproject.toml index 2475436..d38c8ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ where = ["src"] [tool.setuptools.package-data] "pychangelogfactory.data" = ["*.*"] +"pysimpleini" = ["py.typed"] [project.urls] Homepage = "https://chacha.ddns.net/gitea/chacha/pychangelogfactory" diff --git a/src/pychangelogfactory/py.typed b/src/pychangelogfactory/py.typed new file mode 100644 index 0000000..807db6d --- /dev/null +++ b/src/pychangelogfactory/py.typed @@ -0,0 +1 @@ +# PlaceHolder \ No newline at end of file