cikit 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. {cikit-0.0.2 → cikit-0.0.3}/.gitlab-ci.yml +7 -7
  2. {cikit-0.0.2 → cikit-0.0.3}/PKG-INFO +1 -1
  3. cikit-0.0.3/ci_commands/all_.py +79 -0
  4. {cikit-0.0.2/ci_scripts/commands → cikit-0.0.3/ci_commands}/coverage.py +4 -5
  5. {cikit-0.0.2/ci_scripts/commands → cikit-0.0.3/ci_commands}/init.py +1 -2
  6. {cikit-0.0.2/ci_scripts/commands → cikit-0.0.3/ci_commands}/pylint.py +3 -4
  7. {cikit-0.0.2/ci_scripts/commands → cikit-0.0.3/ci_commands}/ruff.py +3 -4
  8. {cikit-0.0.2/ci_scripts/commands → cikit-0.0.3/ci_commands}/sphinx.py +1 -2
  9. {cikit-0.0.2/ci_scripts/commands → cikit-0.0.3/ci_commands}/test.py +7 -8
  10. cikit-0.0.3/docs/getting_started.rst +140 -0
  11. cikit-0.0.3/docs/guides/ci_commands.rst +252 -0
  12. cikit-0.0.3/docs/guides/gitlab_ci.rst +82 -0
  13. {cikit-0.0.2 → cikit-0.0.3}/docs/guides/index.rst +1 -1
  14. cikit-0.0.3/docs/guides/local_pipeline.rst +252 -0
  15. cikit-0.0.3/docs/guides/sphinx_build.rst +92 -0
  16. {cikit-0.0.2 → cikit-0.0.3}/pyproject.toml +2 -1
  17. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/__init__.py +2 -1
  18. cikit-0.0.3/src/cikit/ci/README.md +180 -0
  19. cikit-0.0.3/src/cikit/ci/__init__.py +14 -0
  20. cikit-0.0.3/src/cikit/ci/loader.py +67 -0
  21. cikit-0.0.3/src/cikit/ci/main.py +56 -0
  22. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/env/cli.py +2 -2
  23. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/jobdata/cli.py +2 -2
  24. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/logging_utils.py +37 -46
  25. cikit-0.0.3/src/cikit/macros/README.md +223 -0
  26. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/macros/__init__.py +3 -1
  27. cikit-0.0.3/src/cikit/macros/cmake.py +115 -0
  28. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/macros/common.py +19 -0
  29. cikit-0.0.3/src/cikit/macros/coverage.py +191 -0
  30. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/macros/pytest.py +2 -83
  31. cikit-0.0.3/src/cikit/macros/test_report.py +94 -0
  32. {cikit-0.0.2 → cikit-0.0.3}/src/cikit.egg-info/PKG-INFO +1 -1
  33. {cikit-0.0.2 → cikit-0.0.3}/src/cikit.egg-info/SOURCES.txt +22 -16
  34. {cikit-0.0.2 → cikit-0.0.3}/src/cikit.egg-info/entry_points.txt +1 -0
  35. cikit-0.0.3/tests/systemtests/test_ci_cli.py +58 -0
  36. cikit-0.0.3/tests/unittests/test_ci_commands/test_all.py +66 -0
  37. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_jobdata/test_cli.py +1 -22
  38. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_logging_utils.py +3 -20
  39. cikit-0.0.3/tests/unittests/test_cikit/test_macros/test_cmake.py +198 -0
  40. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_macros/test_common.py +42 -0
  41. cikit-0.0.3/tests/unittests/test_cikit/test_macros/test_coverage.py +242 -0
  42. cikit-0.0.3/tests/unittests/test_cikit/test_macros/test_pytest.py +108 -0
  43. cikit-0.0.3/tests/unittests/test_cikit/test_macros/test_test_report.py +216 -0
  44. {cikit-0.0.2 → cikit-0.0.3}/uv.lock +1 -1
  45. cikit-0.0.2/ci_scripts/README.md +0 -83
  46. cikit-0.0.2/ci_scripts/__init__.py +0 -20
  47. cikit-0.0.2/ci_scripts/ci.py +0 -112
  48. cikit-0.0.2/ci_scripts/commands/all_.py +0 -72
  49. cikit-0.0.2/docs/getting_started.rst +0 -166
  50. cikit-0.0.2/docs/guides/ci_scripts.rst +0 -172
  51. cikit-0.0.2/docs/guides/gitlab_ci.rst +0 -42
  52. cikit-0.0.2/docs/guides/local_pipeline.rst +0 -38
  53. cikit-0.0.2/docs/guides/sphinx_build.rst +0 -32
  54. cikit-0.0.2/src/cikit/macros/README.md +0 -62
  55. cikit-0.0.2/src/cikit/macros/coverage.py +0 -113
  56. cikit-0.0.2/tests/unittests/test_ci_scripts/test_all.py +0 -60
  57. cikit-0.0.2/tests/unittests/test_cikit/test_macros/test_coverage.py +0 -125
  58. cikit-0.0.2/tests/unittests/test_cikit/test_macros/test_pytest.py +0 -190
  59. {cikit-0.0.2 → cikit-0.0.3}/.gitignore +0 -0
  60. {cikit-0.0.2 → cikit-0.0.3}/.project +0 -0
  61. {cikit-0.0.2 → cikit-0.0.3}/.pydevproject +0 -0
  62. {cikit-0.0.2 → cikit-0.0.3}/.pylintrc +0 -0
  63. {cikit-0.0.2 → cikit-0.0.3}/.repomixignore +0 -0
  64. {cikit-0.0.2 → cikit-0.0.3}/LICENSE +0 -0
  65. {cikit-0.0.2 → cikit-0.0.3}/README.md +0 -0
  66. {cikit-0.0.2/ci_scripts/commands → cikit-0.0.3/ci_commands}/__init__.py +0 -0
  67. {cikit-0.0.2 → cikit-0.0.3}/docs/Makefile +0 -0
  68. {cikit-0.0.2 → cikit-0.0.3}/docs/_static/logo/cikit-logo-192.png +0 -0
  69. {cikit-0.0.2 → cikit-0.0.3}/docs/_static/logo/cikit-logo.png +0 -0
  70. {cikit-0.0.2 → cikit-0.0.3}/docs/_static/logo/favicon.ico +0 -0
  71. {cikit-0.0.2 → cikit-0.0.3}/docs/build_reports/index.rst +0 -0
  72. {cikit-0.0.2 → cikit-0.0.3}/docs/build_reports/lint.rst +0 -0
  73. {cikit-0.0.2 → cikit-0.0.3}/docs/build_reports/tests.rst +0 -0
  74. {cikit-0.0.2 → cikit-0.0.3}/docs/concepts/artifacts.rst +0 -0
  75. {cikit-0.0.2 → cikit-0.0.3}/docs/concepts/environment.rst +0 -0
  76. {cikit-0.0.2 → cikit-0.0.3}/docs/concepts/index.rst +0 -0
  77. {cikit-0.0.2 → cikit-0.0.3}/docs/concepts/jobdata.rst +0 -0
  78. {cikit-0.0.2 → cikit-0.0.3}/docs/concepts/metadata.rst +0 -0
  79. {cikit-0.0.2 → cikit-0.0.3}/docs/concepts/providers.rst +0 -0
  80. {cikit-0.0.2 → cikit-0.0.3}/docs/conf.py +0 -0
  81. {cikit-0.0.2 → cikit-0.0.3}/docs/index.rst +0 -0
  82. {cikit-0.0.2 → cikit-0.0.3}/setup.cfg +0 -0
  83. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/badge.py +0 -0
  84. /cikit-0.0.2/ci_scripts/common.py → /cikit-0.0.3/src/cikit/ci/runner.py +0 -0
  85. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/command.py +0 -0
  86. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/env/README.md +0 -0
  87. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/env/__init__.py +0 -0
  88. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/env/api.py +0 -0
  89. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/env/common.py +0 -0
  90. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/env/env_vars.py +0 -0
  91. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/env/provider.py +0 -0
  92. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/errors.py +0 -0
  93. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/factory.py +0 -0
  94. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/jobdata/README.md +0 -0
  95. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/jobdata/__init__.py +0 -0
  96. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/jobdata/api.py +0 -0
  97. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/jobdata/client.py +0 -0
  98. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/jobdata/common.py +0 -0
  99. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/lint_to_rst.py +0 -0
  100. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/macros/pylint.py +0 -0
  101. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/macros/ruff.py +0 -0
  102. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/macros/sphinx.py +0 -0
  103. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/project_meta.py +0 -0
  104. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/.htaccess +0 -0
  105. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/README.md +0 -0
  106. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/config.php +0 -0
  107. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/config.php.example +0 -0
  108. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/jobdata_common.php +0 -0
  109. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/jobdata_create.php +0 -0
  110. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/jobdata_latest.php +0 -0
  111. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/jobdata_timeline.php +0 -0
  112. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/php/jobdata/jobdata_update.php +0 -0
  113. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/sql/jobdata/README.md +0 -0
  114. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/sql/jobdata/db_init.sql +0 -0
  115. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/resources/sql/jobdata/db_reset.sql +0 -0
  116. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/rst_tools.py +0 -0
  117. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/status.py +0 -0
  118. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/systemtest/__init__.py +0 -0
  119. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/systemtest/fixtures.py +0 -0
  120. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/timeline.py +0 -0
  121. {cikit-0.0.2 → cikit-0.0.3}/src/cikit/xml_tools.py +0 -0
  122. {cikit-0.0.2 → cikit-0.0.3}/src/cikit.egg-info/dependency_links.txt +0 -0
  123. {cikit-0.0.2 → cikit-0.0.3}/src/cikit.egg-info/requires.txt +0 -0
  124. {cikit-0.0.2 → cikit-0.0.3}/src/cikit.egg-info/top_level.txt +0 -0
  125. {cikit-0.0.2 → cikit-0.0.3}/tests/systemtests/conftest.py +0 -0
  126. {cikit-0.0.2 → cikit-0.0.3}/tests/systemtests/test_env_cli.py +0 -0
  127. {cikit-0.0.2 → cikit-0.0.3}/tests/systemtests/test_jobdata_cli.py +0 -0
  128. {cikit-0.0.2/tests/unittests/test_ci_scripts → cikit-0.0.3/tests/unittests/test_ci_commands}/__init__.py +0 -0
  129. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/__init__.py +0 -0
  130. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_badge.py +0 -0
  131. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_command.py +0 -0
  132. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_env/__init__.py +0 -0
  133. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_env/test_api.py +0 -0
  134. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_env/test_common.py +0 -0
  135. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_env/test_env_vars.py +0 -0
  136. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_env/test_provider.py +0 -0
  137. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_errors.py +0 -0
  138. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_factory.py +0 -0
  139. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_jobdata/__init__.py +0 -0
  140. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_jobdata/test_api.py +0 -0
  141. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_jobdata/test_client.py +0 -0
  142. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_jobdata/test_common.py +0 -0
  143. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_lint_to_rst.py +0 -0
  144. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_macros/__init__.py +0 -0
  145. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_macros/test_pylint.py +0 -0
  146. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_macros/test_ruff.py +0 -0
  147. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_macros/test_sphinx.py +0 -0
  148. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_project_meta.py +0 -0
  149. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_rst_tools.py +0 -0
  150. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_status.py +0 -0
  151. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_timeline.py +0 -0
  152. {cikit-0.0.2 → cikit-0.0.3}/tests/unittests/test_cikit/test_xml_tools.py +0 -0
@@ -58,7 +58,7 @@ default:
58
58
  init:
59
59
  stage: init
60
60
  script:
61
- - $EXEC_TOOL python -m ci_scripts.ci init
61
+ - $EXEC_TOOL cikit init
62
62
  artifacts:
63
63
  when: always
64
64
  expire_in: 1 week
@@ -72,7 +72,7 @@ init:
72
72
  ruff:
73
73
  stage: lint
74
74
  script:
75
- - $EXEC_TOOL python -m ci_scripts.ci ruff src tests/unittests tests/systemtests ci_scripts
75
+ - $EXEC_TOOL cikit ruff src tests ci_commands
76
76
  artifacts:
77
77
  when: always
78
78
  expire_in: 1 week
@@ -85,7 +85,7 @@ ruff:
85
85
  pylint:
86
86
  stage: lint
87
87
  script:
88
- - $EXEC_TOOL python -m ci_scripts.ci pylint src tests/unittests tests/systemtests ci_scripts
88
+ - $EXEC_TOOL cikit pylint src tests ci_commands
89
89
  artifacts:
90
90
  when: always
91
91
  expire_in: 1 week
@@ -103,7 +103,7 @@ pylint:
103
103
  unittests:
104
104
  stage: test
105
105
  script:
106
- - $EXEC_TOOL python -m ci_scripts.ci test tests/unittests --alias unittests
106
+ - $EXEC_TOOL cikit test tests/unittests --alias unittests
107
107
  artifacts:
108
108
  when: always
109
109
  paths:
@@ -112,7 +112,7 @@ unittests:
112
112
  systemtests:
113
113
  stage: test
114
114
  script:
115
- - $EXEC_TOOL python -m ci_scripts.ci test tests/systemtests --alias systemtests
115
+ - $EXEC_TOOL cikit test tests/systemtests --alias systemtests
116
116
  artifacts:
117
117
  when: always
118
118
  paths:
@@ -126,7 +126,7 @@ systemtests:
126
126
  coverage:
127
127
  stage: coverage
128
128
  script:
129
- - $EXEC_TOOL python -m ci_scripts.ci coverage
129
+ - $EXEC_TOOL cikit coverage
130
130
  artifacts:
131
131
  when: always
132
132
  paths:
@@ -149,7 +149,7 @@ coverage:
149
149
  sphinx:
150
150
  stage: doc
151
151
  script:
152
- - $EXEC_TOOL python -m ci_scripts.ci sphinx docs
152
+ - $EXEC_TOOL cikit sphinx docs
153
153
  when: always
154
154
  artifacts:
155
155
  when: always
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cikit
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: CI helper toolkit
5
5
  Author-email: Sven Schlender <svesch@gmx.de>
6
6
  License-Expression: GPL-3.0-or-later
@@ -0,0 +1,79 @@
1
+ # SPDX-License-Identifier: GPL-3.0-or-later
2
+ """Run all local CI commands.
3
+
4
+ This module executes the standard local CI workflow in a predefined order.
5
+ It is intended for local development and convenience usage and therefore
6
+ contains project-specific command configuration.
7
+
8
+ Author:
9
+ Sven Schlender
10
+ Date:
11
+ 2026-05-27
12
+ """
13
+
14
+ import argparse
15
+ from pathlib import Path
16
+
17
+ from ci_commands import coverage, init, pylint, ruff, sphinx, test
18
+
19
+
20
+ def run_step(title: str, func, args: argparse.Namespace) -> int:
21
+ """Run one CI command step.
22
+
23
+ Args:
24
+ title: Human-readable step title.
25
+ func: Command function to execute.
26
+ args: Parsed command arguments.
27
+
28
+ Returns:
29
+ Process exit code.
30
+ """
31
+ print()
32
+ print("=" * 80)
33
+ print(f"CI STEP: {title}")
34
+ print("=" * 80)
35
+
36
+ return func(args)
37
+
38
+
39
+ def command(args: argparse.Namespace) -> int:
40
+ """Run the complete local CI workflow.
41
+
42
+ Args:
43
+ args: Parsed command arguments.
44
+
45
+ Returns:
46
+ Process exit code.
47
+ """
48
+ steps = [
49
+ ("Init", init.command, argparse.Namespace(verbose=args.verbose)),
50
+ ("Ruff", ruff.command, argparse.Namespace(paths=["src", "tests", "ci_commands"],
51
+ verbose=args.verbose)),
52
+ ("Pylint", pylint.command, argparse.Namespace(paths=["src", "tests", "ci_commands"],
53
+ rcfile=".pylintrc", verbose=args.verbose)),
54
+ ("Unit tests", test.command, argparse.Namespace(test_path=Path("tests/unittests"),
55
+ alias="unittests", verbose=args.verbose)),
56
+ ("System tests", test.command, argparse.Namespace(test_path=Path("tests/systemtests"),
57
+ alias="systemtests",
58
+ verbose=args.verbose)),
59
+ ("Coverage", coverage.command, argparse.Namespace(verbose=args.verbose)),
60
+ ("Sphinx", sphinx.command, argparse.Namespace(docs_dir=Path("docs"),
61
+ verbose=args.verbose)),
62
+ ]
63
+
64
+ for title, func, step_args in steps:
65
+ result = run_step(title, func, step_args)
66
+ if result != 0:
67
+ return result
68
+
69
+ return 0
70
+
71
+
72
+ def register(subparsers: argparse._SubParsersAction):
73
+ """Register all command.
74
+
75
+ Args:
76
+ subparsers: Argparse subparser registry.
77
+ """
78
+ parser = subparsers.add_parser("all", help="Run the complete local CI workflow.")
79
+ parser.set_defaults(func=command)
@@ -12,11 +12,10 @@ Date:
12
12
 
13
13
  import argparse
14
14
 
15
- from cikit import CiSection
15
+ from cikit import CiSection, CiOptionalSection
16
16
  from cikit.macros import coverage, chart_timeline
17
17
  from cikit.errors import CiRecoverableError
18
-
19
- from ci_scripts.common import run_ci_script
18
+ from cikit.ci import run_ci_script
20
19
 
21
20
 
22
21
  def run(env, status, _args: argparse.Namespace):
@@ -28,12 +27,12 @@ def run(env, status, _args: argparse.Namespace):
28
27
  _args: Parsed command arguments.
29
28
  """
30
29
  with CiSection("Generating coverage", status=status):
31
- coverage.coverage(env)
30
+ coverage.pycoverage(env)
32
31
  coverage.badge(env)
33
32
  if env.jobdata.get("coverage", 0) < 70:
34
33
  raise CiRecoverableError("Coverage is below level!")
35
34
 
36
- with CiSection("Create timeline chart", status=status):
35
+ with CiOptionalSection("Create timeline chart", status=status):
37
36
  timeline = chart_timeline(env, keys=["coverage"], title="Coverage %", limit=20)
38
37
  timeline.create(env, "coverage")
39
38
 
@@ -15,8 +15,7 @@ import argparse
15
15
  from cikit import CiSection
16
16
  from cikit.env import pretty_print_env, prepare_dirs
17
17
  from cikit.macros import ai_assisted_badge, jobdata_prepare, python_badge
18
-
19
- from ci_scripts.common import run_ci_script
18
+ from cikit.ci import run_ci_script
20
19
 
21
20
 
22
21
  def run(env, status, _args: argparse.Namespace):
@@ -13,10 +13,9 @@ Date:
13
13
 
14
14
  import argparse
15
15
 
16
- from cikit import CiSection
16
+ from cikit import CiSection, CiOptionalSection
17
17
  from cikit.macros import pylint, chart_timeline
18
-
19
- from ci_scripts.common import run_ci_script
18
+ from cikit.ci import run_ci_script
20
19
 
21
20
 
22
21
  def run(env, status, args: argparse.Namespace):
@@ -33,7 +32,7 @@ def run(env, status, args: argparse.Namespace):
33
32
  with CiSection("Running ci provider specific pylint", status=status):
34
33
  pylint.ci_provider(env, args.paths)
35
34
 
36
- with CiSection("Create timeline chart", status=status):
35
+ with CiOptionalSection("Create timeline chart", status=status):
37
36
  timeline = chart_timeline(env, keys=["error", "warning", "refactoring", "convention"],
38
37
  title="Pylint messages", limit=20)
39
38
  timeline.create(env, "pylint")
@@ -12,10 +12,9 @@ Date:
12
12
 
13
13
  import argparse
14
14
 
15
- from cikit import CiSection
15
+ from cikit import CiSection, CiOptionalSection
16
16
  from cikit.macros import ruff, chart_timeline
17
-
18
- from ci_scripts.common import run_ci_script
17
+ from cikit.ci import run_ci_script
19
18
 
20
19
 
21
20
  def run(env, status, args: argparse.Namespace):
@@ -32,7 +31,7 @@ def run(env, status, args: argparse.Namespace):
32
31
  with CiSection("Running ci provider specific ruff", status=status):
33
32
  ruff.ci_provider(env, args.paths)
34
33
 
35
- with CiSection("Create timeline chart", status=status):
34
+ with CiOptionalSection("Create timeline chart", status=status):
36
35
  timeline = chart_timeline(env, keys=["violations"], title="Ruff violations", limit=20)
37
36
  timeline.create(env, "ruff")
38
37
 
@@ -15,8 +15,7 @@ from pathlib import Path
15
15
 
16
16
  from cikit import CiSection
17
17
  from cikit.macros import sphinx
18
-
19
- from ci_scripts.common import run_ci_script
18
+ from cikit.ci import run_ci_script
20
19
 
21
20
 
22
21
  def run(env, status, args: argparse.Namespace):
@@ -13,10 +13,9 @@ Date:
13
13
  import argparse
14
14
  from pathlib import Path
15
15
 
16
- from cikit import CiSection
17
- from cikit.macros import pytest, chart_timeline
18
-
19
- from ci_scripts.common import run_ci_script
16
+ from cikit import CiSection, CiOptionalSection
17
+ from cikit.macros import pytest, chart_timeline, test_report
18
+ from cikit.ci import run_ci_script
20
19
 
21
20
 
22
21
  def run(env, status, args: argparse.Namespace):
@@ -31,9 +30,9 @@ def run(env, status, args: argparse.Namespace):
31
30
 
32
31
  try:
33
32
  with CiSection(f"Running test '{test_alias}'", status=status):
34
- pytest.pytest(env, args.test_path, test_alias=test_alias, subtest=False)
33
+ pytest.pytest(env, args.test_path, test_alias=test_alias)
35
34
 
36
- with CiSection("Create timeline chart", status=status):
35
+ with CiOptionalSection("Create timeline chart", status=status):
37
36
  timeline = chart_timeline(env, keys=["tests", "failures", "errors"],
38
37
  title=f"{test_alias} tests", limit=20)
39
38
  timeline.create(env, f"test_{test_alias}")
@@ -41,8 +40,8 @@ def run(env, status, args: argparse.Namespace):
41
40
  finally:
42
41
  if env.jobdata:
43
42
  with CiSection("Create badge and rst files", status=status):
44
- pytest.badge(env, env.jobdata)
45
- pytest.write_rst(env, env.jobdata)
43
+ test_report.badge(env)
44
+ test_report.write_rst(env)
46
45
 
47
46
 
48
47
  def command(args: argparse.Namespace) -> int:
@@ -0,0 +1,140 @@
1
+ Getting Started
2
+ ===============
3
+
4
+ cikit is a lightweight CI helper framework that provides reusable building
5
+ blocks for local development workflows and CI pipelines.
6
+
7
+ Installation
8
+ ------------
9
+
10
+ Install cikit using pip:
11
+
12
+ .. code-block:: bash
13
+
14
+ pip install cikit
15
+
16
+ Or with uv:
17
+
18
+ .. code-block:: bash
19
+
20
+ uv add --dev cikit
21
+
22
+ Project Setup
23
+ -------------
24
+
25
+ Create a root-level package named ``ci_commands`` in your project:
26
+
27
+ .. code-block:: text
28
+
29
+ ci_commands/
30
+ |-- __init__.py
31
+ |-- init.py
32
+ |-- ruff.py
33
+ |-- pylint.py
34
+ |-- test.py
35
+ |-- coverage.py
36
+ |-- sphinx.py
37
+ `-- all_.py
38
+
39
+ The package name is mandatory. The ``cikit`` command discovers command modules
40
+ from this package automatically.
41
+
42
+ Minimal Example
43
+ ---------------
44
+
45
+ A minimal project setup could look like this:
46
+
47
+ .. code-block:: text
48
+
49
+ ci_commands/
50
+ |-- __init__.py
51
+ |-- init.py
52
+ |-- test.py
53
+ `-- all_.py
54
+
55
+ Each module registers one CLI command via a ``register()`` function.
56
+
57
+ Additional commands such as ``ruff``, ``pylint``, ``coverage`` or ``sphinx``
58
+ can be added as needed.
59
+
60
+ Running Commands
61
+ ----------------
62
+
63
+ Execute individual commands:
64
+
65
+ .. code-block:: bash
66
+
67
+ uv run cikit init
68
+ uv run cikit ruff
69
+ uv run cikit pylint
70
+ uv run cikit test
71
+ uv run cikit coverage
72
+ uv run cikit sphinx
73
+
74
+ Run the complete local workflow:
75
+
76
+ .. code-block:: bash
77
+
78
+ uv run cikit all
79
+
80
+ Generated Directories
81
+ ---------------------
82
+
83
+ The ``init`` command creates the standard output directories used by the
84
+ remaining commands:
85
+
86
+ .. code-block:: text
87
+
88
+ public/
89
+ ├── artifacts/
90
+ ├── badges/
91
+ └── rst/
92
+
93
+ The exact directory locations can be customized through environment variables.
94
+
95
+ Documentation
96
+ -------------
97
+
98
+ Additional guides are available in the documentation:
99
+
100
+ * CI command architecture
101
+ * Local pipeline execution
102
+ * GitLab CI integration
103
+ * Sphinx documentation generation
104
+
105
+ See:
106
+
107
+ .. code-block:: text
108
+
109
+ docs/guides/
110
+
111
+ Typical Workflow
112
+ ----------------
113
+
114
+ A common local development workflow is:
115
+
116
+ .. code-block:: bash
117
+
118
+ uv run cikit init
119
+ uv run cikit ruff
120
+ uv run cikit pylint
121
+ uv run cikit test
122
+ uv run cikit coverage
123
+ uv run cikit sphinx
124
+
125
+ Or simply:
126
+
127
+ .. code-block:: bash
128
+
129
+ uv run cikit all
130
+
131
+ Next Steps
132
+ ----------
133
+
134
+ For details on implementing custom commands and integrating reusable macros,
135
+ see:
136
+
137
+ * :doc:`guides/ci_commands`
138
+ * :doc:`guides/local_pipeline`
139
+ * :doc:`guides/gitlab_ci`
140
+ * :doc:`guides/sphinx_build`
@@ -0,0 +1,252 @@
1
+ CI Commands
2
+ ===========
3
+
4
+ .. contents::
5
+ :local:
6
+ :depth: 2
7
+
8
+ Overview
9
+ --------
10
+
11
+ cikit provides a reusable CI command runner. Projects define their concrete
12
+ workflow commands in a root-level Python package named ``ci_commands``.
13
+
14
+ All project command scripts must be placed inside this package. The package
15
+ name is fixed and must be exactly:
16
+
17
+ .. code-block:: text
18
+
19
+ ci_commands
20
+
21
+ The ``cikit`` console command discovers modules from this package
22
+ automatically, imports them, and registers their subcommands.
23
+
24
+ Architecture
25
+ ------------
26
+
27
+ .. code-block:: text
28
+
29
+ cikit
30
+ |
31
+ +-- cikit.ci.main
32
+ |
33
+ +-- cikit.ci.loader
34
+ |
35
+ +-- ci_commands.<command>
36
+ |
37
+ +-- cikit.ci.run_ci_script()
38
+ |
39
+ +-- cikit macros
40
+
41
+ This keeps the reusable CI execution logic inside cikit while the project
42
+ keeps full control over its own workflow.
43
+
44
+ Required Project Structure
45
+ --------------------------
46
+
47
+ A project using the command runner must provide a package named
48
+ ``ci_commands`` in the project root:
49
+
50
+ .. code-block:: text
51
+
52
+ ci_commands/
53
+ |-- __init__.py
54
+ |-- init.py
55
+ |-- ruff.py
56
+ |-- pylint.py
57
+ |-- test.py
58
+ |-- coverage.py
59
+ |-- sphinx.py
60
+ `-- all_.py
61
+
62
+ Each command module must provide a ``register(subparsers)`` function.
63
+
64
+ Main Entry Point
65
+ ----------------
66
+
67
+ The main CLI entry point is provided by cikit.
68
+
69
+ .. literalinclude:: ../../src/cikit/ci/main.py
70
+ :language: python
71
+ :linenos:
72
+
73
+ Command Discovery
74
+ -----------------
75
+
76
+ Command modules are discovered from the root-level ``ci_commands`` package.
77
+
78
+ .. literalinclude:: ../../src/cikit/ci/loader.py
79
+ :language: python
80
+ :linenos:
81
+
82
+ Shared Command Runner
83
+ ---------------------
84
+
85
+ The shared runner initializes logging, status handling, the CI environment and
86
+ top-level error handling.
87
+
88
+ .. literalinclude:: ../../src/cikit/ci/runner.py
89
+ :language: python
90
+ :linenos:
91
+
92
+ Command Modules
93
+ ---------------
94
+
95
+ Init Command
96
+ ^^^^^^^^^^^^
97
+
98
+ .. literalinclude:: ../../ci_commands/init.py
99
+ :language: python
100
+ :linenos:
101
+
102
+ Ruff Command
103
+ ^^^^^^^^^^^^
104
+
105
+ .. literalinclude:: ../../ci_commands/ruff.py
106
+ :language: python
107
+ :linenos:
108
+
109
+ Pylint Command
110
+ ^^^^^^^^^^^^^^
111
+
112
+ .. literalinclude:: ../../ci_commands/pylint.py
113
+ :language: python
114
+ :linenos:
115
+
116
+ Test Command
117
+ ^^^^^^^^^^^^
118
+
119
+ .. literalinclude:: ../../ci_commands/test.py
120
+ :language: python
121
+ :linenos:
122
+
123
+ Coverage Command
124
+ ^^^^^^^^^^^^^^^^
125
+
126
+ .. literalinclude:: ../../ci_commands/coverage.py
127
+ :language: python
128
+ :linenos:
129
+
130
+ Sphinx Command
131
+ ^^^^^^^^^^^^^^
132
+
133
+ .. literalinclude:: ../../ci_commands/sphinx.py
134
+ :language: python
135
+ :linenos:
136
+
137
+ Local Workflow Runner
138
+ ^^^^^^^^^^^^^^^^^^^^^
139
+
140
+ The ``all`` command is intentionally project-specific. It defines the local
141
+ workflow order explicitly.
142
+
143
+ .. literalinclude:: ../../ci_commands/all_.py
144
+ :language: python
145
+ :linenos:
146
+
147
+ Usage
148
+ -----
149
+
150
+ Run individual commands:
151
+
152
+ .. code-block:: bash
153
+
154
+ cikit init
155
+ cikit ruff src tests
156
+ cikit pylint src tests
157
+ cikit test tests/unittests --alias unittests
158
+ cikit coverage
159
+ cikit sphinx docs
160
+
161
+ With uv:
162
+
163
+ .. code-block:: bash
164
+
165
+ uv run cikit init
166
+ uv run cikit ruff src tests
167
+ uv run cikit pylint src tests
168
+ uv run cikit test tests/unittests --alias unittests
169
+ uv run cikit coverage
170
+ uv run cikit sphinx docs
171
+
172
+ Run the complete local workflow:
173
+
174
+ .. code-block:: bash
175
+
176
+ uv run cikit all
177
+
178
+ Command Module Template
179
+ -----------------------
180
+
181
+ A minimal command module looks like this:
182
+
183
+ .. code-block:: python
184
+
185
+ # SPDX-License-Identifier: GPL-3.0-or-later
186
+ """Example cikit command.
187
+
188
+ Author:
189
+ Sven Schlender
190
+ Date:
191
+ 2026-06-16
192
+ """
193
+
194
+ import argparse
195
+
196
+ from cikit.ci import run_ci_script
197
+
198
+
199
+ def run(env, status, args: argparse.Namespace):
200
+ """Run command logic.
201
+
202
+ Args:
203
+ env: Resolved CI job environment.
204
+ status: Shared CI run status object.
205
+ args: Parsed command arguments.
206
+ """
207
+
208
+
209
+ def command(args: argparse.Namespace) -> int:
210
+ """Run command.
211
+
212
+ Args:
213
+ args: Parsed command arguments.
214
+
215
+ Returns:
216
+ Process exit code.
217
+ """
218
+ return run_ci_script("example", lambda env, status: run(env, status, args),
219
+ args=args)
220
+
221
+
222
+ def register(subparsers: argparse._SubParsersAction):
223
+ """Register command.
224
+
225
+ Args:
226
+ subparsers: Argparse subparser registry.
227
+ """
228
+ parser = subparsers.add_parser("example", help="Run example command.")
229
+ parser.set_defaults(func=command)
230
+
231
+ Design Notes
232
+ ------------
233
+
234
+ The command layer should only orchestrate workflow steps. Reusable behavior
235
+ belongs into cikit macros.
236
+
237
+ Typical command responsibilities are:
238
+
239
+ * define command line arguments
240
+ * open CI log sections
241
+ * call reusable macros
242
+ * handle project-specific workflow order
243
+
244
+ Reusable implementation should stay in modules such as:
245
+
246
+ * ``cikit.macros.ruff``
247
+ * ``cikit.macros.pylint``
248
+ * ``cikit.macros.pytest``
249
+ * ``cikit.macros.coverage``
250
+ * ``cikit.macros.cmake``
251
+ * ``cikit.macros.test_report``
252
+ * ``cikit.macros.sphinx``