Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI, pip, and pygame

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?

like image 990
Ruslan Osipov Avatar asked Mar 20 '23 13:03

Ruslan Osipov


1 Answers

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.

like image 89
Ruslan Osipov Avatar answered Apr 06 '23 08:04

Ruslan Osipov