Python

Rendimiento mejorado de Python

Dependiendo de la carga de trabajo, se observa ahora una mejora del rendimiento de hasta un 27% en el software basado en Python. La mejora del rendimiento se logra construyendo el interprete de Python con -fno-semantic-interposition. Porque ahora no hay interposición semántica, las búsquedas de símbolos internos de libpython a la librería libpython son más directas y rápidas.

Como consecuencia, si los usuarios de Fedora necesitan usar LD_PRELOAD para anular símbolos en libpython, la forma recomendada es crear una compilación personalizada de Python sin -fno-semantic-interposition. Sin embargo es todavía posible usar LD_PRELOAD para anular símbolos en otras librerías (por ejemplo en glibc).

Se ha quitado Python 2

Python paró de soportar Python 2 el 1 de Enero de 2020. Por esta razón, Fedora 32 quita los paquetes Python.

Los siguientes paquetes ya no están disponibles:

  • El paquete python2 y todos sus subpaquetes.

  • Todos los paquetes que necesita para que corra Python 2.

  • Todos los paquetes que necesita para construir Python 2.

Fedora 32 proporciona todavía un paquete de legado python27. Este paquete está dirigido a los desarrolladores que necesiten soporte para Python 2 y para los usuarios que necesiten usar software que dependa de Python 2.

El paquete python27 tiene variar limitaciones en comparación con el paquete python2 original:

  • The package has no subpackages. All content is stored in the single package.

  • The package provides no debug build, which was previously available as python2-debug.

  • The package does not provide the /usr/bin/python binary.

  • Any special backwards compatible Provides are removed (this package is not intended to be depended upon).

Deprecated support for Nose

Support for Nose is now deprecated. However for now, the python3-nose package continues to be available in the Fedora repositories. No specific release it yet targeted to remove the python3-nose package.

Users and packagers of dependent packages are encouraged to switch to python3-pytest or python3-nose2.

Notes on migrating user-installed pip packages

When you upgrade from Fedora 30 or 31 to Fedora 32, the main Python interpreter version changes from 3.7 to 3.8. If you have any Python packages installed using pip, you must complete the following procedure to migrate them to the new version:

  1. Install the previously main Python version:

    sudo dnf install python3.7
  2. Get pip for the previously main Python version:

    python3.7 -m ensurepip --user
  3. Observe the installed packages:

    python3.7 -m pip list
  4. Save the list with specific versions:

    python3.7 -m pip freeze > installed.txt
  5. Install the same packages for the now default version:

    python3 -m pip install --user -r installed.txt
  6. Uninstall user-installed packages for 3.7; this ensures proper removal of files in ~/.local/bin:

    python3.7 -m pip uninstall $(python3.7 -m pip list --user | cut -d" " -f1)
  7. Optionally, clean up the now empty directory structure:

    rm -rf ~/.local/lib/python3.7/
  8. Optionally, remove the unneeded Python version:

    sudo dnf remove python3.7

Additionally, if you have any pip packages installed using sudo, run the following commands before running the final step above which removes `python3.7`, or install it again temporarily:

  1. Get pip for the previously main Python version for root:

    sudo python3.7 -m ensurepip
  2. Observe the system-installed packages:

    sudo python3.7 -m pip list
  3. Uninstall installed packages for 3.7; this ensures proper removal of files in /usr/local/bin:

    sudo python3.7 -m pip uninstall $(python3.7 -m pip list | cut -d" " -f1)
  4. Optionally, clean up now empty directory structure:

    sudo rm -rf /usr/local/lib*/python3.7/

If you followed the first procedure, the packages are already installed for your user account, which is the preferred option. Avoid using sudo pip in the future; these instructions are only intended to recover users who already used sudo pip in the past.