-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
circleci build fails when tox specifies multiple python versions, *and sometimes uses the wrong python version* #1
Comments
almost fixedAdding the following command to the
/~https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-local-advanced See builds on CircleCI: https://circleci.com/gh/samstav/circleci-python-sandbox So, if you were only testing python 2.7, 3.3, and 3.4 in your project, you need to tell pyenv which explicit version of python you want them to map to, just for those 3:
Preferably the version of python you need to test is listed here: https://circleci.com/docs/environment#python Otherwise you'll have At the time of writing this, I ssh'd into the circleci build box and ran
My almost-working circle.yml has this: dependencies:
post:
- pyenv local 3.4.3 3.3.3 3.2.5 3.1.5 2.7.10 2.6.8 |
Reopening... turns out this wasn't working quite perfectly. I added some validation to ensure that the python version being used in the tox run is exactly the version expected based on the versions supplied to Go find the latest failure: https://circleci.com/gh/samstav/circleci-python-sandbox/tree/master I get failures for python2.7 (it uses 2.7.6 instead of 2.7.10) and python3.1 (it uses 2.7.6 instead of 3.1.5) |
I think if I could 1) get tox installed outside of the virtualenv created by circle, and/or 2) skip the step in circle's machine configuration which creates that initial virtualenv automatically or 3) if I can't do (2), just run .... Then this would "just work". There is something funky going on in the virtual environment created by pyenv. The versions I set by running |
Fixed this with a tox plugin: |
The error we see from tox in the circle build logs says:
EDIT: Got past this error, now the problem is tox is finding the wrong python binaries to use for a couple of the virtual environments. By this I mean e.g. specifying
py31
with tox results in tox actually using python 2.7.6. Skip to the comment on the latest failure description.This is what appears to be the real issue: pyenv/pyenv-virtualenv#21
I want to come up with a solution that "just works", preferably without hacking up the
tox.ini
file. I have a hunch that if we could adjust the circleci build environment configuration so that it doesn't create thevirtualenv
for us, this would work. We can leave thevirtualenv
creation totox
?The problem definition I have so far:
CircleCI uses
pyenv
and the problem seems to be thevirtualenv
created bypyenv
andtox
not playing nice together. Specifying a python version in the circle.yml means circle will create and enable a pythonvirtualenv
(really a pyenv virtualenv?) of the specified version in your build environment. Apparently there is a difference betweenpyenv virtualenv
andvirtualenv
? Some details on that here:From pyenv/pyenv-virtualenv#21 (comment)
A comment on
pyenv
+tox
:From pyenv/pyenv@17c153b:
http://dtor.com/halfire/2015/01/23/pyenv_tox_can_get_along.html
Here are some folks who may have found a workaround:
coala/coala#653
Possibly related issues:
pyenv/pyenv#34
coala/coala#653
pyenv/pyenv#206
pyenv/pyenv#348
Other links:
The text was updated successfully, but these errors were encountered: