After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696648 - [patch] Use distutils.sysconfig to retrieve the python include path with PyPy
[patch] Use distutils.sysconfig to retrieve the python include path with PyPy
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-26 15:20 UTC by Christoph Reiter (lazka)
Modified: 2013-04-04 08:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch-v1 (1.14 KB, patch)
2013-03-26 15:20 UTC, Christoph Reiter (lazka)
none Details | Review
patch-v2 (python.m4 change) (1.17 KB, patch)
2013-04-04 07:07 UTC, Christoph Reiter (lazka)
committed Details | Review
AM_CHECK_PYTHON_LIBS patch (1.08 KB, patch)
2013-04-04 08:12 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2013-03-26 15:20:28 UTC
Created attachment 239872 [details] [review]
patch-v1

python.m4 fails with PyPy. This uses distutils to find the right path (in case of PyPy) before the macro, so the macro search logic gets skipped.

It might be that using distutils also works with CPython and this can be moved into python.m4... but I wanted to keep the change small.
Comment 1 Martin Pitt 2013-04-04 04:46:29 UTC
Wouldn't it be better to entirely replace the sys.exec_prefix based detection in m4/python.m4 with the "ask distutils" approach? Or is distutils not available with cpython?
Comment 2 Christoph Reiter (lazka) 2013-04-04 05:17:34 UTC
Distutils is included with CPython.

I'll look into it then.
Comment 3 Christoph Reiter (lazka) 2013-04-04 07:07:57 UTC
Created attachment 240570 [details] [review]
patch-v2 (python.m4 change)
Comment 4 Martin Pitt 2013-04-04 07:27:35 UTC
Ah, I just realized that this will break on Ubuntu, as the paths are slightly different due to multi-arching. So I'll combine the PyPy specific approach of your first patch with putting everything into python.m4 like in your second patch.

Thanks!
Comment 5 Martin Pitt 2013-04-04 07:34:35 UTC
Comment on attachment 240570 [details] [review]
patch-v2 (python.m4 change)

Nevermind, this works fine. it prefers $PYTHON_CONFIG if present.

Thanks!
Comment 6 Dieter Verfaillie 2013-04-04 07:45:26 UTC
Have only looked quickly, but does attachment #240570 [details] not
break AM_CHECK_PYTHON_LIBS which requires AM_CHECK_PYTHON_HEADERS
to fill in ${py_prefix} (which the patch removes)?
Maybe AM_CHECK_PYTHON_LIBS needs a simple sprinkling of
'distutils.sysconfig.PREFIX' too?

Also, if I'm not mistaken line 78 (py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"`)
in AM_CHECK_PYTHON_LIBS can be removed, I'm suspecting a
copy/paste error on my part, sorry...
Comment 7 Christoph Reiter (lazka) 2013-04-04 08:12:16 UTC
Created attachment 240574 [details] [review]
AM_CHECK_PYTHON_LIBS patch

Good catch. What about this fix?
Comment 8 Dieter Verfaillie 2013-04-04 08:15:58 UTC
Review of attachment 240574 [details] [review]:

(In reply to comment #7)
> Good catch. What about this fix?

Looks good to me, thanks!
Comment 9 Martin Pitt 2013-04-04 08:23:45 UTC
Comment on attachment 240574 [details] [review]
AM_CHECK_PYTHON_LIBS patch

Thanks!