Travis CI, pip and pygame

I am trying to set up a project using Travis CI. The project also uses pygame. I have had several attempts to configure it - but it does not seem to work.

The closest I got the 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 freezes:

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

Any clues?

+4
source share
1 answer

The solution was as follows:

Create a separate .travis_requirements.txt without pygame.

Change .travis.ymlas 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

The main change is setting "system_site_packages" and installing pygame via apt-get.

+7
source

Source: https://habr.com/ru/post/1527599/


All Articles