development-engine-vector 0.3.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.
@@ -0,0 +1,87 @@
1
+ """Version management and syncing."""
2
+
3
+ import re
4
+ from pathlib import Path
5
+ from dev.utils import error, success
6
+
7
+
8
+ class VersionManager:
9
+ """Manages version numbers across a project."""
10
+
11
+ VERSION_PATTERN = r"\d+\.\d+\.\d+"
12
+
13
+ def __init__(self, project_dir):
14
+ self.project_dir = Path(project_dir).resolve()
15
+ self.version_file = self.project_dir / "version"
16
+
17
+ if not self.version_file.exists():
18
+ error(f"version file not found: {self.version_file}")
19
+
20
+ def read(self):
21
+ """Read current version."""
22
+ text = self.version_file.read_text().strip()
23
+ if not re.fullmatch(self.VERSION_PATTERN, text):
24
+ error(f"Invalid version format in version file: {text}")
25
+ return text
26
+
27
+ def write(self, version):
28
+ """Write new version."""
29
+ if not re.fullmatch(self.VERSION_PATTERN, version):
30
+ error(f"Invalid version format: {version}")
31
+ self.version_file.write_text(f"{version}\n")
32
+
33
+ def bump(self, level):
34
+ """Bump version (major, minor, or patch)."""
35
+ current = self.read()
36
+ major, minor, patch = map(int, current.split("."))
37
+
38
+ if level == "major":
39
+ major += 1
40
+ minor = 0
41
+ patch = 0
42
+ elif level == "minor":
43
+ minor += 1
44
+ patch = 0
45
+ elif level == "patch":
46
+ patch += 1
47
+ else:
48
+ error(f"Invalid bump level: {level}")
49
+
50
+ new_version = f"{major}.{minor}.{patch}"
51
+ return new_version
52
+
53
+ def sync_to_files(self, version, target_files):
54
+ """Sync version to multiple files.
55
+
56
+ Args:
57
+ version: Version string (e.g. "2.0.0")
58
+ target_files: Dict mapping file paths to patterns
59
+ {'/path/file.py': r'(__version__ = ")X.Y.Z(")'}
60
+ """
61
+ for filepath, pattern in target_files.items():
62
+ path = self.project_dir / filepath
63
+ if not path.exists():
64
+ error(f"File not found: {path}")
65
+
66
+ text = path.read_text()
67
+ # Replace version in pattern, preserving groups
68
+ new_text = re.sub(
69
+ pattern.replace("X.Y.Z", self.VERSION_PATTERN),
70
+ lambda m: m.group(1) + version + m.group(2),
71
+ text,
72
+ flags=re.MULTILINE,
73
+ )
74
+
75
+ if new_text == text:
76
+ error(f"Pattern not found or no change in: {path}")
77
+
78
+ path.write_text(new_text)
79
+ success(f"Updated {filepath} to {version}")
80
+
81
+ def get_sync_targets(self):
82
+ """Return standard sync target patterns for common files."""
83
+ return {
84
+ "pyproject.toml": r'(^version\s*=\s*")' + self.VERSION_PATTERN + r'(")',
85
+ "setup.py": r'(\s*version\s*=\s*")' + self.VERSION_PATTERN + r'(",)',
86
+ "vscode_ark/__init__.py": r'(\s*__version__\s*=\s*")' + self.VERSION_PATTERN + r'(")',
87
+ }
@@ -0,0 +1,252 @@
1
+ Metadata-Version: 2.4
2
+ Name: development-engine-vector
3
+ Version: 0.3.0
4
+ Summary: Development Engine Vector — internal developer workflow CLI.
5
+ Author-email: Ernie Butcher <ernie@fiosii.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.8
8
+ Requires-Dist: click>=8.1
9
+ Requires-Dist: tomli>=2.0
10
+ Description-Content-Type: text/markdown
11
+
12
+ # Development Engine Vector
13
+
14
+ [![Python Version](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/downloads/)
15
+ [![PyPI](https://img.shields.io/pypi/v/dev-cli.svg)](https://pypi.org/project/dev-cli)
16
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
17
+
18
+ **Development Engine Vector** (`dev`) is the developer workflow coordination CLI for goCosmix systems. It provides a consistent, scriptable interface for preflight checks, version management, changelog automation, release orchestration, and git/GitHub operations — usable across every system in the federation.
19
+
20
+ `dev` is designed to be pointed at any goCosmix project directory and immediately useful: it reads project config, validates state, manages versions, and drives releases — without knowing anything specific about what the project does.
21
+
22
+ ## ✨ Key Capabilities
23
+
24
+ - **Preflight checks**: version file, changelog entry, git state, dirty tree, sensitive files, pyproject sync
25
+ - **CDA-aware preflight**: extended checks for vscode-ark-specific pipeline and daemon health
26
+ - **Version management**: read, bump (major/minor/patch), sync to `pyproject.toml` and all tracked files
27
+ - **Changelog automation**: structured CHANGELOG management with version section creation and entry validation
28
+ - **Release orchestration**: full release workflow — preflight → version sync → build → git tag → publish
29
+ - **Project bootstrap**: install editable package, requirements, and dev dependencies in one command
30
+ - **Git/GitHub ops**: ensure remotes, create GitHub repos via API, push branches
31
+ - **Self-check**: engine health validation — install path, DB state, tool dependencies, version consistency
32
+ - **Config-driven**: per-project `.dev-cli.toml` for default bump level, skip flags, dry-run mode
33
+
34
+ ## 📋 Table of Contents
35
+
36
+ - [Installation](#installation)
37
+ - [Quick Start](#quick-start)
38
+ - [CLI Reference](#cli-reference)
39
+ - [Configuration](#configuration)
40
+ - [Architecture](#architecture)
41
+ - [Development](#development)
42
+ - [Contributing](#contributing)
43
+ - [License](#license)
44
+
45
+ ## 🚀 Installation
46
+
47
+ ### Prerequisites
48
+
49
+ - Python 3.9+
50
+
51
+ ### Install from PyPI
52
+
53
+ ```bash
54
+ pip install dev-cli
55
+ ```
56
+
57
+ > **macOS / system Python note**: pip installs the `dev` binary to `~/Library/Python/3.x/bin/` which may not be on `PATH` by default.
58
+ >
59
+ > ```bash
60
+ > export PATH="$HOME/Library/Python/3.9/bin:$PATH"
61
+ > ```
62
+ >
63
+ > Add this line to `~/.zprofile` for persistence.
64
+
65
+ ### Install from source
66
+
67
+ ```bash
68
+ git clone https://github.com/goCosmix/dev.git
69
+ cd dev/source
70
+ pip install -e .
71
+ ```
72
+
73
+ ### Install development dependencies
74
+
75
+ ```bash
76
+ pip install -e ".[dev]"
77
+ ```
78
+
79
+ ## ⚡ Quick Start
80
+
81
+ ```bash
82
+ pip install dev-cli
83
+ export PATH="$HOME/Library/Python/3.9/bin:$PATH"
84
+
85
+ # Point at any goCosmix project
86
+ dev pf --project /Volumes/intel/systems/cda/source # preflight check
87
+ dev version show --project /Volumes/intel/systems/cda/source
88
+ dev release --project /Volumes/intel/systems/cda/source --dry-run
89
+ ```
90
+
91
+ ## 🔧 CLI Reference
92
+
93
+ ### `dev pf` / `dev preflight`
94
+
95
+ Run pre-release preflight checks for a project.
96
+
97
+ ```bash
98
+ dev pf --project <path> # standard checks
99
+ dev pf --project <path> --full # full check set (includes CDA-specific)
100
+ dev pf --project <path> --report report.json
101
+ ```
102
+
103
+ Checks run: version file, changelog entry, git state (clean tree, committed), sensitive file exposure, pyproject.toml version sync.
104
+
105
+ ### `dev version`
106
+
107
+ ```bash
108
+ dev version show --project <path> # print current version
109
+ dev version bump --project <path> --level patch # bump major/minor/patch
110
+ dev version sync --project <path> # sync version → pyproject.toml
111
+ ```
112
+
113
+ ### `dev release`
114
+
115
+ Full release workflow: preflight → version bump → sync → build → git tag → publish.
116
+
117
+ ```bash
118
+ dev release --project <path>
119
+ dev release --project <path> --bump minor
120
+ dev release --project <path> --version 2.1.0
121
+ dev release --project <path> --skip-publish # build + tag, don't push to PyPI
122
+ dev release --project <path> --dry-run # simulate, no writes
123
+ ```
124
+
125
+ ### `dev build`
126
+
127
+ Build source and wheel distributions.
128
+
129
+ ```bash
130
+ dev build --project <path>
131
+ ```
132
+
133
+ ### `dev sync`
134
+
135
+ Bootstrap or re-sync project dependencies.
136
+
137
+ ```bash
138
+ dev sync --project <path>
139
+ dev sync --project <path> --install-dev # also install dev dependencies
140
+ dev sync --project <path> --no-install-editable # skip editable install
141
+ ```
142
+
143
+ ### `dev check`
144
+
145
+ Project health checks: compile validation, lint, optional pytest.
146
+
147
+ ```bash
148
+ dev check --project <path>
149
+ dev check --project <path> --tests # include pytest
150
+ dev check --project <path> --lint # include flake8
151
+ dev check --project <path> --compile # Python compile check
152
+ ```
153
+
154
+ ### `dev selfcheck`
155
+
156
+ Engine self-diagnostics — validates the `dev` installation itself.
157
+
158
+ ```bash
159
+ dev selfcheck
160
+ ```
161
+
162
+ Checks: version consistency, install path, DB state, required tools on PATH, Python dependencies.
163
+
164
+ ### `dev config`
165
+
166
+ ```bash
167
+ dev config show --project <path> # display active config and resolved settings
168
+ ```
169
+
170
+ ## ⚙️ Configuration
171
+
172
+ Add a `.dev-cli.toml` or `dev-cli.toml` at any project root:
173
+
174
+ ```toml
175
+ [release]
176
+ default_bump = "minor"
177
+ skip_build = false
178
+ skip_publish = false
179
+ dry_run = false
180
+
181
+ [bootstrap]
182
+ install_editable = true
183
+ install_dependencies = true
184
+ install_dev_dependencies = false
185
+
186
+ [check]
187
+ compile = true
188
+ tests = false
189
+ lint = false
190
+ ```
191
+
192
+ Override the config file path at runtime:
193
+
194
+ ```bash
195
+ dev --config ./custom.dev-cli.toml release --project /Volumes/intel/systems/cda/source
196
+ ```
197
+
198
+ ## 🏗 Architecture
199
+
200
+ `dev` is organized into four layers:
201
+
202
+ ```
203
+ dev/
204
+ ├── kernel/ — runtime foundation (paths, DB, config, self-check)
205
+ ├── workflow/ — business logic (versioning, changelog, preflight, release)
206
+ ├── vcs/ — version control ops (git, GitHub API)
207
+ └── cli/ — thin click wrappers
208
+ ```
209
+
210
+ See [docs/architecture.md](docs/architecture.md) for the full design.
211
+
212
+ ## 🛠 Development
213
+
214
+ ```bash
215
+ cd /Volumes/intel/systems/dev/source
216
+ pip install -e .
217
+ export PATH="$HOME/Library/Python/3.9/bin:$PATH"
218
+
219
+ # Run checks
220
+ python3 -m flake8 dev/
221
+ python3 -m mypy dev/
222
+ python3 -m pytest tests/ -q
223
+
224
+ # Or via the control plane
225
+ python3 ../control/scripts/vet.py
226
+ python3 ../control/cli.py health
227
+ ```
228
+
229
+ ### Control plane
230
+
231
+ ```bash
232
+ python3 control/cli.py --help
233
+
234
+ dev-control status # version, paths, DB state
235
+ dev-control vet # run lint + typecheck + tests, write history to DB
236
+ dev-control health # show vet run history
237
+ dev-control health --checks # list defined check definitions
238
+ dev-control push # build + publish to PyPI
239
+ dev-control seed # re-seed control.db
240
+ dev-control selfcheck # engine self-diagnostics
241
+ dev-control runs # show run history from dev.db
242
+ dev-control projects # show registered projects
243
+ dev-control manifest # query file manifest from control.db
244
+ ```
245
+
246
+ ## 🤝 Contributing
247
+
248
+ See [contributing.md](contributing.md).
249
+
250
+ ## 📄 License
251
+
252
+ MIT — see [license](license).
@@ -0,0 +1,41 @@
1
+ dev/__init__.py,sha256=fXSn40zGxzcODNjKCvOLkYXC8vGULDZvPbKmAseoTec,64
2
+ dev/__main__.py,sha256=6mqulF3fT-c2VOCHizGjph4RZOml96d6M27MdDwsxbY,105
3
+ dev/utils.py,sha256=9y_QSfAXQGWM8LO-L8iO-333DVPHmLJK7PsNxR3BCSs,1817
4
+ dev/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ dev/cli/cli.py,sha256=fXf0I9afD7mzZ8BZfI0f9DWHm_r-LLZMu_wOygrrBe0,24892
6
+ dev/kernel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ dev/kernel/config.py,sha256=Fgb7jmCL63fjObwCCEaHcL3hBedl4qwcu7d0lDs9wnc,1487
8
+ dev/kernel/db.py,sha256=bH59wCsHqOvSRI0caAedyBtWeZmHfKJtXDzmDggrmxc,4318
9
+ dev/kernel/paths.py,sha256=ccYMqHx0BwQqdLlHRAf5EZvEkyNeCYaxqCKFmfYfo5c,2832
10
+ dev/kernel/pmf_kernel.py,sha256=bIGUyuPRRWlf6IlFRA5-fdKWbx9i9GeZqlhlBfLPLl8,13896
11
+ dev/kernel/selfcheck.py,sha256=dtHEDUCEDgvHvwVVAYazcjdjdUwUZ0naj6JQkeIx1pA,5186
12
+ dev/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ dev/ui/actions.py,sha256=yqm0gw9U45DiqFmUuCoIcqM4vpdmccaee_XRN0Gg26U,1587
14
+ dev/ui/routes.py,sha256=eQ_juy3_n9sJLE9GSmmcJW-EBeD8Dpzsx68Hl6PzKHs,4435
15
+ dev/ui/templates.py,sha256=OHJewoOfwoclv11ZsoHu3R1zj_thr7aArD3TrSWd1WU,8501
16
+ dev/ui/web.py,sha256=ycJ8_H0FQx3Muz_kMhYvkDn8gkpM6pVxMImrUZtXVtU,741
17
+ dev/ui/db/__init__.py,sha256=WweOUt326t1BZNqoO3b_NC7xwijhz9I70gWvVJU_0-w,627
18
+ dev/ui/db/base.py,sha256=fbQoMFyVWQDG0UHSmVFRL5bzuM0NlC1qyJZnHe2IIYA,2090
19
+ dev/ui/db/checks.py,sha256=xBezjAE2iwYGycrjsAyMvJAZ9zmeu87CLUhkLNMYAEQ,451
20
+ dev/ui/db/events.py,sha256=dwIR_7dFeud9mP_WLLhwGgFnHxzX8Ew_WWHbUCHXcfM,463
21
+ dev/ui/db/health.py,sha256=JiTbijCIbduq2W3nM2NPIw4mvwx-ng0-VBvzCG_ZCGY,1196
22
+ dev/ui/db/identity.py,sha256=-jbFPFXXdx8Vo9Yzef61pxCNHgK-u4OdJ1JOBNgY2qk,357
23
+ dev/ui/db/manifest.py,sha256=P57d2q_V9Clm1RPdogmrmxS3B_QTXKB-aky8PRA186o,1330
24
+ dev/ui/db/overview.py,sha256=Jjp2oPp6MVK6rq0L0-hlbbmwYqCbmgDG2CWZ6jfXW5I,2109
25
+ dev/ui/db/runs.py,sha256=caRXOeLXOj36EycYX7UXGzXzwmJDsC_PsKgyG0RGnnI,1422
26
+ dev/ui/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ dev/ui/static/web.css,sha256=H30z3a-BJxS4qcuUX3sLDTgheIumCriClxqsnqmippY,13035
28
+ dev/ui/static/web.js,sha256=Nhaqs6ATMnLXzmr5AdkcOo0YdWzQ7dEvtriasy8HwVI,25203
29
+ dev/vcs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
+ dev/vcs/git.py,sha256=TxNiNzxEAEdOodyJa5iBIRb9VZNlWbcaDrsexH-_-to,3738
31
+ dev/vcs/github.py,sha256=YxW4CG12A0cTeZY1pOiQx3rEgab0NlIvIOHcJJW27Hg,2649
32
+ dev/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ dev/workflow/cda.py,sha256=OKaqoBH_TCN36S7eaSzKLkuD1AxJ5TxmPBesQWdEr70,5355
34
+ dev/workflow/changelog.py,sha256=Yh1gaiE9hn06DneLVRY8kWYd4UcuW390j5K0J8ze3cE,3319
35
+ dev/workflow/preflight.py,sha256=Cm1R1dMOtVABpMLh9pxJ0hzoyJQ3_6FOJfW0OfTwMEc,11647
36
+ dev/workflow/release.py,sha256=YvO9nnTeRvtMUrNvrA_pyZ8y2b5dzk2d5A7hVUwcOyE,8373
37
+ dev/workflow/versioning.py,sha256=3l_UfvB5gYabTlNM8trIZuLxJM8q1W6fCWrAqwIM16U,2925
38
+ development_engine_vector-0.3.0.dist-info/METADATA,sha256=F71NG8zWRXJbhZpqFRS8DhNuhmXJSNfnzZRHJ8lHOcg,7381
39
+ development_engine_vector-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
40
+ development_engine_vector-0.3.0.dist-info/entry_points.txt,sha256=m3Sk8zBP1FRj_6rNqBN-S7QA3yPby6gl6JRL2N0kST8,40
41
+ development_engine_vector-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dev = dev.cli.cli:cli