Patchwork setup.py: do not install c extensions on pypy

login
register
mail settings
Submitter Joan Massich
Date Feb. 22, 2015, 2:49 p.m.
Message ID <38aba71094d3f8fb7823.1424616570@localhost>
Download mbox | patch
Permalink /patch/7817/
State Accepted
Headers show

Comments

Joan Massich - Feb. 22, 2015, 2:49 p.m.
# HG changeset patch
# User Joan Massich <mailsik@gmail.com>
# Date 1424616036 -3600
#      Sun Feb 22 15:40:36 2015 +0100
# Node ID 38aba71094d3f8fb7823731cce21cc6bbc784f74
# Parent  e7785573a4af258101d0cc0b0947a6de65273096
setup.py: do not install c extensions on pypy

These extensions are slower on pypy because pypy has a JIT compiler.
And also, they often do not compile (it depends on the pypy configuration).
Pierre-Yves David - March 2, 2015, 9:02 p.m.
On 02/22/2015 02:49 PM, Joan Massich wrote:
> # HG changeset patch
> # User Joan Massich <mailsik@gmail.com>
> # Date 1424616036 -3600
> #      Sun Feb 22 15:40:36 2015 +0100
> # Node ID 38aba71094d3f8fb7823731cce21cc6bbc784f74
> # Parent  e7785573a4af258101d0cc0b0947a6de65273096
> setup.py: do not install c extensions on pypy

Sounds legit; install still work; Pushed to the clowncopter.

Patch

diff -r e7785573a4af -r 38aba71094d3 setup.py
--- a/setup.py	Wed Feb 18 16:45:16 2015 -0800
+++ b/setup.py	Sun Feb 22 15:40:36 2015 +0100
@@ -63,6 +63,8 @@ 
         raise SystemExit(
             "Couldn't import standard bz2 (incomplete Python install).")
 
+ispypy = "PyPy" in sys.version
+
 import os, stat, subprocess, time
 import re
 import shutil
@@ -276,7 +278,7 @@ 
 
 
 class hgdist(Distribution):
-    pure = 0
+    pure = ispypy
 
     global_options = Distribution.global_options + \
                      [('pure', None, "use pure (slow) Python "