Skip to content

Python 2.6 is no longer supported by the most recent version of virtualenv #19

Description

@kolypto

I'm trying to use this container to test my library against multiple Python versions with tox.

My tox.ini file:

[tox]
envlist=py{26,27,34,35,36,37},pypy
skip_missing_interpreters=True

[testenv]
deps=-rrequirements-dev.txt
commands=
    nosetests {posargs:tests/}
whitelist_externals=make

[testenv:dev]
deps=-rrequirements-dev.txt
usedevelop=True

With this file, I'm running your container like this:

$ docker run --rm -it -v $(realpath .):/src themattrix/tox

It runs nicely: my package is a volume, and tox is running. However, this is the error I get with Python 2.6: tox can't use the modern virtualenv to create a Python 2.6 testing environment:

GLOB sdist-make: /app/setup.py
py26 create: /app/.tox/py26
ERROR: invocation failed (exit code 101), logfile: /app/.tox/py26/log/py26-0.log
ERROR: actionid: py26
msg: getenv
cmdargs: ['/.pyenv/versions/3.7.0/bin/python', '-m', 'virtualenv', '--python', '/.pyenv/shims/python2.6', 'py26']

ERROR: None
ERROR: this script requires Python 2.7 or greater.
Running virtualenv with interpreter /.pyenv/shims/python2.6

ERROR: Error creating virtualenv. Note that some special characters (e.g. ':' and unicode symbols) in paths are not supported by virtualenv. Error details: InvocationError('/.pyenv/versions/3.7.0/bin/python -m virtualenv --python /.pyenv/shims/python2.6 py26 (see /app/.tox/py26/log/py26-0.log)', 101)

This has happened because virtualenv has dropped support for Python 2.6 since 16.0.0.

If I manually install virtualenv==15.2.0, which supports Python 2.6, there's another error:

root@10ac4fa81171:/src# tox -e py26
GLOB sdist-make: /src/setup.py
py26 create: /src/.tox/py26
py26 installdeps: -rrequirements-dev.txt
ERROR: invocation failed (exit code 1), logfile: /src/.tox/py26/log/py26-1.log
ERROR: actionid: py26
msg: getenv
cmdargs: ['/src/.tox/py26/bin/python', '-m', 'pip', 'install', '-rrequirements-dev.txt']

/src/.tox/py26/bin/python: pip is a package and cannot be directly executed

An ugly solution is to add the following line to tox.ini:

install_command=pip install {opts} {packages}(ARGV)

This gives a new error:

tox.exception.ConfigError: ConfigError: 'install_command' must contain '{packages}' substitution

This is a tox bug. Got to update it first:

$ pip install -U tox

And now, finally, the container works fine.
But it does not have to be like that, does it? :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions