Virtualenv (and Tox) broken when run under python<3.6

Clark Boylan cboylan at sapwetik.org
Mon Mar 2 17:12:00 UTC 2020


A recent release of importlib-resources (1.1.0) no longer works on python2.7 or python3.5. The issue is they import typing's ContextManager which didn't exist until python3.6 [0]. This means that python2 jobs and python3.5 jobs are currently unhappy if they need virtualenv. Unfortunately, many of our jobs use tox which uses virtualenv.

One workaround being investigated [1] is to install importlib-resources==1.0.2 which does not try to use typing's ContextManager. If this is confirmed to work we will want to consider adding this change to the base job so that all jobs don't have to fix it separately.

Note the version of python here is the one used to run virtualenv not the version of python being installed into the virtualenv. This means python3.6 running virtualenv to create a python2 virtualenv should be fine. But python3.5 running virtualenv to create a python3.6 env would not be fine.

[0] https://gitlab.com/python-devs/importlib_resources/issues/83
[1] https://review.opendev.org/#/c/710729/

Clark



More information about the openstack-discuss mailing list