Wishlist: support Windows interpreters in Linux using Wine

Issue #53 on hold
Marius Gedminas
created an issue

Sometimes I find myself debugging cross-platform issues by running my tests under Wine on a Linux box. This works:

wget http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi
wine start python-2.7.3.msi
    # the usual next next next finish make-work
~/.wine/drive_c/Python27/python.exe /usr/share/pyshared/virtualenv.py wenv
wenv/Scripts/pip.exe install nose # etc.
wenv/Scripts/python.exe setup.py develop

I would like to teach tox to do all this for me.

This almost works:

basepython = {env:HOME}/.wine/drive_c/Python27/python.exe

The .virtualenv is created, and it contains working a .tox/wine/Scripts/pip.exe. But then tox adds .tox/wine/bin to $PATH and tries to install stuff using 'pip', which resolves to /usr/bin/pip, and, of course, fails.

Comments (6)

  1. Marius Gedminas reporter

    Stupid idea: how about letting me specify extra commands to run to set up the virtualenv? Something like

    basepython = {env:HOME}/.wine/drive_c/Python27/python.exe
    setupcommands =
        mkdir {envdir}/bin
        ln -s ../Scripts/pip.exe {envdir}/bin/pip
        ln -s ../Scripts/python.exe {envdir}/bin/python
    commands =
        {envdir}/Scripts/nosetests.exe ...
  2. Marius Gedminas reporter

    Alternative stupid idea: determine the value of envbindir not by looking at sys.platform, but by doing an os.listdir(envdir) _after_ the virtualenv has been created, and then checking if you see 'bin' or 'Scripts' in there.

    Then a second os.listdir(envbindir) might be necessary to look for 'pip.exe' and use that instead of just 'pip', to support this Wine use-case.

  3. Log in to comment