port uninstall --follow-dependents python35 removed part of py27- and py36- packages

Joshua Root jmr at macports.org
Wed May 17 17:15:27 UTC 2017

Alexey Luchko wrote:
> I've decided to switch python from 3.5 to 3.6 and after a time, run a
> command
> $ sudo port uninstall --no-exec --follow-dependents python35
> To my surprise were removed not only py35- packages and explicit python35
> dependents like httpie, but also a number of py27- and py36- packages.
> Naturally, py27-packaging for example has no dependency on python35:
> $ port info py27-packaging
> py27-packaging @16.8 (python)
> Description:          Core utilities for Python packages
> Homepage:             https://pypi.python.org/pypi/packaging/
> Library Dependencies: python27, py27-parsing, py27-six

What matters here is not the dependencies specified in the current 
version of the port, but those that were recorded in the registry at 
installation time. I can see how this is a surprising result, but the 
uninstall code involved is pretty straightforward and literally just 
loops through the ports that the registry says are dependents of the one 
being uninstalled.

To get to the bottom of what happened, you would need to look at 'port 
rdependents python35' -- but unfortunately you'd have to do that before 
the uninstall happened. (Since uninstall --follow-dependents is a fairly 
big hammer it's worth getting into the habit of looking at the 
rdependents beforehand anyway.)

So there are 3 possibilities: either the uninstall code is doing the 
wrong thing, or the dependents reported by the registry are wrong, or 
there really was some strange chain of dependencies such that this was 
technically correct. If you can come up with a reproducible test case 
that demonstrates that there is a bug, please do file a ticket.

- Josh

More information about the macports-users mailing list