I am trying to setup a project with Travis CI. Project also uses pygame. I had multiple attempts to set it up - but it seem to be failing.

The closest I got was following:

.travis.yml:

language: python
python:
    - "2.7"
install:
    - pip install -r requirements.txt
before_install:
    - sudo apt-get update
    - sudo apt-get build-dep python-pygame
    - sudo apt-get install mercurial
script:
    - nosetests tests/*.py

requirements.txt:

Twisted==13.2.0
coverage==3.7.1
nose==1.3.0
hg+http://bitbucket.org/pygame/pygame
wsgiref==0.1.2
zope.interface==4.1.0

Travis CI downloads the pygame package, but the installation hangs:

https://travis-ci.org/ruslanosipov/space/builds/19142164#L390

Any hint?

有帮助吗?

解决方案

Solution was as follows:

Create separate .travis_requirements.txt without the pygame.

Change .travis.yml as follows:

language: python
python:
    - "2.7"
before_install:
    - sudo apt-get update -qq
    - sudo apt-get build-dep -qq python-pygame
    - sudo apt-get install -qq python-pygame
install:
    - pip install -r .travis_requirements.txt
script:
    - nosetests tests/*.py
virtualenv:
    system_site_packages: true

Main change is using "system_site_packages" setting and installing pygame via apt-get.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top