[Distutils] binary wheels, linux and ucs2/4

Daniel Holth dholth at gmail.com
Thu Jan 29 19:27:00 CET 2015

On Thu, Jan 29, 2015 at 8:37 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 29 January 2015 at 22:45, Paul Moore <p.f.moore at gmail.com> wrote:
>> On 29 January 2015 at 11:55, Chris Withers <chris at simplistix.co.uk> wrote:
>>> ...but I'm none the wiser. What's the state of play with this?
>> Currently, the tags don't include the UCS setting. "It's being worked
>> on" (as with most other aspects of Linux ABI compatibility).
> It's more accurate to say "we're open to suggestions". My last idea
> (deriving a more specific platform tag from /etc/os-release) was shot
> down for several entirely valid reasons, so there isn't currently a
> concrete proposal on the table.
> I'm pretty sure we're all agreed that the current definition of the
> platform tag in PEP 425 is entirely inadequate for *nix systems other
> than Mac OS X, but a lot of us have other options there to use as a
> workaround or because it's what we were doing anyway (like using
> system packages instead of wheels for our binary distribution).
> So while I'll definitely need to help work out an agreed solution
> before we take the idea of a Fedora specific wheel repo beyond the
> pilot stage, we have no ETA on that at the moment, which means there's
> no guarantee on when I'll get to pushing such an enhancement forward
> myself.
>>> How can we build PyCrypto for Python 2, both UCS2 and UCS4, and have them
>>> both in the same repo and have pip pick the right one?
>> At the moment, you can't, you'll need separate UCS2 and UCS4 repos.
> This could potentially be worked around in pip and setuptools, by
> having them calculate a suitable wheel ABI tag on Python 2.
> If we're on CPython 2.x and sysconfig.get_config_var('SOABI') returns
> None, then we can calculate a synthetic SOABI tag as:
> * the start of the SOABI tag should be "cpython-"
> * the next two digits will be the major/minor of the release (i.e. 26 or 27)
> * the next character will be 'd' if sys.pydebug is set (I'm fairly
> sure, but double check this)
> * we can assume 'm' (for using pymalloc) safely enough
> * the final character will be 'u' if sys.maxunicode == 0x10ffff
> We're not going to add a new kind of ABI variation to Python 2 at this
> stage of its lifecycle, so that calculation should remain valid for as
> long as Python 2 remains in use.

I would be very happy to receive a patch for:


            abi_tag = sysconfig.get_config_vars().get('SOABI', 'none')
            if abi_tag.startswith('cpython-'):
                abi_tag = 'cp' + abi_tag.rsplit('-', 1)[-1]

It would have to have a Python 2 implementation as Nick described.

and this file which controls what can be installed (duplicated in pip)
but also only works on py3:


    abi3s = set()
    import imp
    for suffix in imp.get_suffixes():
        if suffix[0].startswith('.abi'):
            abi3s.add(suffix[0].split('.', 2)[1])

More information about the Distutils-SIG mailing list