[pypy-issue] Issue #2182: Expose SOABI (PEP3149) is sysconfig (pypy/pypy)

Stefano Rivera issues-reply at bitbucket.org
Mon Nov 2 17:34:04 EST 2015

New issue 2182: Expose SOABI (PEP3149) is sysconfig

Stefano Rivera:

I'm applying this patch in Debian:

--- a/lib-python/2.7/sysconfig.py
+++ b/lib-python/2.7/sysconfig.py
@@ -524,6 +524,13 @@
             import _osx_support
+        # PyPy:
+        import imp
+        for suffix, mode, type_ in imp.get_suffixes():
+            if type_ == imp.C_EXTENSION:
+                _CONFIG_VARS['SOABI'] = suffix.split('.')[1]
+                break
     if args:
         vals = []
         for name in args:

To Expose SOABI in sysconfig. So that dh_pypy can use it to generate useful dependencies.
See https://bugs.debian.org/803689 for context.

This is the only way to access the soabi value, that's documented in the PEP. It looks like it was left out of https://bitbucket.org/pypy/pypy/commits/6dde6de7fec4

sysconfig is in general very incomplete hacky in PyPy, and needs hacks like this. I just want a second set of eyes to say this is sane to commit.

More information about the pypy-issue mailing list