Issue :travis-ci fails for pypy code that imports numpy 1.16.0rc1


#1

See: https://github.com/numpy/numpy/issues/12654

Import of numpy on travis CI fails for numpy-1.16.0rc1-py2.7-linux-x86_64.egg

    import numpy
  File "/home/travis/virtualenv/pypy2.7-5.8.0/site-packages/numpy-1.16.0rc1-py2.7-linux-x86_64.egg/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/home/travis/virtualenv/pypy2.7-5.8.0/site-packages/numpy-1.16.0rc1-py2.7-linux-x86_64.egg/numpy/core/__init__.py", line 16, in <module>
    from . import multiarray
  File "/home/travis/virtualenv/pypy2.7-5.8.0/site-packages/numpy-1.16.0rc1-py2.7-linux-x86_64.egg/numpy/core/multiarray.py", line 44, in <module>
    arange.__module__ = 'numpy'
TypeError: readonly attribute

For example see: https://travis-ci.org/uqfoundation/mystic/jobs/474109434


#2

Use a more recent PyPy; e.g., python: pypy2.7-6.0.


#3

Understood. The above version of pypy is the default one on travis-ci.


#4

You could try something like this to download the latest nightly

mkdir -p pypy3.5-latest
(cd pypy3.5-latest; tar --strip-components=1 -xf ../pypy.tar.bz2)
pypy3.5-latest/bin/pypy3 -mensurepip
pypy3.5-latest/bin/pypy3 -m pip install --upgrade pip setuptools
pypy3.5-latest/bin/pypy3 -m pip install --user cython==0.29.0 pytest pytz
pypy3.5-latest/bin/pypy3 runtests.py -- -rsx --junitxml=junit/test-results.xml --durations 10