You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
README_PYPI: lead with real output, and make the package findable
The page listed what wppm can do without ever showing a result, so a
visitor had to imagine the output. Each section now asks a question and
answers it with actual terminal output, all of it run and pasted
verbatim:
- wppm -p "flit![.]" as the opener: which extras of an installed
package are unusable here, and exactly what is missing,
- wppm -r "pytest[.]": who pulls a package in, through which extra --
the granularity pipdeptree does not have,
- wppm -r "pluggy!": the handful of packages that cap it, ie what will
actually fight the next upgrade.
Adds a library section (piptree.PipData().down(..., format="json")),
since the tree engine is importable and takes a target= -- no
subprocess, no parsing of terminal output.
pyproject: the PyPI search line read "WinPython Package Management" and
the keywords were Portable/Windows, so nobody looking for a dependency
tool could match it. Description and keywords now say what it does,
plus console/build-tools classifiers.
Usage block regenerated from --help; it had drifted, and now differs
only in the -t default, kept generic instead of a local path.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
With `-r`, the `!` filter keeps only the packages that *pin or cap* the one you name —
80
+
the handful that will actually fight your next upgrade, instead of the long list of
81
+
packages that merely depend on it:
53
82
54
83
```console
55
-
wppm -ls -ws .\wheelhouse\included.wheels --json
84
+
$ wppm -r "pluggy!"
85
+
pluggy==1.6.0 ,
86
+
pytest==9.0.3 [requires: pluggy<2,>=1.5]
56
87
```
57
88
58
-
A manifest of the current environment (distribution, tools, packages, wheelhouse):
89
+
An empty answer here is good news: nothing constrains it, upgrade away.
90
+
91
+
And the whole constraint web of an environment — every package, every extra, nine
92
+
levels deep — is one command:
59
93
60
94
```console
61
-
wppm -md --json
95
+
$ wppm -p ".[.]" -l9
62
96
```
63
97
64
-
Fail a CI job if anything in the tree is missing:
98
+
## Everything is available as JSON
99
+
100
+
Any of `-p`, `-r`, `-ls`, `-md` accepts `-j` / `--json`, so the same answers can gate a
101
+
CI job or be diffed between two environments:
102
+
103
+
```console
104
+
$ wppm -p pluggy -j
105
+
[
106
+
{
107
+
"package": "pluggy",
108
+
"extra": "",
109
+
"version": "1.6.0",
110
+
"installed": true,
111
+
"constraint": "",
112
+
"depends": []
113
+
}
114
+
]
115
+
```
65
116
66
117
```console
67
-
wppm -p myapp -j | python -c "import sys,json; s=json.load(sys.stdin); [s.extend(n['depends']) for n in s]; sys.exit(1 if any(not n['installed'] for n in s) else 0)"
118
+
$ wppm -p myapp -j | python -c "import sys,json; s=json.load(sys.stdin); [s.extend(n['depends']) for n in s]; sys.exit(1 if any(not n['installed'] for n in s) else 0)"
68
119
```
69
120
121
+
## Or use it from Python
122
+
123
+
The tree engine is a plain importable module — no subprocess, no parsing of terminal
124
+
output. `down()` walks dependencies, `up()` walks them backwards, and both return
125
+
indented text by default or a JSON string with `format="json"`:
126
+
127
+
```python
128
+
import json
129
+
from wppm import piptree
130
+
131
+
pip = piptree.PipData() # or PipData(target=r"D:\WPy64\python")
132
+
133
+
tree = json.loads(pip.down("pandas", "mysql", format="json"))
134
+
missing = [d["package"] for d in tree[0]["depends"] ifnot d["installed"]]
135
+
print(f"pandas[mysql] needs: {missing}")
136
+
```
137
+
138
+
```console
139
+
pandas[mysql] needs: ['pymysql', 'sqlalchemy']
140
+
```
141
+
142
+
```python
143
+
>>>print(pip.up("pluggy!")) # who caps pluggy?
144
+
pluggy==1.6.0 ,
145
+
pytest==9.0.3 [requires: pluggy<2,>=1.5]
146
+
>>> pip.summary("pandas")
147
+
'Powerful data structures for data analysis, time series, and statistics'
148
+
```
149
+
150
+
## It also works on environments you have not installed anything into
151
+
152
+
`-t` points `wppm` at *another* Python distribution, and `-ws` at a plain directory of
153
+
wheels — so you can inspect a portable distribution, or an offline bundle, without
0 commit comments