open-quality-cli 0.1.0__py3-none-any.whl

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.
cli/renderer.py ADDED
@@ -0,0 +1,81 @@
1
+ from __future__ import annotations
2
+
3
+ from .model import Bundle, Check, Report
4
+
5
+
6
+ def mermaid(bundle: Bundle) -> str:
7
+ assert bundle.project
8
+ workflow = bundle.workflows[bundle.project.spec["workflow"]]
9
+ lines = ["flowchart LR"]
10
+ for stage_id in workflow.spec["stages"]:
11
+ stage = bundle.stages[stage_id]
12
+ lines.append(
13
+ f' n_{stage_id.replace("-", "_")}["{stage.name.replace(chr(34), r"\"")}"]'
14
+ )
15
+ lines.extend(
16
+ f" n_{dependency.replace('-', '_')} --> n_{stage_id.replace('-', '_')}"
17
+ for dependency in stage.spec.get("dependsOn", [])
18
+ )
19
+ return "\n".join(lines) + "\n"
20
+
21
+
22
+ def ascii(bundle: Bundle) -> str:
23
+ assert bundle.project
24
+ stages = bundle.workflows[bundle.project.spec["workflow"]].spec["stages"]
25
+ lines = ["Stage dependency graph (list order does not define execution order)"]
26
+ for stage_id in stages:
27
+ stage = bundle.stages[stage_id]
28
+ depends = stage.spec.get("dependsOn", [])
29
+ lines.append(
30
+ f"[{stage.name}]" + (f" (after {', '.join(depends)})" if depends else "")
31
+ )
32
+ return "\n".join(lines) + "\n"
33
+
34
+
35
+ def _check(check: Check) -> str:
36
+ icon = "✓" if check.passed else "!" if check.warning else "✗"
37
+ return (
38
+ f"{icon} {check.name}" + (f" — {check.reason}" if check.reason else "") + "\n"
39
+ )
40
+
41
+
42
+ def _status_icon(status: str) -> str:
43
+ return {"completed": "✓", "running": "▶", "blocked": "✗"}.get(status, "○")
44
+
45
+
46
+ def evaluation(report: Report) -> str:
47
+ lines = [
48
+ f"Quality evaluation: {report.project}",
49
+ f"Workflow: {report.workflow}",
50
+ "",
51
+ "Requirements",
52
+ ]
53
+ lines.extend(_check(item).rstrip("\n") for item in report.requirements)
54
+ lines.extend(["", "Stages"])
55
+ for stage in report.stages:
56
+ lines.append(
57
+ f"{_status_icon(stage.status)} {stage.status.upper():<12} {stage.name}"
58
+ )
59
+ if stage.approval:
60
+ lines.append(" approval: " + _check(stage.approval).rstrip("\n"))
61
+ lines.extend(
62
+ " documentation: " + _check(item).rstrip("\n")
63
+ for item in stage.documentation
64
+ )
65
+ lines.extend(["", "Overall: " + ("READY" if report.ready else "NOT READY")])
66
+ return "\n".join(lines) + "\n"
67
+
68
+
69
+ def status(report: Report) -> str:
70
+ lines = [
71
+ f"Project: {report.project}",
72
+ f"Workflow: {report.workflow}",
73
+ f"Current / active stages: {report.current_stage}",
74
+ "",
75
+ ]
76
+ for state in ("completed", "running", "blocked", "pending"):
77
+ names = sorted(item.name for item in report.stages if item.status == state)
78
+ if names:
79
+ lines.append(f"{_status_icon(state)} {state.title()}")
80
+ lines.extend(f" - {name}" for name in names)
81
+ return "\n".join(lines) + "\n"
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: open-quality-cli
3
+ Version: 0.1.0
4
+ Summary: Command-line interface for the Open Quality 0.1 specification
5
+ License-Expression: GPL-3.0-only
6
+ Project-URL: Homepage, https://github.com/duanribeiro/open-quality
7
+ Project-URL: Repository, https://github.com/duanribeiro/open-quality
8
+ Project-URL: Issues, https://github.com/duanribeiro/open-quality/issues
9
+ Keywords: quality,quality-as-code,software-quality,open-quality
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: NOTICE
24
+ Requires-Dist: PyYAML>=6.0
25
+ Requires-Dist: jsonschema>=4.18
26
+ Provides-Extra: dev
27
+ Requires-Dist: black<26,>=24.0; extra == "dev"
28
+ Dynamic: license-file
29
+
30
+ # Open Quality
31
+
32
+ Open Quality is an experimental, vendor-neutral specification for **Quality as Code**: the practice of representing software-quality expectations and governance as declarative, version-controlled artifacts.
33
+
34
+ The specification defines a **Quality Contract** that can describe:
35
+
36
+ - what quality means for a software system;
37
+ - which requirements and measurable targets apply;
38
+ - which workflow and stages a change must pass through;
39
+ - who owns work and who must approve decisions;
40
+ - which refinement documentation supports a quality decision.
41
+
42
+ Open Quality is not a test framework, workflow engine, certification, AI product, or hosted platform. It is an open format that tools may author, validate, evaluate, visualize, or execute.
43
+
44
+ ## Status
45
+
46
+ Version `0.1.0` is an experimental foundation intended to invite feedback. Names and structures may change before `1.0.0`.
47
+
48
+ ## Repository map
49
+
50
+ ```text
51
+ .
52
+ ├── MANIFESTO.md
53
+ ├── PRINCIPLES.md
54
+ ├── SPECIFICATION.md
55
+ ├── schema/v0.1/
56
+ ├── examples/minimal/
57
+ └── docs/
58
+ ```
59
+
60
+ ## Start with the minimal contract
61
+
62
+ The example in [`examples/minimal`](examples/minimal/README.md) describes a small release process for a payment API. Each YAML document declares one resource using a common envelope:
63
+
64
+ ```yaml
65
+ specVersion: "0.1"
66
+ kind: QualityRequirement
67
+ metadata:
68
+ id: api-availability
69
+ name: API availability
70
+ spec:
71
+ statement: The API must remain available to customers.
72
+ priority: critical
73
+ qualityMeasures:
74
+ - qualityMeasure: availability-rate
75
+ target: {operator: greaterThanOrEqual, value: 99.9, unit: percent}
76
+ ```
77
+
78
+ Read [`SPECIFICATION.md`](SPECIFICATION.md) for the normative model and [`docs/syntax.md`](docs/syntax.md) for authoring conventions.
79
+
80
+ ## Install
81
+
82
+ The optional command-line interface requires Python 3.10 or later. Clone the
83
+ repository, create an isolated environment, and install the local project:
84
+
85
+ ```bash
86
+ git clone <repository-url>
87
+ cd open-quality
88
+ python3 -m venv .venv
89
+ source .venv/bin/activate
90
+ python -m pip install .
91
+ ```
92
+
93
+ After the first public release, install it globally with `pipx`:
94
+
95
+ ```bash
96
+ pipx install open-quality-cli
97
+ ```
98
+
99
+ For local development, install the formatter as well:
100
+
101
+ ```bash
102
+ python -m pip install -e ".[dev]"
103
+ ```
104
+
105
+ ## Quick start
106
+
107
+ Validate the minimal Quality Contract included with the repository:
108
+
109
+ ```bash
110
+ oq validate examples
111
+ ```
112
+
113
+ Explore the example and run the project's checks:
114
+
115
+ ```bash
116
+ oq graph examples
117
+ make check
118
+ ```
119
+
120
+ `oq validate` confirms the contract is structurally valid. `oq graph` renders
121
+ its workflow dependencies, and `oq evaluate` evaluates requirement targets
122
+ against a state file. Run `oq` without arguments to see the available commands.
123
+
124
+ Before opening a pull request, run `make format` to apply the project's Black
125
+ formatting standard and `make check` to verify formatting, compilation, and
126
+ tests.
127
+
128
+ ## Core resources
129
+
130
+ | Resource | Purpose |
131
+ |---|---|
132
+ | `Project` | Entry point and scope of a Quality Contract |
133
+ | `QualityRequirement` | A quality expectation and its acceptance target |
134
+ | `Workflow` | Ordered or dependent stages in a quality process |
135
+ | `Stage` | A reusable phase of work, verification, or decision |
136
+ | `QualityMeasure` | A measurement referenced by requirements |
137
+ | `Artifact` | A refinement document required to support a quality decision |
138
+ | `Role` | A responsibility used for ownership or approval |
139
+ | `ApprovalPolicy` | Rules that determine who must approve and how |
140
+
141
+ ## Contributing
142
+
143
+ Open an issue before proposing a new core resource. See
144
+ [`CONTRIBUTING.md`](CONTRIBUTING.md), [`GOVERNANCE.md`](GOVERNANCE.md),
145
+ [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md), and [`SUPPORT.md`](SUPPORT.md).
146
+
147
+ ## Compatibility and releases
148
+
149
+ Open Quality is currently at specification version `0.1.0` and is experimental.
150
+ The CLI supports Python 3.10 and later. Versioned schemas live under
151
+ [`schema/v0.1`](schema/v0.1); tools should select schemas by the contract's
152
+ `specVersion` rather than assuming future compatibility.
153
+
154
+ Until `1.0.0`, the project may make breaking changes. Each release will be
155
+ tagged, documented in [`CHANGELOG.md`](CHANGELOG.md), and identify its schema
156
+ compatibility and migration notes where needed. After `1.0.0`, releases will
157
+ follow semantic versioning: patch releases are backward-compatible fixes,
158
+ minor releases add backward-compatible functionality, and major releases may
159
+ contain breaking changes.
160
+
161
+ ## License
162
+
163
+ Copyright © 2026 Duan Ribeiro.
164
+
165
+ Open Quality is licensed under the GNU General Public License v3.0. Any copy,
166
+ redistribution, or modified version must retain the applicable copyright and
167
+ license notices, state its changes, and be distributed under GPL-3.0. See
168
+ [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE).
@@ -0,0 +1,19 @@
1
+ cli/__init__.py,sha256=kPdmB1WJnEE6RT1zCGrM088WBHGCrWbNaorkeL-oohA,45
2
+ cli/cli.py,sha256=U0aUjAu1JqLkx5Uj3-gCnS52W3k8WXXBHSrvkKnttSk,11414
3
+ cli/core.py,sha256=tkhDKDaao8-qyw5-AcvAoGtDEc8AuVDlZL_j5M1LhBk,23428
4
+ cli/model.py,sha256=1HahQLdz6IACwdWDYoUEtWAlfNTqeOk69l_JqqqvoRY,1644
5
+ cli/provider.py,sha256=hAqcnyPh0f-Blcn-_U_lc2swIrHIFwLNn2EiOv-sVEU,816
6
+ cli/renderer.py,sha256=qJG_L7LuPBJBK4Ghp7zU_WLYLYQGSryOXDQVcpRqbc0,2832
7
+ cli/providers/__init__.py,sha256=GfDf6fgZqGXkrfE0CheemTnHJIy5UJkmhIhjAHoWpMw,163
8
+ cli/providers/github.py,sha256=D1Ry1qdCtFwelEtrg8ah9RpHN3y6frzcW2d1SWwlODs,5162
9
+ cli/providers/gitlab.py,sha256=Nu0zJjidc8_7cQSab74hLBedT7pJdpykRgoa9s93s6E,3896
10
+ cli/providers/interfaces.py,sha256=fX_ndiohTY1A-qzDCm1ZqU7NWf3-3tET6FOik6GcY6s,638
11
+ cli/providers/jira_cloud.py,sha256=vIMq-VCrbjvwqAKI2dQoiE4ljE6eBwBapuEiZUDLSo8,8911
12
+ cli/providers/openproject.py,sha256=23fmSXgwQxr-k6zzAALy4q77mEJIglpQNkYWHyzzpBQ,26625
13
+ open_quality_cli-0.1.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
14
+ open_quality_cli-0.1.0.dist-info/licenses/NOTICE,sha256=BAhTFCMTKCj_W_l60gDXmBXZ55ewAR2yILaflh7qz70,251
15
+ open_quality_cli-0.1.0.dist-info/METADATA,sha256=YiydYXcRqErSRUAnrsecZZJaXOJ1lXX0NnRh7ccwg1o,5894
16
+ open_quality_cli-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
17
+ open_quality_cli-0.1.0.dist-info/entry_points.txt,sha256=oVj_IMEWHPUE6FEb3gLUphZabitFeFb5WfBQi5mjW9I,36
18
+ open_quality_cli-0.1.0.dist-info/top_level.txt,sha256=2ImG917oaVHlm0nP9oJE-Qrgs-fq_fGWgba2H1f8fpE,4
19
+ open_quality_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ oq = cli.cli:main