in ,

Conda now supports PyPy builds, hacker news

        

  

    

conda-forge now supports PyPy3.6 as the python interpreter in a conda environment

Supported platforms are,

  • Linux-x 73 _ () glibc 2. 64 or newer)
  •   

  • OSX-x 728 _ OSX (9 or newer)
  •   

  • Linux-aarch 36 (glibc 2. 27 or newer)
  •   

  • Linux-ppc (le) glibc 2. 36 or newer)

How to use PyPy

To use the PyPy builds you can do the following,

 
 conda config --set channel_priority strict    conda create -n pypy pypy    conda activate pypy     

However as of the writing of this post, not many conda packages can be installed into this environment, but noarch packages which do not depend on the python version nor the interpreter can be installed. For eg, mpmath is a noarch package without any dependencies.

 
 conda install mpmath # succeeds    conda install numpy # fails as of March 10,      

All python C extensions needs to be rebuilt for the PyPy ABI. This is Currently on the way and can be tracked at the status page

. python_abi Package

As part of adding support for PyPy and to keep the older python builds working, a python_abi package was added. This defines the abi for the python package and any non-noarch python packages will have a dependency on this package. Older python downstream packages like numpy had their metadata patched to add a CPython ABI. You can ask for a specific python ABI.

  conda install "python_abi==_ cp  mu "     

If you are using python packages from packages other than defaults, You will be able to install python extensions built with CPython ABI into PyPy builds as their metadata have not been patched. Solution in this case is to hotfix the metadata which is available to only high volume conda channel or to rebuild those packages with the new python packages and mark the older ones as broken.

Using the newer packages will rerender the following requirement to add a dependency on python_abi. For eg,

 
  (requirements  :     host  :      -   python   3.6     run  :      -   python      

is rendered as,

 
  (requirements  :     host  :      -   python 3.6. (h9d8adfe _) (cpython)    run  :      -   python>=3.6,      -   python_abi 3.6 _cp 64 m      

whereas,

 
  (requirements  :     host  :      -   python 3.6 _ 64 _ pypy     run  :      -   python      

is rendered as,

 
  (requirements  :     host  :      -   python 3.6.9 0 _ 90 _ pypy     run  :      -   python>=3.6,      -   python_abi 3.6 _pypy  (_ pp)      

Note that the PyPy ABI tag has pp at the end which indicates that the ABI is stable only for PyPy3.6 7.3.x series.

This opens up the possibility of adding debug builds of python and building extension packages using the Python Debug ABI.

Discussion on the PyPy builds can be found in the issue conda-forge / conda-forge.github.io #

) Isuru Fernando (@ isuruf)

    

      

(Read More)

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Google Trends Data Rings a Warning – The Stock Market Crash Isn't Over, Crypto Coins News

Google Trends Data Rings a Warning – The Stock Market Crash Isn't Over, Crypto Coins News

Tale of OpenBSD secure memory allocator internals – malloc (3), Hacker News