A tox.ini was added to help provide support for python3. Before running tests using tox, be sure to first run make under the root directory.
First draft allows to do this:
- python 3:
tox -e venv, to get a python3 venv in./.venvtox -e py37to exercise all tests with python 3.7
- python 2:
tox -e venv2, to get a python2 venv in./.venv2tox -e py27to exercise all tests with python 2.7
- you can also run
toxto exercise all tests with both python 2.7 and 3.7
Search for TODO python3 to spot which places in code still need attention regarding python3 support.
All tests pass with both python2 and python3, however, a few test cases are disabled currently for python3, spot then with:
grep -r 'reason="TODO python3' .Here's the current list:
scipyv1.3.0 removed some deprecated functions tha vmaf still uses -> need to adapt those before we can upgrade to latest scipy- tests that rely on
randomdo not yield the same results in python2 and python3 - vmaf uses
pickleto serialize some objects, however "pickle is fickle", and a few objects fail to deserialize in python3 YuvReaderneeds to be reviewed, it doesn't work in python3map()andfilter()yield a generator (instead of list) in python3 -> this implies an extra callto_list()throughout the code (search forto_listto find all the spots where this is done). All usages ofmap()/filter()should be reviewed to leverage the speed generators offer
If you run tox, a summary test coverage report will be shown in terminal,
you can also see a full HTML report by looking at .tox/coverage/index.html.
This report can be useful to spot any key part of the code that was not exercised (and thus possibly likely to fail under python3)