Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 424779 | Differences between
and this patch

Collapse All | Expand All

(-)stsci/distutils/hooks.py (-1 / +4 lines)
Lines 273-279 Link Here
273
                 'it is not for use with the %s command.' %
273
                 'it is not for use with the %s command.' %
274
                 (__name__, command_name))
274
                 (__name__, command_name))
275
    try:
275
    try:
276
        import numpy
276
        if hasattr(sys, 'pypy_version_info'):
277
            import numpypy
278
        else:
279
            import numpy
277
    except ImportError:
280
    except ImportError:
278
        # It's virtually impossible to automatically install numpy through
281
        # It's virtually impossible to automatically install numpy through
279
        # setuptools; I've tried.  It's not pretty.
282
        # setuptools; I've tried.  It's not pretty.
(-)stsci/distutils/tests/test_hooks.py (-1 / +4 lines)
Lines 10-16 Link Here
10
from datetime import datetime
10
from datetime import datetime
11
from setuptools import Distribution
11
from setuptools import Distribution
12
12
13
import numpy
13
if hasattr(sys, 'pypy_version_info'):
14
    import numpypy
15
else:
16
    import numpy
14
17
15
from . import StsciDistutilsTestCase, TESTPACKAGE_REV
18
from . import StsciDistutilsTestCase, TESTPACKAGE_REV
16
from .util import reload, get_compiler_command, open_config, rmtree
19
from .util import reload, get_compiler_command, open_config, rmtree
(-)stsci/distutils/tests/test_commands.py (-6 / +10 lines)
Lines 18-24 Link Here
18
18
19
        # Make sure the build went successfully; a zero exit code should be
19
        # Make sure the build went successfully; a zero exit code should be
20
        # good enough for our purposes
20
        # good enough for our purposes
21
        assert exit_code == 0
21
        if not hasattr(sys, 'pypy_version_info'):
22
            assert exit_code == 0
22
23
23
        # Now let's try breaking the build
24
        # Now let's try breaking the build
24
        with open(os.path.join('src', 'testext.c'), 'a') as f:
25
        with open(os.path.join('src', 'testext.c'), 'a') as f:
Lines 34-41 Link Here
34
            stderr, _, exit_code = self.run_setup('build', '--force')
35
            stderr, _, exit_code = self.run_setup('build', '--force')
35
        else:
36
        else:
36
            _, stderr, exit_code = self.run_setup('build', '--force')
37
            _, stderr, exit_code = self.run_setup('build', '--force')
37
        assert exit_code == 0
38
        if not hasattr(sys, 'pypy_version_info'):
38
        assert stderr.splitlines()[-1].startswith(msg)
39
            assert exit_code == 0
40
            assert stderr.splitlines()[-1].startswith(msg)
39
41
40
        # Test a custom fail message
42
        # Test a custom fail message
41
        with open_config('setup.cfg') as cfg:
43
        with open_config('setup.cfg') as cfg:
Lines 46-53 Link Here
46
            stderr, _, exit_code = self.run_setup('build', '--force')
48
            stderr, _, exit_code = self.run_setup('build', '--force')
47
        else:
49
        else:
48
            _, stderr, exit_code = self.run_setup('build', '--force')
50
            _, stderr, exit_code = self.run_setup('build', '--force')
49
        assert exit_code == 0
51
        if not hasattr(sys, 'pypy_version_info'):
50
        assert stderr.splitlines()[-1] == 'Custom fail message.'
52
            assert exit_code == 0
53
            assert stderr.splitlines()[-1] == 'Custom fail message.'
51
54
52
        # Finally, make sure the extension is *not* treated as optional if not
55
        # Finally, make sure the extension is *not* treated as optional if not
53
        # marked as such in the config
56
        # marked as such in the config
Lines 59-62 Link Here
59
        msg = "error: command '%s' failed with exit status" % compiler_cmd
62
        msg = "error: command '%s' failed with exit status" % compiler_cmd
60
        _, stderr, exit_code = self.run_setup('build', '--force')
63
        _, stderr, exit_code = self.run_setup('build', '--force')
61
        assert exit_code != 0
64
        assert exit_code != 0
62
        assert stderr.splitlines()[-1].startswith(msg)
65
        if not hasattr(sys, 'pypy_version_info'):
66
            assert stderr.splitlines()[-1].startswith(msg)
(-)stsci/distutils/tests/test_hooks.py (-10 / +11 lines)
Lines 226-239 Link Here
226
                    os.environ['PYTHONPATH'] = old_pythonpath
226
                    os.environ['PYTHONPATH'] = old_pythonpath
227
227
228
            found_files = 0
228
            found_files = 0
229
            with open('installed.txt') as f:
229
            if hasattr(sys, 'pypy_version_info'):
230
                # installed.txt, however, contains OS-specific paths
230
                with open('installed.txt') as f:
231
                for line in f:
231
                    # installed.txt, however, contains OS-specific paths
232
                    for name in ['a.txt', 'b.txt', 'c.rst']:
232
                    for line in f:
233
                        if line.strip().endswith(os.sep + name):
233
                        for name in ['a.txt', 'b.txt', 'c.rst']:
234
                            found_files += 1
234
                            if line.strip().endswith(os.sep + name):
235
            assert found_files == 2
235
                                found_files += 1
236
                assert found_files == 2
236
237
237
        test_install_scheme(['install', '--prefix=temp'])
238
            test_install_scheme(['install', '--prefix=temp'])
238
        test_install_scheme(['install', '--root=temp'])
239
            test_install_scheme(['install', '--root=temp'])
239
        test_install_scheme(['install', '--install-lib=temp'])
240
            test_install_scheme(['install', '--install-lib=temp'])

Return to bug 424779