User:0xdc/Python

From Gentoo Wiki
Jump to: navigation, search

Upgrading Python

FILE /etc/portage/package.use/python
*/* PYTHON_SINGLE_TARGET: -* python3_7
*/* PYTHON_TARGETS: -* python3_7

Why python3_7? Check support for any important python applications you need to use. For me, the limiting app is www-servers/uwsgi.

root #emerge /usr/lib*/python* --changed-deps --oneshot --update --changed-use

Troubleshooting

updates/rebuilds have been skipped due to a dependency conflict

root #emerge /usr/lib*/python* --changed-deps --oneshot --update --changed-use
dev-python/pycairo:0
 (dev-python/pycairo-1.19.1:0/0::gentoo, ebuild scheduled for merge) USE="-doc -examples -test" ABI_X86="(64)" PYTHON_TARGETS="python3_7 (-pypy3) -python3_6 -python3_8 (-python3_9)" conflicts with
>=dev-python/pycairo-1.11.1[python_targets_python2_7(-),python_targets_python3_7(-),-python_single_target_python2_7(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),-python_single_target_python3_9(-)] required by (dev-python/pygobject-3.34.0:3/3::gentoo, ebuild scheduled for merge) USE="cairo -examples -test" ABI_X86="(64)" PYTHON_TARGETS="python2_7 python3_7 -python3_6 -python3_8 (-python3_9)"

In general, update the required package to update the dependencies:

root #emerge -1N pygobject

REQUIRED_USE constraints are unsatisfied

root #emerge /usr/lib*/python* --changed-deps --oneshot --update --changed-use
!!! The ebuild selected to satisfy "dev-python/enum34:0" has unmet requirements.

- dev-python/enum34-1.1.6-r1::gentoo USE="-doc" ABI_X86="(64)" PYTHON_TARGETS="-python2_7"

 The following REQUIRED_USE flag constraints are unsatisfied:
   python_targets_python2_7
 The above constraints are a subset of the following complete expression:
any-of ( python_targets_python2_7 )
root #emerge -cvp enum34
Calculating dependencies... done!
 dev-python/enum34-1.1.6-r1 pulled in by:
   dev-python/cryptography-2.9 requires dev-python/enum34[python_targets_python2_7(-),-python_single_target_python2_7(-)]
>>> No packages selected for removal by depclean

Check the dependant package:

root #emerge -1Na cryptography
WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:

dev-python/cryptography:0

 (dev-python/cryptography-2.9:0/0::gentoo, ebuild scheduled for merge) USE="-idna -libressl -test" ABI_X86="(64)" PYTHON_TARGETS="python3_7 (-pypy3) -python2_7 -python3_6 -python3_8 (-python3_9)" conflicts with
   >=dev-python/cryptography-2.8[python_targets_python2_7(-),python_targets_python3_7(-),-python_single_target_pypy3(-),-python_single_target_python2_7(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),-python_single_target_python3_9(-)] required by (dev-python/pyopenssl-19.1.0:0/0::gentoo, installed) USE="-doc -test" ABI_X86="(64)" PYTHON_TARGETS="python2_7 python3_7 (-pypy3) -python3_6 -python3_8 (-python3_9)"
   >=dev-python/cryptography-1.3.4[python_targets_python2_7(-),python_targets_python3_7(-),-python_single_target_pypy3(-),-python_single_target_python2_7(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),-python_single_target_python3_9(-)] required by (dev-python/urllib3-1.25.9:0/0::gentoo, installed) USE="-brotli -doc -test" ABI_X86="(64)" PYTHON_TARGETS="python2_7 python3_7 (-pypy3) -python3_6 -python3_8 (-python3_9)"
   >=dev-python/cryptography-1.3.4[python_targets_python2_7(-),python_targets_python3_7(-),-python_single_target_pypy3(-),-python_single_target_python2_7(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-),-python_single_target_python3_8(-),-python_single_target_python3_9(-)] required by (dev-python/requests-2.23.0:0/0::gentoo, installed) USE="ssl -socks5 -test" ABI_X86="(64)" PYTHON_TARGETS="python2_7 python3_7 (-pypy3) -python3_6 -python3_8 (-python3_9)"
Nothing to merge; quitting.

Update these packages first:

root #emerge -1N pyopenssl urllib3 requests
root #emerge -1N cryptography
root #emerge -c enum34
>>> These are the packages that would be unmerged:
dev-python/enum34
   selected: 1.1.6-r1
  protected: none
    omitted: none

All selected packages: =dev-python/enum34-1.1.6-r1

>>> 'Selected' packages are slated for removal.

>>> 'Protected' and 'omitted' packages will not be removed.

Wishlist

I wish portage had a machine-readable output so that this could be automated.