bitp 1.0.6__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,401 @@
1
+ Metadata-Version: 2.4
2
+ Name: bitp
3
+ Version: 1.0.6
4
+ Summary: Tools for BitBake/Yocto projects
5
+ Author-email: Bruce Ashfield <bruce.ashfield@gmail.com>
6
+ License: GPL-2.0-only
7
+ Project-URL: Homepage, https://gitlab.com/bruce-ashfield/bitbake-project
8
+ Project-URL: Repository, https://gitlab.com/bruce-ashfield/bitbake-project
9
+ Project-URL: Issues, https://gitlab.com/bruce-ashfield/bitbake-project/-/issues
10
+ Keywords: bitbake,yocto,openembedded,layers,git
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Build Tools
22
+ Classifier: Topic :: Software Development :: Embedded Systems
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+ License-File: COPYING
26
+ Provides-Extra: completion
27
+ Requires-Dist: argcomplete>=2.0; extra == "completion"
28
+ Provides-Extra: dev
29
+ Requires-Dist: argcomplete>=2.0; extra == "dev"
30
+ Requires-Dist: pytest>=7.0; extra == "dev"
31
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
32
+ Requires-Dist: pytest-mock>=3.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # bit(bit)
36
+
37
+ A CLI tool for managing BitBake/Yocto/OpenEmbedded layer repositories.
38
+
39
+ The command is `bit` for quick typing.
40
+
41
+ ## Overview
42
+
43
+ `bit` helps developers working with Yocto/OpenEmbedded projects by providing tools to:
44
+
45
+ - **Update** git repos backing BitBake layers from a `bblayers.conf`
46
+ - **Explore** commits interactively with fzf-based navigation
47
+ - **Export** patches with cover letters for upstream submission
48
+ - **Manage branches** across multiple layer repositories
49
+ - **Search** the OpenEmbedded Layer Index for layers
50
+ - **Bootstrap** new projects by cloning core repositories
51
+ - **Manage projects** - switch between multiple Yocto builds from anywhere
52
+
53
+ ## Features
54
+
55
+ - **Automatic layer discovery** - finds layers by searching for `conf/layer.conf` files
56
+ - **Multi-layer repo support** - handles repos containing multiple layers (e.g., meta-openembedded)
57
+ - **Interactive fzf menus** - fast navigation with preview panes and keyboard shortcuts
58
+ - **Tab completion** - bash completion via argcomplete
59
+ - **Background refresh** - upstream status checks run in background for fast startup
60
+ - **Per-repo configuration** - custom display names, update defaults, push targets
61
+
62
+ ## Quick Start
63
+
64
+ ```bash
65
+ # Bootstrap a new Yocto project
66
+ bitinit clone -b scarthgap --execute
67
+ bitinit
68
+
69
+ # Check status of all layer repos
70
+ bitstatus
71
+
72
+ # Interactively explore repos and commits
73
+ bitexplore
74
+
75
+ # Update all repos
76
+ bitupdate
77
+
78
+ # Search for layers in the OE Layer Index
79
+ bitsearch security
80
+ ```
81
+
82
+ ## Commands
83
+
84
+ | Command | Alias | Description |
85
+ |---------|-------|-------------|
86
+ | `explore` | `x` | Interactively explore commits in layer repos |
87
+ | `update` | `u` | Update git repos referenced by layers |
88
+ | `status` | - | Show local commit summary for layer repos |
89
+ | `config` | `c` | View and configure repo/layer settings |
90
+ | `branch` | `b` | View and switch branches across repos |
91
+ | `export` | - | Export patches from layer repos |
92
+ | `repos` | - | List layer repos |
93
+ | `init` | - | Show OE/Yocto build environment setup command |
94
+ | `init clone` | - | Show or clone core Yocto/OE repositories |
95
+ | `search` | - | Search OpenEmbedded Layer Index for layers |
96
+ | `projects` | `p` | Manage and switch between multiple project directories |
97
+
98
+ Run `bit` with no arguments for an interactive command menu, or `bit --help` for detailed usage.
99
+
100
+ ## Common Workflows
101
+
102
+ ### Starting a New Project
103
+
104
+ ```bash
105
+ # Clone core repos
106
+ bitinit clone -b scarthgap --execute
107
+
108
+ # Get the environment setup command
109
+ bitinit
110
+
111
+ # Source the environment (copy from output above)
112
+ TEMPLATECONF=... source ./layers/openembedded-core/oe-init-build-env
113
+ ```
114
+
115
+ ### Daily Development
116
+
117
+ ```bash
118
+ # Check what's changed upstream
119
+ bitstatus
120
+
121
+ # Update repos (interactive)
122
+ bitupdate
123
+
124
+ # Or update a specific repo
125
+ bitupdate OE-core
126
+ ```
127
+
128
+ ### Exploring Commits
129
+
130
+ ```bash
131
+ # Interactive two-level browser
132
+ bitexplore
133
+
134
+ # Jump directly to a repo
135
+ bitx OE-core
136
+ ```
137
+
138
+ Keybindings in explore mode (repo list):
139
+ - `Enter` - explore commits in selected repo
140
+ - `u` - pull --rebase
141
+ - `m` - pull (merge)
142
+ - `r` - refresh repo (fetch)
143
+ - `R` - refresh all repos
144
+ - `t` - launch git history viewer (tig/lazygit/gitk)
145
+ - `s` - show repo status detail
146
+ - `v` - toggle verbose display
147
+ - `\` - expand/collapse all multi-layer repos
148
+ - `c` - open config menu
149
+ - `q` - quit
150
+
151
+ Keybindings in commit browser:
152
+ - `Tab` - mark commit for selection
153
+ - `Space` - select range of commits
154
+ - `?` - toggle preview pane
155
+ - `d` - toggle diff view in preview
156
+ - `c` - copy commit hash
157
+ - `e` - export selected commits
158
+ - `t` - launch git history viewer
159
+ - `←` or `b` - go back
160
+ - `q` - quit
161
+
162
+ ### Exporting Patches for Upstream
163
+
164
+ ```bash
165
+ # Prepare commits (reorder for upstream)
166
+ bitexport prep --branch zedd/feature
167
+
168
+ # Export patches
169
+ bitexport --target-dir ~/patches
170
+
171
+ # Export with version number
172
+ bitexport --target-dir ~/patches -v 2
173
+ ```
174
+
175
+ ### Searching for Layers
176
+
177
+ ```bash
178
+ # Interactive search
179
+ bitsearch
180
+
181
+ # Search with query
182
+ bitsearch virtualization
183
+
184
+ # Get layer info for scripting
185
+ bitsearch -i meta-virtualization
186
+
187
+ # Clone a layer directly
188
+ bitsearch -c meta-security -b scarthgap
189
+ ```
190
+
191
+ ### Managing Branches
192
+
193
+ ```bash
194
+ # Interactive branch management
195
+ bitbranch
196
+
197
+ # Switch all repos to a release branch
198
+ bitbranch --all scarthgap
199
+ ```
200
+
201
+ ### Managing Multiple Projects
202
+
203
+ ```bash
204
+ # Open project manager (interactive)
205
+ bitprojects
206
+
207
+ # Add a project directory
208
+ bitprojects add /path/to/yocto-build
209
+
210
+ # List known projects
211
+ bitprojects list
212
+
213
+ # Remove a project from tracking
214
+ bitprojects remove /path/to/old-project
215
+ ```
216
+
217
+ Keybindings in projects menu:
218
+ - `Space` - activate selected project (all commands will operate on it)
219
+ - `Enter` - activate project and open command menu (if auto-invoked)
220
+ - `+` - browse for a new directory to add
221
+ - `-` - remove selected project from tracking
222
+ - `c` - clear active project (use current directory)
223
+ - `s` - open settings
224
+
225
+ Note: When no valid project context exists (no bblayers.conf found), the projects picker is automatically shown.
226
+
227
+ ## Configuration
228
+
229
+ Per-repo settings are stored in `.bit.defaults` (JSON):
230
+
231
+ ```json
232
+ {
233
+ "/path/to/poky": "rebase",
234
+ "/path/to/meta-oe": "skip",
235
+ "__extra_repos__": ["/path/to/bitbake"],
236
+ "__hidden_repos__": ["/path/to/unwanted-repo"],
237
+ "__push_targets__": {
238
+ "/path/to/oe-core": {
239
+ "push_url": "ssh://git@push.openembedded.org/oe-core-contrib",
240
+ "branch_prefix": "yourname/"
241
+ }
242
+ },
243
+ "fzf_theme": "dark",
244
+ "fzf_text_color": "light-gray",
245
+ "fzf_custom_colors": {"pointer": "green"}
246
+ }
247
+ ```
248
+
249
+ Configure interactively with `bitconfig`.
250
+
251
+ ### Theme Customization
252
+
253
+ The tool supports customizable options via Settings menu (`bitconfig` -> Settings):
254
+
255
+ **Colors** submenu:
256
+ - **Theme** - Base color scheme (default, dark, light, dracula, nord, etc.)
257
+ - **Individual** - Per-element color overrides with live preview
258
+
259
+ A color preview panel shows all themed elements (pointer, header, prompt, etc.) with current colors applied.
260
+
261
+ **Directory Browser** - Choose preferred file browser for project selection:
262
+ - broot (recommended)
263
+ - ranger
264
+ - nnn
265
+ - fzf (fallback)
266
+
267
+ **Git Viewer** - Choose preferred git history viewer:
268
+ - auto (detect first available: tig > lazygit > gitk)
269
+ - tig - ncurses git interface
270
+ - lazygit - terminal UI for git
271
+ - gitk - graphical git browser
272
+
273
+ **Preview Layout** - Configure commit browser preview pane position:
274
+ - Bottom (default) - preview below commit list
275
+ - Right (side-by-side) - preview beside commit list
276
+ - Top - preview above commit list
277
+
278
+ **Terminal Colors** - Configure output colors for:
279
+ - Upstream indicator (commits to pull)
280
+ - Local commit count
281
+ - Dirty/clean status
282
+ - Repo names (configured, discovered, external)
283
+
284
+ ## Visual Indicators
285
+
286
+ Repos are color-coded by source:
287
+ - **Green** - from bblayers.conf
288
+ - **Magenta** with `(?)` - discovered layers (not in bblayers.conf)
289
+ - **Cyan** with `(ext)` - external repos (git repos without conf/layer.conf)
290
+
291
+ Status indicators:
292
+ - `5 local` - commits ahead of origin
293
+ - `↓ 3` - commits to pull from upstream
294
+ - `[clean]` / `[DIRTY]` - working tree status
295
+
296
+ ## Requirements
297
+
298
+ - Python 3.9+
299
+ - Git
300
+ - fzf (optional, but recommended for interactive features)
301
+ - argcomplete (optional, for tab completion)
302
+ - xclip or xsel (optional, for clipboard support)
303
+
304
+ ## Development
305
+
306
+ ### Installation for Development
307
+
308
+ ```bash
309
+ # Clone the repository
310
+ git clone https://gitlab.com/bruce-ashfield/bitbake-project.git
311
+ cd bitbake-project
312
+
313
+ # Create a virtual environment
314
+ python3 -m venv .venv
315
+ source .venv/bin/activate
316
+
317
+ # Install with dev dependencies
318
+ pip install -e .[dev]
319
+ ```
320
+
321
+ ### Running Tests
322
+
323
+ The project uses pytest with pytest-mock and pytest-cov:
324
+
325
+ ```bash
326
+ # Activate virtual environment first
327
+ source .venv/bin/activate
328
+
329
+ # Run all tests
330
+ pytest tests/ -v
331
+
332
+ # Run with coverage report
333
+ pytest tests/ --cov=bitbake_project --cov-report=term-missing
334
+
335
+ # Run only unit tests
336
+ pytest tests/unit/ -v
337
+
338
+ # Run only integration tests
339
+ pytest tests/integration/ -v
340
+
341
+ # Run tests matching a pattern
342
+ pytest tests/ -k "test_colors" -v
343
+ ```
344
+
345
+ ### Test Structure
346
+
347
+ ```
348
+ tests/
349
+ ├── conftest.py # Shared fixtures
350
+ ├── unit/
351
+ │ ├── test_colors.py # Colors class ANSI formatting
352
+ │ ├── test_helpers.py # Pure functions (clean_title, dedupe, sort)
353
+ │ ├── test_state.py # State management (defaults, prep, export)
354
+ │ ├── test_gitrepo.py # GitRepo class
355
+ │ ├── test_fzf_menu.py # FzfMenu class (mocked)
356
+ │ ├── test_bblayers_parser.py # BblayersParser
357
+ │ └── test_cli_parser.py # CLI argument parsing
358
+ ├── integration/
359
+ │ ├── test_cli_dispatch.py # Command dispatch, --help, aliases
360
+ │ └── test_projects_command.py # Projects add/remove/list
361
+ └── data/
362
+ └── bblayers/ # Test bblayers.conf files
363
+ ```
364
+
365
+ ## Project Structure
366
+
367
+ The project is organized as a Python package with a commands subpackage:
368
+
369
+ ```
370
+ bitbake_project/
371
+ ├── core.py # Core abstractions (Colors, GitRepo, FzfMenu)
372
+ ├── cli.py # Argument parsing and main()
373
+ └── commands/ # Command implementations
374
+ ├── common.py # Shared utilities (BblayersParser, etc.)
375
+ ├── explore.py # explore, status commands
376
+ ├── export.py # export, export prep commands
377
+ ├── config.py # config command
378
+ ├── branch.py # branch command
379
+ ├── update.py # update command
380
+ ├── search.py # search command
381
+ ├── init.py # init, bootstrap commands
382
+ ├── repos.py # repos command
383
+ └── projects.py # projects command, directory browser
384
+ ```
385
+
386
+ Distribution options:
387
+ - **Standalone**: Single-file zipapp (`dist/bit`)
388
+ - **Pip install**: `pip install -e .` for development
389
+
390
+ ## License
391
+
392
+ This project is licensed under the GNU General Public License v2.0 (GPL-2.0-only).
393
+
394
+ See [COPYING](COPYING) for the full license text.
395
+
396
+ ## See Also
397
+
398
+ - [INSTALL.md](INSTALL.md) - Installation instructions
399
+ - [Yocto Project](https://www.yoctoproject.org/)
400
+ - [OpenEmbedded](https://www.openembedded.org/)
401
+ - [OpenEmbedded Layer Index](https://layers.openembedded.org/)
@@ -0,0 +1,24 @@
1
+ bitbake_project/__init__.py,sha256=bHNTzSuvVUMCgTWknfPctZ_pa1FLqN4qHN744fmD7T8,1836
2
+ bitbake_project/__main__.py,sha256=2q6B4hjnfG7P3oyvDu2foHvg0Z7cnrVKxiusg6MqhQw,248
3
+ bitbake_project/cli.py,sha256=bJrxzV6TfhBk2u3fYvJ-okjDAqZSJaC4G-_jE6psD6Q,52617
4
+ bitbake_project/core.py,sha256=aicwu-JgDauukpDAEkkMKm5epkxXJvHwYnrJn9aVTrU,60747
5
+ bitbake_project/commands/__init__.py,sha256=dD2bWP7DGvS69uYPGaOiYcQEv-fAKXvatRBluJDfA3o,1589
6
+ bitbake_project/commands/branch.py,sha256=zfHeLBDxYINIWKeygRqu3-GulUsmhoIApT2vqh7sznI,32697
7
+ bitbake_project/commands/common.py,sha256=fwdk_f2FPWG05mP5SKR-QmRi95kzyNs85SLvz7ApBvk,85806
8
+ bitbake_project/commands/config.py,sha256=tDR-iIhGbKWBZ4EKLiQKMiABRyoazn1Omp_rERs0cd8,58734
9
+ bitbake_project/commands/deps.py,sha256=14N-wVTjlGy9-ag1LNEgJgYhHlVVNRGBJQ534rHlRB4,29283
10
+ bitbake_project/commands/explore.py,sha256=QbibtEXi2gYTR4bzAV9MhO7Ml4VF2wNyG-yUuPAKj0M,95865
11
+ bitbake_project/commands/export.py,sha256=E_KxlOJBsFLHzlVh6XZ9n700NSPkTY-eO2cAPh8GDog,43054
12
+ bitbake_project/commands/fragment.py,sha256=xUnDojoFcFiskgs7Pw_68Rl3a_MVlmoI81n7sdb2efo,29733
13
+ bitbake_project/commands/init.py,sha256=2OV3PgQu9GlJoVjDUxHSnXtvvOVIt2R1cPCvv1vb8x4,19253
14
+ bitbake_project/commands/projects.py,sha256=UJtXXZMWueJZfr2DRcrz-OXNAplxqLnlcTARLsrnrNM,48053
15
+ bitbake_project/commands/recipe.py,sha256=uxpi6HLEFR4hIwIj_Bm5m7B-lJ5wytxzlAb44IQDpzg,50413
16
+ bitbake_project/commands/repos.py,sha256=cPM44awGPmGGaiFOkbkiXDOHIpeQy30Wtj84mJBcNQ8,5478
17
+ bitbake_project/commands/search.py,sha256=_rmVC3NaUaVXgSHMnq4u1vLpYKGBszjW21xdcbL1zCE,11777
18
+ bitbake_project/commands/update.py,sha256=HFTV4xQV_sP_ta075DNT7DthlbvvPKwfZXviGX-AnI8,5861
19
+ bitp-1.0.6.dist-info/licenses/COPYING,sha256=7a72Msu2Q-TnoiFxemxEGkwafJGObk1W3rw9hzmyM_Y,17984
20
+ bitp-1.0.6.dist-info/METADATA,sha256=CKuykeaXw9WsvGKLTnU4GvnegtCDx3aVoka4rghuxTQ,11552
21
+ bitp-1.0.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
+ bitp-1.0.6.dist-info/entry_points.txt,sha256=55x-Dbc3IdqA_SMiwhXGqj315Ps4AhLPVIZB-H0izw0,81
23
+ bitp-1.0.6.dist-info/top_level.txt,sha256=Nft0-3c_eLKsPoi9mnVMSQsfsjxwWLwjt7XorOP9W6Y,16
24
+ bitp-1.0.6.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ bit = bitbake_project.cli:main
3
+ bitp = bitbake_project.cli:main