aodn / content

Tracks AODN Portal content and configuration issues
0 stars 0 forks source link

aodndata: aatams_sattag unittests failing due to Python 3.5 incompatibility? #496

Closed mhidas closed 2 years ago

mhidas commented 2 years ago

I've just made some minor changes to the moorings pipeline code (https://github.com/aodn/python-aodndata/pull/298). The complete test suite for the package passes under python 3.8, and the majority of tests (including all the moorings ones) pass under 3.5, with one exception:

_________ ERROR collecting test_aodndata/aatams/test_aatams_sattag.py __________
ImportError while importing test module '/var/lib/jenkins/workspace/python-aodndata_build_master/test_aodndata/aatams/test_aatams_sattag.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/.pyenv/versions/3.5.2/lib/python3.5/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test_aodndata/aatams/test_aatams_sattag.py:4: in <module>
    from testfixtures import LogCapture
/home/builder/.local/lib/python3.5/site-packages/testfixtures/__init__.py:13: in <module>
    from testfixtures.comparison import (
/home/builder/.local/lib/python3.5/site-packages/testfixtures/comparison.py:14: in <module>
    from testfixtures.mock import parent_name, mock_call, unittest_mock_call
/home/builder/.local/lib/python3.5/site-packages/testfixtures/mock.py:47: in <module>
    sys.version_info, backport_version
E   ImportError: Please upgrade Python (you have sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0)) or Mock Backport (You have None)

Unfortunately this is preventing the package from being built and deployed on Jenkins: https://build.aodn.org.au/user/mhidas/my-views/view/Pipeline/job/python-aodndata_build/job/master/

mhidas commented 2 years ago

Looks like the problem is with from testfixtures import LogCapture

@evacougnon Would you be able to look into this? @ggalibert We may need a bit of assistance from the Devs for this

mhidas commented 2 years ago

@aodn/devops How far do you reckon we are from switching to Python 3.8 everywhere and forgetting about 3.5?

lbesnard commented 2 years ago

@mhidas This python 3.5.2 limitation is definitely getting annoying, as well as the architecture review holding off any critical and essential changes such as updating the python virtual env.

We're getting to a point where we can't propagate bug fixes and pipeline code changes because of an archaic python version. This probably should be put in the issues repo since it's not a data one.

akashisama commented 2 years ago

@mhidas Once all the nodes are updated to ubuntu 20 it should pretty trivial to clean out any remaining references to 3.5.

As far as pipelines, you should be good to stop testing 3.5 once pipeline box has been updated, which I'd guess will happen in two more iterations, going by the comment in https://github.com/aodn/backlog/issues/3878

mhidas commented 2 years ago

As far as pipelines, you should be good to stop testing 3.5 once pipeline box has been updated

I would probably wait until 10-aws-syd (i.e. prod pipeline node) has been updated to python 3.8

Just to be clear, for POs "pipeline box" means the vagrant box we run locally for pipeline/harvester dev work.

mhidas commented 2 years ago

Fixed by https://github.com/aodn/python-aodndata/pull/301