gwc-pybundle 0.4.2__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,476 @@
1
+ Metadata-Version: 2.4
2
+ Name: gwc-pybundle
3
+ Version: 0.4.2
4
+ Summary: Deterministic Python project context bundling for humans, automation, and AI
5
+ Author: Jessica Brown
6
+ License: The MIT License (MIT)
7
+ =====================
8
+
9
+ Copyright © 2025 Jessica Brown
10
+
11
+ Permission is hereby granted, free of charge, to any person
12
+ obtaining a copy of this software and associated documentation
13
+ files (the “Software”), to deal in the Software without
14
+ restriction, including without limitation the rights to use,
15
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the
17
+ Software is furnished to do so, subject to the following
18
+ conditions:
19
+
20
+ The above copyright notice and this permission notice shall be
21
+ included in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
24
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30
+ OTHER DEALINGS IN THE SOFTWARE.
31
+ Project-URL: Homepage, https://github.com/girls-whocode/pybundle
32
+ Project-URL: Repository, https://github.com/girls-whocode/pybundle
33
+ Project-URL: Issues, https://github.com/girls-whocode/pybundle/issues
34
+ Classifier: Development Status :: 4 - Beta
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.9
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Topic :: Software Development :: Build Tools
43
+ Classifier: Topic :: Software Development :: Debuggers
44
+ Classifier: Topic :: Software Development :: Quality Assurance
45
+ Requires-Python: >=3.9
46
+ Description-Content-Type: text/markdown
47
+ License-File: LICENSE.md
48
+ Dynamic: license-file
49
+
50
+ # 🧳 pybundle
51
+
52
+ **pybundle** is a deterministic, automation-friendly tool for collecting Python project context into a single, shareable bundle - ideal for debugging, audits, AI assistance, CI artifacts, or handoff between engineers.
53
+
54
+ It produces **machine-readable outputs first**, with optional human-readable summaries layered on top.
55
+
56
+ > Think “`git archive` + diagnostics + metadata”, without guessing or heuristics.
57
+
58
+ > **Note:** The PyPI package name is `gwc-pybundle`, but the tool is installed and used as `pybundle`.
59
+ ---
60
+
61
+ ## 🧠 Why pybundle exists
62
+
63
+ Modern software development compresses what used to be entire teams into a single role.
64
+
65
+ Today, one developer is often responsible for:
66
+ - application code
67
+ - build systems
68
+ - test tooling
69
+ - deployment logic
70
+ - CI/CD behavior
71
+ - environment differences
72
+ - security implications
73
+ - and increasingly, AI-assisted workflows
74
+
75
+ The problem is no longer *how* to write code.
76
+
77
+ It’s answering:
78
+
79
+ > **“Why is this system behaving the way it is?”**
80
+
81
+ That question is hard to answer when:
82
+ - context is scattered
83
+ - tooling output is ephemeral
84
+ - environment details are lost
85
+ - source snapshots are incomplete or noisy
86
+
87
+ AI didn’t create this problem - it exposed it.
88
+
89
+ Large language models don’t fail because they lack intelligence.
90
+ They fail because we give them **uncurated context**.
91
+
92
+ Humans don’t fail because they can’t debug.
93
+ They fail because the **cost of reconstructing context** exceeds the time they have.
94
+
95
+ **pybundle exists to reduce context debt.**
96
+
97
+ It captures *what matters*, ignores what doesn’t, and produces a deterministic artifact that explains:
98
+ - what code exists
99
+ - what tools ran
100
+ - what environment was used
101
+ - and why the outputs exist
102
+
103
+ For humans, automation, and AI alike.
104
+
105
+ ---
106
+
107
+ ## ✨ Features
108
+
109
+ * 📦 **Single archive output** (`.zip` or `.tar.gz`)
110
+ * 🧠 **Machine-readable manifest** (`MANIFEST.json`) for automation
111
+ * 🧾 **Structured summaries** (`SUMMARY.json`)
112
+ * 🧭 **Respects `.gitignore`** exactly when available
113
+ * 🛑 **Safely ignores virtualenvs and caches** (even with non-standard names)
114
+ * 🔍 Optional tooling checks (ruff, mypy, pytest, ripgrep scans)
115
+ * 🧪 Deterministic output (stable paths, timestamps, schemas)
116
+ * 🔒 Secret-safe (optional redaction)
117
+
118
+ ---
119
+
120
+ ## 📂 What’s in a pybundle archive?
121
+
122
+ At minimum, a bundle contains:
123
+
124
+ ```text
125
+ MANIFEST.json # stable, machine-readable metadata
126
+ SUMMARY.json # structured summary of collected data
127
+ src/ # filtered project source snapshot
128
+ logs/ # tool outputs (ruff, mypy, etc.)
129
+ meta/ # environment + tool detection
130
+ ```
131
+
132
+ ### `MANIFEST.json` (automation fuel)
133
+
134
+ Includes:
135
+
136
+ * tool paths detected
137
+ * options used
138
+ * archive name + format
139
+ * git commit hash (if available)
140
+ * UTC timestamp
141
+ * schema version (stable)
142
+
143
+ Another script can fully understand a bundle **without reading markdown**.
144
+
145
+ ---
146
+
147
+ ## 🚀 Installation
148
+
149
+ We recommend using a Python virtual environment for development tooling.
150
+
151
+ ### Quick installation (pybundle tooling) - RECOMMENDED
152
+
153
+ Create a dedicated requirements file in the root of your project:
154
+
155
+ ```txt
156
+ # requirements-pybundle.txt
157
+ ruff
158
+ mypy
159
+ pytest
160
+ gwc-pybundle==0.4.2
161
+ ```
162
+
163
+ Then install:
164
+
165
+ ```bash
166
+ pip install -r requirements-pybundle.txt
167
+ ```
168
+
169
+ > **System dependency:**
170
+ > pybundle uses `ripgrep (rg)` for source scanning and expects the system binary.
171
+ >
172
+ > * macOS: `brew install ripgrep`
173
+ > * Ubuntu/Debian: `sudo apt install ripgrep`
174
+ > * Fedora: `sudo dnf install ripgrep`
175
+
176
+ After installation, run:
177
+
178
+ ```bash
179
+ pybundle run analysis
180
+ ```
181
+
182
+ A new `artifacts/` directory will be created containing:
183
+
184
+ * the compressed bundle
185
+ * an extracted working directory
186
+ * machine-readable metadata (`MANIFEST.json`, `SUMMARY.json`)
187
+
188
+ See **Usage** for more details.
189
+
190
+ ---
191
+
192
+ ### Advanced installation
193
+
194
+ #### From GitHub
195
+
196
+ ```bash
197
+ pip install "gwc-pybundle @ git+https://github.com/girls-whocode/pybundle.git@v0.4.2"
198
+ ```
199
+
200
+ Pinning to a tag ensures reproducible behavior.
201
+
202
+ #### Editable install (for development)
203
+
204
+ ```bash
205
+ pip install -e .
206
+ ```
207
+
208
+ ---
209
+
210
+ ## 🧪 Usage
211
+
212
+ From the root of a Python project, run a profile using the `run` command:
213
+
214
+ ```bash
215
+ pybundle run analysis
216
+ ```
217
+
218
+ This builds a timestamped diagnostic bundle under the default `artifacts/` directory.
219
+
220
+ ### Profiles
221
+
222
+ Profiles define *what* pybundle collects and *which tools* are run.
223
+
224
+ Available profiles include:
225
+
226
+ * `analysis` - **full diagnostics** (lint, type-check, tests, scans)
227
+ * `debug` - **analysis + additional environment validation**
228
+ * `backup` - **minimal environment snapshot**
229
+ * `ai` - **AI-optimized context bundle** (lean, source-first)
230
+
231
+ To list all available profiles:
232
+
233
+ ```bash
234
+ pybundle list-profiles
235
+ ```
236
+
237
+ Profiles are always invoked via:
238
+
239
+ ```bash
240
+ pybundle run <profile>
241
+ ```
242
+ ---
243
+
244
+ ### 🤖 AI profile (NEW)
245
+
246
+ The `ai` profile is optimized for handing a project to AI tooling
247
+ (ChatGPT, local LLMs, code assistants, etc.).
248
+
249
+ It prioritizes **source code and reproducible context**, while skipping
250
+ expensive or noisy steps by default.
251
+
252
+ Run it with:
253
+
254
+ ```bash
255
+ pybundle run ai
256
+ ```
257
+
258
+ #### What `ai` does by default
259
+
260
+ * ✅ Includes full curated source snapshot (`src/`)
261
+ * ✅ Includes environment + git metadata
262
+ * ✅ Generates `REPRO.md` and `HANDOFF.md`
263
+ * ❌ Skips linting, type-checking, tests
264
+ * ❌ Skips ripgrep scans and error-context expansion
265
+ * ❌ Skips `compileall` unless explicitly enabled
266
+
267
+ The result is a **small, fast, AI-friendly bundle** that still preserves
268
+ determinism and traceability.
269
+
270
+ You may selectively re-enable tools:
271
+
272
+ ```bash
273
+ pybundle run ai --ruff --mypy
274
+ pybundle run ai --compileall
275
+ ```
276
+
277
+ This makes `ai` suitable for:
278
+
279
+ * AI-assisted refactoring
280
+ * Large-context summarization
281
+ * Code review handoff
282
+ * Offline or local LLM workflows
283
+
284
+ ---
285
+
286
+ ### Common options
287
+
288
+ Most usage customizations are done through flags on `pybundle run`.
289
+
290
+ Example:
291
+
292
+ ```bash
293
+ pybundle run analysis \
294
+ --format zip \
295
+ --outdir ./artifacts \
296
+ --name myproject-bundle \
297
+ --strict
298
+ ```
299
+
300
+ Commonly used options:
301
+
302
+ * `--format {auto,zip,tar.gz}` - archive format
303
+ * `--outdir PATH` - output directory (default: `<project>/artifacts`)
304
+ * `--name NAME` - override archive name prefix
305
+ * `--strict` - fail with non-zero exit code if any step fails
306
+ * `--no-spinner` - disable spinner output (CI-friendly)
307
+ * `--redact / --no-redact` - control secret redaction
308
+
309
+ Tool execution can be selectively disabled:
310
+
311
+ ```bash
312
+ --no-ruff
313
+ --no-mypy
314
+ --no-pytest
315
+ --no-rg
316
+ --no-error-refs
317
+ --no-context
318
+ ```
319
+
320
+ For the full list of options:
321
+
322
+ ```bash
323
+ pybundle run --help
324
+ ```
325
+
326
+ ---
327
+
328
+ ### Doctor mode
329
+
330
+ To see which tools are available and what *would* run (without creating a bundle):
331
+
332
+ ```bash
333
+ pybundle doctor
334
+ ```
335
+
336
+ You may optionally specify a profile to preview:
337
+
338
+ ```bash
339
+ pybundle doctor analysis
340
+ ```
341
+
342
+ This is useful for validating environment readiness (CI, fresh machines, etc.).
343
+
344
+ ---
345
+
346
+ ### Version
347
+
348
+ To check the installed version:
349
+
350
+ ```bash
351
+ pybundle version
352
+ ```
353
+
354
+ ---
355
+
356
+ ## 🧠 Ignore behavior (important)
357
+
358
+ ### If inside a Git repository
359
+
360
+ pybundle uses **Git itself** to determine which files are included:
361
+
362
+ * `.gitignore`
363
+ * `.git/info/exclude`
364
+ * global gitignore rules
365
+
366
+ This guarantees pybundle sees the project **exactly as Git does**.
367
+
368
+ ### If Git is unavailable
369
+
370
+ pybundle falls back to safe structural rules:
371
+
372
+ * ignores `__pycache__`, `.ruff_cache`, `.mypy_cache`, `.pytest_cache`, etc.
373
+ * detects virtual environments by structure (`pyvenv.cfg`, `bin/activate`), not by name
374
+ → works with `.venv`, `.pybundle-venv`, `env-prod-2025`, etc.
375
+
376
+ No filename guessing. No surprises.
377
+
378
+ ---
379
+
380
+ ## 📜 Profiles
381
+
382
+ pybundle is profile-driven. Each profile defines:
383
+
384
+ * what files are collected
385
+ * which tools run
386
+ * what metadata is emitted
387
+
388
+ Example profiles:
389
+
390
+ * `analysis`
391
+ * `source`
392
+ * `minimal`
393
+
394
+ Profiles are extensible - add your own without modifying core logic.
395
+
396
+ ---
397
+
398
+ ## 🔐 Safety & Redaction
399
+
400
+ By default, pybundle:
401
+
402
+ * avoids scanning known secret locations
403
+ * supports optional redaction of sensitive strings in logs
404
+
405
+ Use `--redact / --no-redact` to control behavior.
406
+
407
+ ---
408
+
409
+ ## 🧩 Why pybundle?
410
+
411
+ pybundle is designed for:
412
+
413
+ * handing a project to another engineer
414
+ * attaching context to a bug report
415
+ * feeding a codebase to AI tooling
416
+ * generating CI artifacts
417
+ * preserving “what exactly did we run?”
418
+ * producing **AI-consumable project context** without guesswork
419
+
420
+ It prioritizes **determinism, traceability, and automation** over clever heuristics.
421
+
422
+ ---
423
+
424
+ ## 🛠 Development Notes
425
+
426
+ * Python ≥ 3.9
427
+ * Uses modern tooling (ruff, mypy)
428
+ * Fully type-checked
429
+ * Formatter-clean
430
+ * No test suite *yet* (intentional; coming later)
431
+
432
+ During development, run:
433
+
434
+ ```bash
435
+ python -m pybundle ...
436
+ ```
437
+
438
+ to bypass shell caching.
439
+
440
+ ---
441
+
442
+ ## 📌 Versioning
443
+
444
+ pybundle follows **Semantic Versioning**.
445
+
446
+ Pinned Git tags are recommended when used as a dependency:
447
+
448
+ ```txt
449
+ gwc-pybundle @ git+https://github.com/girls-whocode/pybundle.git@v0.4.2
450
+ ```
451
+
452
+ ---
453
+
454
+ ## 🧠 Philosophy
455
+
456
+ > If a tool produces output, it should also produce metadata about **how** and **why** that output exists.
457
+
458
+ pybundle treats context as a first-class artifact.
459
+
460
+ ---
461
+
462
+ ## 📦 Package naming note
463
+
464
+ The distribution name on PyPI is **`gwc-pybundle`** to avoid conflicts with existing packages.
465
+
466
+ The project name, imports, and CLI remain **`pybundle`**.
467
+
468
+ ```bash
469
+ pip install gwc-pybundle
470
+ pybundle run analysis
471
+ ```
472
+ Look in the autocreated `artifacts/` folder
473
+
474
+ ## 📄 License
475
+
476
+ MIT License
@@ -0,0 +1,34 @@
1
+ gwc_pybundle-0.4.2.dist-info/licenses/LICENSE.md,sha256=ZmD484KG9hysmSMFT824y7aIc8lhFBnjkN-3DJNjXCc,1108
2
+ pybundle/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ pybundle/__main__.py,sha256=MHKZ_ae3fSLGTLUUMOx15fWdeOnJSHhq-zslRP5F5Lc,79
4
+ pybundle/cli.py,sha256=q9RkFbAK1YDcD-q1kgU8NPfKpLKAOTtbRzJuXwfwyO8,8132
5
+ pybundle/context.py,sha256=_gStOHLCWDr_-ricMHnls1uzuW-8nSb2drkkm03AP0c,6714
6
+ pybundle/doctor.py,sha256=P-WaokOGHWLiiQRN1gk7XveOz5CF_rraETvswbXmRw8,3149
7
+ pybundle/manifest.py,sha256=hH5EMho9an-85uVy-JVeRs62UoDHSBTAc_UrvP2h1FY,2250
8
+ pybundle/packaging.py,sha256=h1SmDj32EwLBGUgTI19IzaClC6k0r3irxM429iouAkg,1134
9
+ pybundle/policy.py,sha256=HCSL8LcfbuAtmRqIS5TTQv38Wdsn-5ES-Yz6DtfFmss,4943
10
+ pybundle/profiles.py,sha256=hl7BeNf9xibH7esm3T8VvfwM31qLDv6Q2UYdePF-R9M,4964
11
+ pybundle/roadmap_model.py,sha256=27kfsQATbMZ8GNsblnNzspdeSVmzES5EJOGoLSwyHPM,1125
12
+ pybundle/roadmap_scan.py,sha256=fJVuwmAOkAGELLzfmM0PCRjx3D9ufKw48WmSxsQXQ-E,9325
13
+ pybundle/root_detect.py,sha256=d_HdA_usPxK1orc9cnNTY_fZrvdScQnI_f1XvvlHSFA,361
14
+ pybundle/runner.py,sha256=WuTsZLJb1n43dMpDwKcEBthKHMSE2n59r1h0xcpxiLA,2060
15
+ pybundle/tools.py,sha256=TNlMVodj1mcdjzaTlfwyZbjQ49ZVGqvd7KcQuEEgV2Q,116
16
+ pybundle/steps/base.py,sha256=9LZwPYlGAWfnIe5DRbfP89ZmMLhbmOm9SQ-vWmQANHA,356
17
+ pybundle/steps/compileall.py,sha256=ZbaIAPVG6pflqPaVfn5jSHcEC7qWncm_HIWUHokYdXg,2371
18
+ pybundle/steps/context_expand.py,sha256=pG1-59RqQFIdTlMj5CJ65b8Or9qNk8LgudntdT10m7M,7986
19
+ pybundle/steps/copy_pack.py,sha256=6M0_yToyLqkbe93qLRN0Cly0qGRoB4iZrSA5_mnLYQU,9284
20
+ pybundle/steps/error_refs.py,sha256=mq1DGXREQRudycyPb7H0obkHmv3HvO-QPPbf2zoZDu0,5640
21
+ pybundle/steps/handoff_md.py,sha256=fZGOQ5EdOz8vJfcwSYOiwPLJpO8CWrACIP3060RtUwY,6215
22
+ pybundle/steps/mypy.py,sha256=x3df4BiJe0X47u-bw_JAC4IE1cgymAVhwagvWClWiPg,1916
23
+ pybundle/steps/pytest.py,sha256=Bi89ZW1F1EEPGII2wlDLlXahvaHEflXD9q8rTJMSLs0,2102
24
+ pybundle/steps/repro_md.py,sha256=EvoNVKaHFelfrv_jfBLpbkORTiDSjah3GgWXW3NvEXY,4856
25
+ pybundle/steps/rg_scans.py,sha256=TT7PkxJSRszIzgN23VkEbX94ReGRJ1SQARLB__xBS2M,2436
26
+ pybundle/steps/roadmap.py,sha256=wticWSzqw4EZqI7lOeSRqbBSW19FAjG8ijln8d_CUXM,5865
27
+ pybundle/steps/ruff.py,sha256=iI_c8Q0cGsul2oOvyzA7BLA2kV4C8EtmsuL-L3MHHx8,3726
28
+ pybundle/steps/shell.py,sha256=N5uH5CRro2UP1oya1eP5J8IXvwPuOimbHkC1_Ua-sa8,2143
29
+ pybundle/steps/tree.py,sha256=sgRleTPgjAb9PnSAletpnybd5BirLNqauuEaTRidcWQ,4147
30
+ gwc_pybundle-0.4.2.dist-info/METADATA,sha256=UY0Z174jEU1cLUcIpWMECg0fjzVLD004AhpYP537RHo,11695
31
+ gwc_pybundle-0.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
+ gwc_pybundle-0.4.2.dist-info/entry_points.txt,sha256=xgXfIvyx9ZI6jd9MscFWNMzQrcX4scTVJ9L7WwksUHg,47
33
+ gwc_pybundle-0.4.2.dist-info/top_level.txt,sha256=N5x3QutDUtHQn3HwkFmH5PeM9uPY-E5wOKUJSE8PBKM,9
34
+ gwc_pybundle-0.4.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pybundle = pybundle.cli:main
@@ -0,0 +1,25 @@
1
+ The MIT License (MIT)
2
+ =====================
3
+
4
+ Copyright © 2025 Jessica Brown
5
+
6
+ Permission is hereby granted, free of charge, to any person
7
+ obtaining a copy of this software and associated documentation
8
+ files (the “Software”), to deal in the Software without
9
+ restriction, including without limitation the rights to use,
10
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the
12
+ Software is furnished to do so, subject to the following
13
+ conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ pybundle
pybundle/__init__.py ADDED
File without changes
pybundle/__main__.py ADDED
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())