pipu-cli 0.1.dev0__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,517 @@
1
+ Metadata-Version: 2.4
2
+ Name: pipu-cli
3
+ Version: 0.1.dev0
4
+ Summary: A cute Python package updater
5
+ Author-email: Scott Arne Johnson <scott.arne.johnson@gmail.com>
6
+ License-Expression: MIT
7
+ Keywords: pip,pipu,package,updater,package management
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: rich_click<2.0,>=1.7
14
+ Requires-Dist: rich<14.0,>=13.0
15
+ Requires-Dist: textual<1.0,>=0.40
16
+ Requires-Dist: packaging<25.0,>=23.0
17
+ Provides-Extra: dev
18
+ Requires-Dist: invoke; extra == "dev"
19
+ Requires-Dist: build; extra == "dev"
20
+ Dynamic: license-file
21
+
22
+ <p align="center">
23
+ <img src=".assets/pipu.png" alt="pipu logo" width="300"/>
24
+ </p>
25
+
26
+ # pipu
27
+
28
+ **Author:** Scott Arne Johnson ([sajohn2@gmail.com](mailto:sajohn2@gmail.com))
29
+
30
+ A powerful and user-friendly Python package updater with advanced constraint handling, beautiful TUI, and intelligent version management. Keep your Python packages up-to-date while maintaining stability through smart constraint enforcement.
31
+
32
+ ## ✨ Key Features
33
+
34
+ - 🎮 **Interactive TUI** - Beautiful terminal interface with keyboard navigation and real-time feedback
35
+ - 🎯 **Smart Constraints** - Automatic constraint discovery and enforcement to prevent breaking updates
36
+ - 🚫 **Flexible Ignoring** - Exclude packages from updates with environment-specific rules
37
+ - 📊 **Rich Output** - Color-coded tables showing constraints, versions, and update safety
38
+ - 🔍 **Pre-release Support** - Optional inclusion of alpha, beta, and RC versions
39
+ - ⚙️ **Configurable** - 10+ environment variables for advanced customization
40
+ - 🔒 **Safe Updates** - Thread-safe operations with guaranteed resource cleanup
41
+ - 🌐 **Cross-Platform** - Full support for Windows, macOS, and Linux
42
+
43
+ ## 🚀 Quick Start
44
+
45
+ ### Installation
46
+
47
+ ```bash
48
+ # Install in editable mode for development
49
+ pip install --config-settings editable_mode=compat -e ".[dev]"
50
+ ```
51
+
52
+ ### Basic Usage
53
+
54
+ ```bash
55
+ # Launch interactive TUI (recommended)
56
+ pipu
57
+
58
+ # List outdated packages
59
+ pipu list
60
+
61
+ # Update all packages with confirmation
62
+ pipu update
63
+
64
+ # Auto-update without prompting
65
+ pipu update --yes
66
+ ```
67
+
68
+ That's it! For most users, just running `pipu` will give you everything you need.
69
+
70
+ ## 📖 Detailed Usage
71
+
72
+ ### Commands Overview
73
+
74
+ | Command | Description | Example |
75
+ |---------|-------------|---------|
76
+ | `pipu` | Launch interactive TUI | `pipu` |
77
+ | `pipu list` | List outdated packages | `pipu list --pre` |
78
+ | `pipu update` | Update packages (with confirmation) | `pipu update --yes` |
79
+ | `pipu constrain` | Manage version constraints | `pipu constrain "requests<3.0"` |
80
+ | `pipu ignore` | Manage ignored packages | `pipu ignore setuptools pip` |
81
+
82
+ ### Interactive TUI Mode
83
+
84
+ The TUI is the easiest way to manage updates. Just run `pipu` with no arguments.
85
+
86
+ **Navigation:**
87
+ - **↑/↓** - Navigate packages
88
+ - **Space** - Toggle package selection
89
+ - **A** - Select all packages
90
+ - **N** - Deselect all packages
91
+ - **Enter** - Confirm and update selected packages
92
+ - **Esc/Q** - Cancel and exit
93
+ - **H** - Show help
94
+
95
+ **Visual Indicators:**
96
+ - ✓ Green checkmark = Selected for update
97
+ - 🟢 Green constraint = Safe to update
98
+ - 🔴 Red constraint = Update blocked by constraint
99
+ - ⚫ Gray dash (-) = No constraint
100
+
101
+ ### Command-Line Mode
102
+
103
+ For automation and scripting, use command-line mode:
104
+
105
+ ```bash
106
+ # List outdated packages
107
+ pipu list
108
+
109
+ # Include pre-releases (alpha, beta, rc)
110
+ pipu list --pre
111
+
112
+ # Update with confirmation prompt
113
+ pipu update
114
+
115
+ # Update without confirmation (for scripts)
116
+ pipu update --yes
117
+
118
+ # Update including pre-releases
119
+ pipu update --pre --yes
120
+ ```
121
+
122
+ ### Managing Constraints
123
+
124
+ Constraints prevent packages from updating beyond specific versions, ensuring stability.
125
+
126
+ **Add Constraints:**
127
+ ```bash
128
+ # Single constraint
129
+ pipu constrain "requests>=2.25.0,<3.0.0"
130
+
131
+ # Multiple constraints
132
+ pipu constrain "numpy>=1.20.0" "pandas<2.0.0" "django~=4.1.0"
133
+
134
+ # Environment-specific (for conda/venv/poetry environments)
135
+ pipu constrain "pytest>=7.0.0" --env development
136
+ ```
137
+
138
+ **List Constraints:**
139
+ ```bash
140
+ # All constraints
141
+ pipu constrain --list
142
+
143
+ # Environment-specific
144
+ pipu constrain --list --env production
145
+ ```
146
+
147
+ **Remove Constraints:**
148
+ ```bash
149
+ # Remove specific packages
150
+ pipu constrain --remove requests numpy
151
+
152
+ # Remove from specific environment
153
+ pipu constrain --remove django --env production
154
+
155
+ # Remove ALL constraints (prompts for confirmation)
156
+ pipu constrain --remove-all
157
+
158
+ # Skip confirmation
159
+ pipu constrain --remove-all --yes
160
+ ```
161
+
162
+ **Auto-Discovery:**
163
+
164
+ Pipu automatically discovers constraints from your installed packages' dependencies. For example, if `deprecated==1.2.10` depends on `wrapt<2`, pipu will automatically constrain `wrapt<2` and show "deprecated>1.2.10" as the trigger. These auto-constraints are temporary and removed when no longer needed.
165
+
166
+ ### Managing Ignored Packages
167
+
168
+ Ignored packages are completely excluded from update checks.
169
+
170
+ **Add Ignores:**
171
+ ```bash
172
+ # Ignore packages globally
173
+ pipu ignore setuptools pip wheel
174
+
175
+ # Environment-specific ignores
176
+ pipu ignore pytest black mypy --env development
177
+ ```
178
+
179
+ **List Ignores:**
180
+ ```bash
181
+ pipu ignore --list
182
+ pipu ignore --list --env production
183
+ ```
184
+
185
+ **Remove Ignores:**
186
+ ```bash
187
+ pipu ignore --remove setuptools wheel
188
+ pipu ignore --remove-all
189
+ pipu ignore --remove-all --yes # Skip confirmation
190
+ ```
191
+
192
+ ## ⚙️ Configuration
193
+
194
+ ### Environment Variables
195
+
196
+ Customize pipu's behavior with environment variables:
197
+
198
+ **Network Settings:**
199
+ ```bash
200
+ export PIPU_TIMEOUT=30 # Network timeout (default: 10s)
201
+ export PIPU_RETRIES=3 # Retry attempts (default: 0)
202
+ export PIPU_MAX_NETWORK_ERRORS=3 # Max consecutive errors (default: 1)
203
+ export PIPU_RETRY_DELAY=1.0 # Delay between retries (default: 0.5s)
204
+ ```
205
+
206
+ **Subprocess Settings:**
207
+ ```bash
208
+ export PIPU_SUBPROCESS_TIMEOUT=60 # Subprocess timeout (default: 30s)
209
+ export PIPU_UNINSTALL_TIMEOUT=180 # Uninstall timeout (default: 120s)
210
+ export PIPU_FORCE_KILL_TIMEOUT=10 # Force kill timeout (default: 5s)
211
+ ```
212
+
213
+ **Caching & Logging:**
214
+ ```bash
215
+ export PIPU_CACHE_TTL=120 # Cache lifetime (default: 60s)
216
+ export PIPU_LOG_LEVEL=DEBUG # Logging level (default: WARNING)
217
+ ```
218
+
219
+ **Example: Slow Network Configuration**
220
+ ```bash
221
+ # For slow or unreliable networks
222
+ export PIPU_TIMEOUT=60
223
+ export PIPU_RETRIES=5
224
+ export PIPU_RETRY_DELAY=2.0
225
+ pipu update --yes
226
+ ```
227
+
228
+ ### Pip Configuration Integration
229
+
230
+ Pipu seamlessly integrates with pip's configuration files:
231
+
232
+ **Linux/macOS:**
233
+ - `~/.config/pip/pip.conf` (user-specific)
234
+ - `~/.pip/pip.conf` (legacy)
235
+ - `/etc/pip.conf` (system-wide)
236
+
237
+ **Windows:**
238
+ - `%APPDATA%\pip\pip.ini` (user-specific)
239
+ - `C:\ProgramData\pip\pip.ini` (system-wide)
240
+
241
+ **Example Configuration:**
242
+ ```ini
243
+ [global]
244
+ index-url = https://pypi.org/simple/
245
+ trusted-host = pypi.org
246
+
247
+ # Global constraints
248
+ constraints =
249
+ requests>=2.25.0,<3.0.0
250
+ numpy>=1.20.0
251
+ django>=4.1.0,<5.0.0
252
+
253
+ # Global ignores
254
+ ignores = pip setuptools wheel
255
+
256
+ [development]
257
+ # Development-specific constraints
258
+ constraints =
259
+ pytest>=7.0.0
260
+ black>=22.0.0
261
+ mypy>=1.0.0
262
+
263
+ ignores =
264
+ requests
265
+ numpy
266
+ ```
267
+
268
+ ## 📚 Advanced Topics
269
+
270
+ ### Constraint Sources (Priority Order)
271
+
272
+ Pipu checks these sources in order:
273
+
274
+ 1. **`PIP_CONSTRAINT` environment variable**
275
+ ```bash
276
+ export PIP_CONSTRAINT=/path/to/constraints.txt
277
+ ```
278
+
279
+ 2. **Pip config - Environment-specific section**
280
+ ```ini
281
+ [myenv] # Detected from conda/venv/poetry
282
+ constraints = /path/to/constraints.txt
283
+ ```
284
+
285
+ 3. **Pip config - Global section**
286
+ ```ini
287
+ [global]
288
+ constraints = /path/to/constraints.txt
289
+ ```
290
+
291
+ 4. **Project root** (legacy fallback)
292
+ ```
293
+ your-project/
294
+ ├── pyproject.toml # or setup.py
295
+ └── constraints.txt
296
+ ```
297
+
298
+ 5. **Auto-discovered constraints** (from installed packages)
299
+ - Automatically detected from package dependencies
300
+ - Temporary and self-cleaning
301
+ - Displayed with "Invalid When" trigger information
302
+
303
+ ### Constraint File Format
304
+
305
+ ```txt
306
+ # Web frameworks
307
+ requests>=2.25.0,<3.0.0
308
+ django>=4.1.0,<5.0.0
309
+ flask~=2.0.0
310
+
311
+ # Data science
312
+ numpy>=1.20.0
313
+ pandas>=1.5.0,!=1.5.1
314
+ scipy>=1.9.0,!=1.9.1,<2.0.0
315
+
316
+ # Comments and empty lines are ignored
317
+ matplotlib==3.6.0 # Exact version
318
+ ```
319
+
320
+ ### Constraint Operators
321
+
322
+ | Operator | Description | Example |
323
+ |----------|-------------|---------|
324
+ | `==1.0.0` | Exact version | `requests==2.28.0` |
325
+ | `>=1.0.0` | Minimum version | `numpy>=1.20.0` |
326
+ | `<=2.0.0` | Maximum version | `django<=4.2.0` |
327
+ | `>1.0.0,<2.0.0` | Version range | `flask>2.0,<3.0` |
328
+ | `~=1.4.0` | Compatible version | `black~=22.0` |
329
+ | `!=1.5.1` | Exclude version | `pandas!=1.5.1` |
330
+
331
+ ### Environment Detection
332
+
333
+ Pipu automatically detects your Python environment:
334
+
335
+ - **Conda/Mamba/Micromamba**: Uses `$CONDA_DEFAULT_ENV`
336
+ - **Poetry**: Runs `poetry env info --name`
337
+ - **Virtualenv/venv**: Uses basename of `$VIRTUAL_ENV`
338
+
339
+ This enables environment-specific constraints and ignores.
340
+
341
+ ### Invalidation Triggers
342
+
343
+ Pipu supports automatic constraint removal when packages are updated. Useful for temporary constraints:
344
+
345
+ ```bash
346
+ # Add constraint with trigger
347
+ pipu constrain "wrapt<2" --invalidation-triggers "deprecated>1.2.10"
348
+
349
+ # When deprecated is updated to >1.2.10, wrapt constraint is automatically removed
350
+ pipu update deprecated
351
+
352
+ # Manually check and clean invalid constraints
353
+ pipu constrain --list # Shows triggers
354
+ ```
355
+
356
+ ## 🎨 Output Examples
357
+
358
+ ### List Command Output
359
+
360
+ ```
361
+ Outdated Packages
362
+ ┏━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
363
+ ┃ Package ┃ Version ┃ Latest ┃ Type ┃ Constraint ┃ Invalid When ┃
364
+ ┡━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
365
+ │ requests │ 2.28.0 │ 2.31.0 │ wheel │ - │ - │
366
+ │ numpy │ 1.19.5 │ 1.24.3 │ wheel │ >=1.20.0 │ - │
367
+ │ wrapt │ 1.14.0 │ 2.0.0 │ wheel │ <2 │ deprecated>1.2.10│
368
+ └──────────────┴─────────┴─────────┴───────┴────────────┴──────────────────┘
369
+ ```
370
+
371
+ **Color Coding:**
372
+ - 🟢 **Green** = Constraint satisfied, safe to update
373
+ - 🔴 **Red** = Constraint violated, update blocked
374
+ - ⚫ **Gray dash** = No constraint
375
+
376
+ ## 🔧 Development
377
+
378
+ ### Running Tests
379
+
380
+ ```bash
381
+ # All tests (422 tests)
382
+ pytest tests/ -v
383
+
384
+ # Specific test categories
385
+ pytest tests/test_constraints.py -v
386
+ pytest tests/test_cli.py -v
387
+ pytest tests/test_tui_usability.py -v
388
+
389
+ # With coverage
390
+ pytest tests/ --cov=pipu_cli --cov-report=html
391
+ ```
392
+
393
+ ### Building
394
+
395
+ ```bash
396
+ # Install build dependencies
397
+ pip install build
398
+
399
+ # Build distribution
400
+ python -m build
401
+
402
+ # Install locally
403
+ pip install dist/pipu_cli-*.whl
404
+ ```
405
+
406
+ ### Code Quality
407
+
408
+ The codebase includes:
409
+ - ✅ Thread-safe operations
410
+ - ✅ Cross-platform compatibility
411
+ - ✅ Comprehensive error handling
412
+ - ✅ Type hints on key functions
413
+ - ✅ Extensive test coverage (422 tests)
414
+ - ✅ Resource cleanup guarantees
415
+
416
+ ## 🤝 Common Workflows
417
+
418
+ ### Workflow 1: First-Time Setup
419
+
420
+ ```bash
421
+ # 1. Install pipu
422
+ pip install -e .
423
+
424
+ # 2. Check what's outdated
425
+ pipu list
426
+
427
+ # 3. Use interactive mode to select packages
428
+ pipu
429
+
430
+ # 4. Add constraints for critical packages
431
+ pipu constrain "django>=4.1,<5.0" "numpy>=1.20"
432
+
433
+ # 5. Update everything else
434
+ pipu update --yes
435
+ ```
436
+
437
+ ### Workflow 2: CI/CD Pipeline
438
+
439
+ ```bash
440
+ # Increase timeouts for CI environments
441
+ export PIPU_TIMEOUT=60
442
+ export PIPU_RETRIES=3
443
+ export PIPU_CACHE_TTL=300
444
+
445
+ # Check for outdated packages
446
+ pipu list
447
+
448
+ # Update with auto-approval
449
+ pipu update --yes
450
+ ```
451
+
452
+ ### Workflow 3: Development Environment
453
+
454
+ ```bash
455
+ # Create dev-specific constraints
456
+ pipu constrain "pytest>=7.0" --env development
457
+ pipu ignore requests numpy --env development
458
+
459
+ # Update only development packages
460
+ pipu update --yes
461
+ ```
462
+
463
+ ### Workflow 4: Production Environment
464
+
465
+ ```bash
466
+ # Strict constraints for production
467
+ pipu constrain "requests==2.28.0" --env production
468
+ pipu constrain "django~=4.1.0" --env production
469
+
470
+ # List what would be updated (without updating)
471
+ pipu list
472
+
473
+ # Only update when ready
474
+ pipu update --yes
475
+ ```
476
+
477
+ ## 📋 Troubleshooting
478
+
479
+ ### Common Issues
480
+
481
+ **Slow Package Checks:**
482
+ ```bash
483
+ # Increase timeout and enable retries
484
+ export PIPU_TIMEOUT=30
485
+ export PIPU_RETRIES=3
486
+ pipu list
487
+ ```
488
+
489
+ **Network Errors:**
490
+ ```bash
491
+ # Enable debug logging
492
+ export PIPU_LOG_LEVEL=DEBUG
493
+ pipu list
494
+ ```
495
+
496
+ **Terminal Display Issues:**
497
+ ```bash
498
+ # The TUI handles terminal cleanup automatically
499
+ # If issues persist, pipu resets terminal state on exit
500
+ ```
501
+
502
+ **Package Not Found:**
503
+ ```bash
504
+ # Check if package is in your pip indexes
505
+ pip search package-name
506
+
507
+ # Check your pip configuration
508
+ pip config list
509
+ ```
510
+
511
+ ## 📄 License
512
+
513
+ MIT License - see LICENSE file for details.
514
+
515
+ ---
516
+
517
+ **Made with ❤️ for Python developers who want safe, smart package updates.**
@@ -0,0 +1,19 @@
1
+ pipu_cli/__init__.py,sha256=KOxurgQjOvev1wXOq9gL0JkZTXSsfbhH_KDEJjhHtG4,1190
2
+ pipu_cli/cli.py,sha256=aCN2Fz1bWhXs8MC7kqy5GdzJggNtTdumW4PQkxKOBpg,39993
3
+ pipu_cli/common.py,sha256=g5krfXFsvVJpOf87Vw4DGi5WIduDgMlRuONKXqO328M,78
4
+ pipu_cli/config.py,sha256=xsfNU4ORAujla_FGfsMKpxy7QTpd_bJhRF_u4IPKLW0,3635
5
+ pipu_cli/internals.py,sha256=mOVsEEzR-xm1Kg1y3c_JU0BcJS4FjnogLoSoyqHV2-8,31806
6
+ pipu_cli/package_constraints.py,sha256=aIFYRJc_DhUNWaNQmZBxUED3orG8x8Sy0W7xfJ5XVHY,92483
7
+ pipu_cli/thread_safe.py,sha256=zdQyCoMVJW73MC-d1pL_4ZO-K4AwkI0JeVyQsd8x7nY,7545
8
+ pipu_cli/utils.py,sha256=ijSHKVuKbjmRbj2RwD9S1606PeY4oDiutzhutpX25wM,5842
9
+ pipu_cli/ui/__init__.py,sha256=nCb_3G_vZXy5_Or9z9r-3XhYV1ppUR1r7nMZ9_6Srwg,1432
10
+ pipu_cli/ui/apps.py,sha256=ltH24sg-3nqVpoomgCwhVYuAwq3hBUwYRH60JXtV2Yg,59771
11
+ pipu_cli/ui/constants.py,sha256=HBPf4KYWHiT18c7ciQ0HeI7gZE3VIFOT0uobLU8YxQA,445
12
+ pipu_cli/ui/modal_dialogs.py,sha256=5OF8UL2lXXH3GoAxFQCqp_T3jc5jeLSk77Y7ffBt6mw,45849
13
+ pipu_cli/ui/table_widgets.py,sha256=PC0CqqrK3KgMbTCYRPG01lxkEtRBz9xr9PN8EzoObz8,14322
14
+ pipu_cli-0.1.dev0.dist-info/licenses/LICENSE,sha256=q6TxVbSI0WMB9ulF2V0FWQfeA5om3d-T9X7QwuhdiYE,1075
15
+ pipu_cli-0.1.dev0.dist-info/METADATA,sha256=xfsM0WPvGOfZFYkIZcGRvYhr10qudNk4567_4s76xj8,13200
16
+ pipu_cli-0.1.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ pipu_cli-0.1.dev0.dist-info/entry_points.txt,sha256=VSv6od00zOPblnFPflNLaci4jBtQIgLYJjL1BKxLz_o,42
18
+ pipu_cli-0.1.dev0.dist-info/top_level.txt,sha256=z3Yce93-jGQjGRpsGZUZvbS8osh3OyS7MVpzG0uBE5M,9
19
+ pipu_cli-0.1.dev0.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
+ pipu = pipu_cli.cli:cli
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Scott Arne Johnson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ pipu_cli