Skip to content
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

Travis CI currently broken on some Python 3.5 environments #2779

Closed
nicoddemus opened this issue Sep 13, 2017 · 15 comments
Closed

Travis CI currently broken on some Python 3.5 environments #2779

nicoddemus opened this issue Sep 13, 2017 · 15 comments
Labels
type: infrastructure improvement to development/releases/CI structure

Comments

@nicoddemus
Copy link
Member

nicoddemus commented Sep 13, 2017

Affects all py35-* environments, py35 works fine. So every tox environment which sets basepython = python3.5.

Example failure:

ERROR: Error creating virtualenv. Note that some special characters (e.g. ':' and unicode symbols) in paths are not supported by virtualenv. Error details: InvocationError('Failed to get version_info for python3.5: b"pyenv: python3.5: command not found\\n\\nThe `python3.5\' command exists in these Python versions:\\n  3.5\\n  3.5.3\\n\\n"',)

Extracting the string literal from the message:

pyenv: python3.5: command not found

The `python3.5' command exists in these Python versions:
  3.5
  3.5.3

Which is the same error reported in travis-ci/travis-ci#8363.

Already tried this workaround but it failed with an strange problem:

$ pyenv global system 3.5
install
2.56s$ pip install --upgrade --pre tox
Collecting tox
  Downloading tox-2.8.2-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 5.5MB/s 
Collecting virtualenv>=1.11.2; python_version != "3.2" (from tox)
  Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)
    100% |████████████████████████████████| 1.8MB 898kB/s 
Collecting pluggy<1.0,>=0.3.0 (from tox)
  Downloading pluggy-0.5.2.tar.gz
Requirement already up-to-date: py>=1.4.17 in /home/travis/virtualenv/python3.6.2/lib/python3.6/site-packages (from tox)
Building wheels for collected packages: pluggy
  Running setup.py bdist_wheel for pluggy ... done
  Stored in directory: /home/travis/.cache/pip/wheels/22/b2/db/618ae8dcba2994fb9ebce70ec1c1ab4923df89a77edac7e901
Successfully built pluggy
Installing collected packages: virtualenv, pluggy, tox
Successfully installed pluggy-0.5.2 tox-2.8.2 virtualenv-15.1.0
14.06s$ tox --recreate
GLOB sdist-make: /home/travis/build/nicoddemus/pytest/setup.py
py34 create: /home/travis/build/nicoddemus/pytest/.tox/py34
py34 installdeps: hypothesis>=3.5.2, nose, mock, requests
py34 inst: /home/travis/build/nicoddemus/pytest/.tox/dist/pytest-0.1.dev289+g072f256.zip
py34 installed: certifi==2017.7.27.1,chardet==3.0.4,hypothesis==3.27.0,idna==2.6,mock==2.0.0,nose==1.3.7,pbr==3.1.1,py==1.4.34,pytest==0.1.dev289+g072f256,requests==2.18.4,six==1.10.0,urllib3==1.22
py34 runtests: PYTHONHASHSEED='3527525262'
py34 runtests: commands[0] | pytest --lsof -rfsxX testing
ERROR: /home/travis/build/nicoddemus/pytest/tox.ini:194: requires pytest-2.0, actual pytest-0.1.dev289+g072f256'
ERROR: InvocationError: '/home/travis/build/nicoddemus/pytest/.tox/py34/bin/pytest --lsof -rfsxX testing'
@nicoddemus nicoddemus added the type: infrastructure improvement to development/releases/CI structure label Sep 13, 2017
@obestwalter
Copy link
Member

The error is produced by tox-dev/tox#556 which is supposed to give more meaningful error messages fixing tox-dev/tox#121 - looks like here it covers the actual problem in a different way. Seems hard to report a sensible error from there.

Just to make sure that this is not a tox regression: could you try this with tox 2.7?

@nicoddemus
Copy link
Member Author

Hmmm strange, it fails with:

ERROR: /home/travis/build/nicoddemus/pytest/tox.ini:194: requires pytest-2.0, actual pytest-0.1.dev289+g072f256'
ERROR: InvocationError: '/home/travis/build/nicoddemus/pytest/.tox/py34/bin/pytest --lsof -rfsxX testing'

For some reason the pytest development version is showing up as 0.1.dev289+g072f256...

@nicoddemus
Copy link
Member Author

I don't think it is related to tox, this build run a few days ago with tox-2.8.1 just fine.

Also from the logs in the description of travis-ci/travis-ci#8363, they are using the system's tox so it was not a new tox release which caused the problem.

@obestwalter
Copy link
Member

O.k. thanks - just wanted to be sure, as that error message is 2.8+

@The-Compiler
Copy link
Member

FWIW I had some similar issue with qutebrowser, and specifying python: 3.5 fixed it. However, looks like pytest is already doing that...

@RonnyPfannschmidt
Copy link
Member

@nicoddemus i suspect this is related to having collected enough commits since the last tag, that travis no longer includes a tag in the recent history

without tag, the git describe is wrong

@bittner
Copy link

bittner commented Sep 27, 2017

This problem seems to be related to pyenv. It is mentioned in pyenv/pyenv-virtualenv#202.

@gangefors points out a solution in their comment, which may help. Though I guess Travis should fix this.

@nicoddemus
Copy link
Member Author

Thanks @bittner. Python 3.5 was being used in a few secondary test environments and those were failing, so we got around this by testing those secondary environments with Python 3.6 instead

@nicoddemus
Copy link
Member Author

Fixed by #2785

@ssbarnea
Copy link
Member

ssbarnea commented Oct 4, 2017

@nicoddemus I think we need to reopen this bug, see https://travis-ci.org/pypa/virtualenv/jobs/283366066

I read it clear: it defines python3.6 as needed, but the installed version does not install python3.6 command so tox fails, translating to a total failure.

I bet that over 95% of Python projects are using tox, and we cannot blame tox for not finding the CLI.

@nicoddemus
Copy link
Member Author

@ssbarnea I'm not sure:

Setting environment variables from .travis.yml
$ export TOXENV=python3.6

This should be TOXENV=py36 no?

@bittner
Copy link

bittner commented Oct 5, 2017

See travis-ci/travis-ci#4990 (comment) and travis-ci/travis-ci#8363 (comment) for related follow-ups.

The fix we applied in the behave-django project for that looks like this:

python: 3.6
...
before_install:
  # work around https://github.com/travis-ci/travis-ci/issues/8363
  - pyenv global system 3.5
...

Hope that helps. This is clearly a Travis image issue. They have to set up pyenv correctly.

@ysolovyov
Copy link

ysolovyov commented Oct 5, 2017

this still does not help, i have pyenv global system 3.5 then pip3 install --user artifactory and then i got ImportError: No module named 'artifactory' in travis logs when trying to run my script with python3. image set up as

- os: linux
    dist: trusty
    python: 3.5

@bittner
Copy link

bittner commented Oct 5, 2017

@ysolovyov Does this reflect a problem re "Travis CI currently broken on some Python 3.5 environments"? I'm not sure. (What if you simply use pip for installing? What if you omit the --user option?)

@bittner
Copy link

bittner commented Dec 10, 2017

For everyone landing here and looking for a solution to the Python/Travis issue:

I recommend switching to tox-travis and the native Travis build matrix capabilities. That does away with all the ugly workarounds.

See django-apptemplates for an implementation example (with an extensive build matrix and build stages).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: infrastructure improvement to development/releases/CI structure
Projects
None yet
Development

No branches or pull requests

7 participants