Emerging ninja, it does not require the Python3 nor claim it, but when Python3 is installed later, ninja blocks it automatically: # emerge -cav python:3.6 Calculating dependencies... done! dev-lang/python-3.6.3-r1 pulled in by: app-text/iso-codes-3.75 requires dev-lang/python:3.6 dev-libs/libevdev-1.5.7 requires dev-lang/python:3.6 *dev-util/ninja-1.8.2 requires dev-lang/python:3.6* x11-libs/libxcb-1.12-r2 requires dev-lang/python:3.6[xml] Regards!
Sorry, but I don't understand what you are trying to say. Could you redescribe the problem, and provide steps to reproduce it?
Yes, if Python 3.x is not installed, ninja no add by dependences: # emerge --unmerge python:3.6 (forced unmerge) # emerge -1 ninja (it builds without python3) # emerge python:3.6 But the surprise is when I trying the depclean of python 3.6, that ninja requires Python 3.6 when before is not build with it: # emerge -cav python:3.6 dev-lang/python-3.6.3-r1 pulled in by: dev-util/ninja-1.8.2 requires dev-lang/python:3.6
dev-util/ninja has this in DEPEND: || ( dev-lang/python:3.6 dev-lang/python:3.5 dev-lang/python:3.4 >=dev-lang/python-2.7.5-r2:2.7 ) So it definitely does require/utilize some python at build time, but any version is acceptable. I imagine portage sees python:3.6 as the "most preferable" version of python, and therefore refuses to remove it when dep-cleaning. It is debatable whether this is a "bug" in portage.
Portage is intended to prefer choices toward the left side *if* they've been pulled into the dependency graph. Since other packages have pulled dev-lang/python:3.6, it's intended for this choice to propagate tot the ninja dependencies. See bug 642484 for an example of the opposite case, where emerge --depclean wants to remove openrc even though it is listed toward the left, since nothing pulled openrc into the dependency graph. The same would happen for dev-lang/python:3.6 if nothing pulled it in.
The only version of python that I have on the system when I build ninja is 2.7. Preferable is not necessary, and if it's not build with 3.x as dependency, it will not block it later... or portage can be take new function that helps to remove packages ignoring if it's only dependency preferable.
app-text/iso-codes needs python3, so I imagine that is really what pulls in dev-lang/python:3.6.
If you put the version of python that you don't want in /etc/portage/package.mask, then that should be enough to make emerge --depclean choose another version whenever possible.