Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cbe3bbd

Browse filesBrowse files
committed
simplify constraints hunting
1 parent 11e984e commit cbe3bbd
Copy full SHA for cbe3bbd

File tree

Expand file treeCollapse file tree

3 files changed

+15
-11
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+15
-11
lines changed

‎winpython/__init__.py

Copy file name to clipboardExpand all lines: winpython/__init__.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
OTHER DEALINGS IN THE SOFTWARE.
2929
"""
3030

31-
__version__ = '16.5.20250614'
31+
__version__ = '16.6.20250620'
3232
__license__ = __doc__
3333
__project_url__ = 'http://winpython.github.io/'

‎winpython/piptree.py

Copy file name to clipboardExpand all lines: winpython/piptree.py
+10-6Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,12 @@ def _get_dependency_tree(self, package_name: str, extra: str = "", version_req:
197197
extra + ',' in dependency["req_extra"] + ',' and \
198198
Marker(dependency["req_marker"]).evaluate(environment=environment | {"extra": up_req})):
199199
# IA risk error: # dask[array] go upwards as dask[dataframe], so {"extra": up_req} , not {"extra": extra}
200+
#tag downward limiting dependancies
201+
wall = " " if dependency["req_version"].startswith("<") or dependency["req_version"].startswith("==") else ""
200202
ret += self._get_dependency_tree(
201203
dependency["req_key"],
202204
up_req,
203-
f"[requires: {package_name}"
205+
f"[requires{wall}: {package_name}"
204206
+ (f"[{dependency['req_extra']}]" if dependency["req_extra"] != "" else "")
205207
+ f'{dependency["req_version"]}]',
206208
depth,
@@ -242,25 +244,27 @@ def down(self, pp: str = "", extra: str = "", depth: int = 20, indent: int = 5,
242244
lines = [l for l in rawtext.split("\n") if len(l.strip()) > 2]
243245
return "\n".join(lines).replace('"', "")
244246

245-
def up(self, pp: str, extra: str = "", depth: int = 20, indent: int = 5, version_req: str = "", verbose: bool = False) -> str:
247+
def up(self, ppw: str, extra: str = "", depth: int = 20, indent: int = 5, version_req: str = "", verbose: bool = False) -> str:
246248
"""Generate upward dependency tree as formatted string."""
249+
pp = ppw[:-1] if ppw.endswith('!') else ppw
250+
ppend = "!" if ppw.endswith('!') else "" #show only downward limiting dependancies
247251
if pp == ".":
248-
results = [self.up(p, extra, depth, indent, version_req, verbose) for p in sorted(self.distro)]
252+
results = [self.up(p + ppend, extra, depth, indent, version_req, verbose) for p in sorted(self.distro)]
249253
return '\n'.join(filter(None, results))
250254

251255
if extra == ".":
252256
if pp in self.distro:
253257
extras = set(self.distro[pp]["provided"]).union(set(self.distro[pp]["provides"]))
254-
results = [self.up(pp, e, depth, indent, version_req, verbose=verbose) for e in sorted(extras)]
258+
results = [self.up(pp + ppend, e, depth, indent, version_req, verbose=verbose) for e in sorted(extras)]
255259
return '\n'.join(filter(None, results))
256260
return ""
257261

258262
if pp not in self.distro:
259263
return ""
260264

261265
rawtext = json.dumps(self._get_dependency_tree(pp, extra, version_req, depth, verbose=verbose, upward=True), indent=indent)
262-
lines = [l for l in rawtext.split("\n") if len(l.strip()) > 2]
263-
return "\n".join(filter(None, lines)).replace('"', "")
266+
lines = [l for l in rawtext.split("\n") if len(l.strip()) > 2 and ( ppend=="" or not "[requires:" in l)]
267+
return "\n".join(filter(None, lines)).replace('"', "").replace('[requires :', '[requires:')
264268

265269
def description(self, pp: str) -> None:
266270
"""Return package description or None if not found."""

‎winpython/wppm.py

Copy file name to clipboardExpand all lines: winpython/wppm.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ def main(test=False):
278278
parser.add_argument("-lsa", dest="all", action="store_true",help=f"list details of packages matching [optional] expression: wppm -lsa pandas -l1")
279279
parser.add_argument("-md", dest="markdown", action="store_true",help=f"markdown summary of the installation")
280280
parser.add_argument("-p",dest="pipdown",action="store_true",help="show Package dependencies of the given package[option], [.]=all: wppm -p pandas[.]")
281-
parser.add_argument("-r", dest="pipup", action="store_true", help=f"show Reverse wppmdependancies of the given package[option]: wppm -r pytest[test]")
282-
parser.add_argument("-l", dest="levels", type=int, default=2, help="show 'LEVELS' levels of dependencies (with -p, -r), default is 2: wppm -p pandas -l1")
281+
parser.add_argument("-r", dest="pipup", action="store_true", help=f"show Reverse (!= constraining) dependancies of the given package[option]: wppm -r pytest![test]")
282+
parser.add_argument("-l", dest="levels", type=int, default=-1, help="show 'LEVELS' levels of dependencies (with -p, -r): wppm -p pandas -l1")
283283
parser.add_argument("-t", dest="target", default=sys.prefix, help=f'path to target Python distribution (default: "{sys.prefix}")')
284284
parser.add_argument("-i", "--install", action="store_true", help="install a given package wheel or pylock file (use pip for more features)")
285285
parser.add_argument("-u", "--uninstall", action="store_true", help="uninstall package (use pip for more features)")
@@ -300,13 +300,13 @@ def main(test=False):
300300
pip = piptree.PipData(targetpython, args.wheelsource)
301301
for args_fname in args.fname:
302302
pack, extra, *other = (args_fname + "[").replace("]", "[").split("[")
303-
print(pip.down(pack, extra, args.levels, verbose=args.verbose))
303+
print(pip.down(pack, extra, args.levels if args.levels>0 else 2, verbose=args.verbose))
304304
sys.exit()
305305
elif args.pipup:
306306
pip = piptree.PipData(targetpython, args.wheelsource)
307307
for args_fname in args.fname:
308308
pack, extra, *other = (args_fname + "[").replace("]", "[").split("[")
309-
print(pip.up(pack, extra, args.levels, verbose=args.verbose))
309+
print(pip.up(pack, extra, args.levels if args.levels>=0 else 1, verbose=args.verbose))
310310
sys.exit()
311311
elif args.list:
312312
pip = piptree.PipData(targetpython, args.wheelsource)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.