Testing in 32 bit environment
Sometimes, there is a need to debug the library in 32-bit environments. Providers of continuous integration (CI) services (Travis CI, AppVeyor), however, do not support the creation of such kind of instances.
All of the steps below are written in the assumption that you have docker
installed, configured, and running.
Step 1. Get a local copy of scikit-image
, and switch to the branch you are going to test (master
in our case):
cd scikit-image
git checkout v0.14.x
Step 2. Get the following docker
image:
docker pull matthewbrett/trusty:32
docker run --rm -ti -e PYTHON_VERSION=2.7 -v $PWD:/io matthewbrett/trusty:32 /bin/bash
Note: if you have selinux
installed on your host computer (such as on Fedora), you need to disable it before running the docker image otherwise the docker image will not be able to access the directory where you cloned scikit-image
. You could copy it to the docker image, but then you would have to recompile your 32 bit version every time.
Do so with
sudo setenforce 0
Step 3. Install the basic dependencies:
pip install Cython numpy
# Matplotlib i686 wheels are not on pypi
pip install -f https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com matplotlib
Step 4. Install pytest
and pytest-xdist
(to run the tests in parallel), and execute the tests:
pip install pytest pytest-xdist
# Switch to `scikit-image` directory from host
cd /io
# Install `scikit-image` in development mode
pip install -e .
# Run all tests
PYTHONPATH=. pytest skimage
# or a specific test by feeding a path to `pytest.main`
PYTHONPATH=. pytest skimage/morphology/tests/test_grey.py
If you have pytest-xdist
installed, run tests in parallel by adding the arguments -n 4
to the pytest
command.
Thanks to Matthew Brett (https://github.com/matthew-brett) for providing this manual.
https://github.com/scikit-image/scikit-image/issues/2527#issuecomment-283220552