You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add travis configuration to run the tests on 32 bit linux #9352
Here is a minimalistic script that could put in build_tools/travis/docker_test.sh:
# This test script is mean to be executed with 'docker run' using one of the manylinux imagesset -e
export PATH=/opt/python/cp36-cp36m/bin:$PATH
pip install numpy scipy cython nose pytest
cd /io
pip install -e .
pytest -l sklearn
This script can used to launch the test with (for 32 bit linux):
docker run --rm -v`pwd`:/io quay.io/pypa/manylinux1_i686 \
bash /io/build_tools/travis/docker_test.sh
This command should be launched from the scikit-learn folder such that the -v flag mount the scikit-learn source folder of the host into the /io folder inside the container.
The above test script should be improved to specify the version number of python, numpy scipy and cython with environment variables defined in .travis.yml (that should be passed via the -e flag of the docker command).
A side note: when running the tests on a 32 bit platform, the string representation of numpy arrays can change, leading to failing doctests such as follows:
/io/sklearn/preprocessing/label.py:214: DocTestFailure
_____________________________________________________________ [doctest] sklearn.preprocessing.label.label_binarize _____________________________________________________________
417
418 Returns
419 -------
420 Y : numpy array or CSR matrix of shape [n_samples, n_classes]
421 Shape will be [n_samples, 1] for binary problems.
422
423 Examples
424 --------
425 >>> from sklearn.preprocessing import label_binarize
426 >>> label_binarize([1, 6], classes=[1, 2, 4, 6])
Expected:
array([[1, 0, 0, 0],
[0, 0, 0, 1]])
Got:
array([[1, 0, 0, 0],
[0, 0, 0, 1]], dtype=int32)
This means that we will need to find a way to configure pytest to not run the doctests in module docstrings. Currently we enable this by default in the pytest section of our setup.cfg.
Maybe one could just delete the setup.cfg file before running the pytest command.
Closed #13715 as I don't have time to contribute to this and this has grown stale. As a note, I had tried Travis, it worked, but then switched to Azure and I could not get it to work. good luck
Activity
ogrisel commentedon Jul 13, 2017
A side note: when running the tests on a 32 bit platform, the string representation of numpy arrays can change, leading to failing doctests such as follows:
This means that we will need to find a way to configure pytest to not run the doctests in module docstrings. Currently we enable this by default in the
pytestsection of oursetup.cfg.Maybe one could just delete the
setup.cfgfile before running thepytestcommand.jrmlhermitte commentedon Jul 14, 2018
I can give this a try (at scipy2018 sprints)
ENH: port fixes from scipy/scipy scikit-learn#9352
jrmlhermitte commentedon Jun 19, 2019
Closed #13715 as I don't have time to contribute to this and this has grown stale. As a note, I had tried Travis, it worked, but then switched to Azure and I could not get it to work. good luck