2013-06-27 8 views
5

Ich versuche, ein travis Continuous Build-System mit meinem Projekt einzurichten, die in ihren Abhängigkeiten numpy, scipy und matplotlib hat. Ich ziele auf Python 3.3.Travis-ci Matplotlib-Abhängigkeit und Python3

In meinem .travis.yml Skript installiere ich numpy und scipy von apt-get, sowie (um sicher zu sein) von pip (nur numpy). Leider sagt matplotlib build immer noch, dass numpy bei Deps fehlt. Ich habe fast alle im WEB gefundenen Methoden ausprobiert, aber die meisten funktionieren nicht (sie sind veraltet, denke ich).

language: python                                                      
python:                                                        
    - "3.3"                                                       
install:                                                        
    - pip install numpy                                                    
    - pip install colorama 
    - pip install matplotlib 
    - pip install nose                                                     
script: nosetests                                                     
virtualenv:                                                       
    system_site_packages: true                                                   
before_install:                                                      
    - sudo apt-get update -qq                                                   
    - sudo apt-get install -qq python3-numpy python3-scipy 

Unten ist der interessante Teil von Travis Log. Es sagt, dass die Abhängigkeit nicht erfüllt ist, aber der Befehl pip kann numpy bereits von apt installiert sehen.

BUILDING MATPLOTLIB 
      matplotlib: 1.2.0 
       python: 3.3.2 (default, May 16 2013, 18:32:41) [GCC 4.6.3] 
       platform: linux 

REQUIRED DEPENDENCIES 
       numpy: no 
         * You must install numpy 1.4 or later to build 
         * matplotlib. 
Complete output from command python setup.py egg_info: 
basedirlist is: ['/usr/local', '/usr']                                        
+0

Werfen Sie einen Blick auf die scipy travis.yml; Sie haben definitiv 'numpy' installiert: https://github.com/scipy/scipy/blob/master/.travis.yml –

Antwort

1

Wenn Sie nicht brauchen, gegen mehrere Python-Versionen zu testen, ist der einfachste Trick travis, der Ihre Sprache c ist zu sagen, und dann alles installieren von apt-get. Dies löst alle Probleme mit system_site_packages und virtualenv.

Diese Bibliothek zum Beispiel verwendet travis-ci für die Prüfung und hängt von den vollen scipy Stapeln (numpy, scipy, matplotlib, pytables, pandas, etc), die über apt mit language=c installiert ist.

https://github.com/rmcgibbo/mdtraj/blob/master/.travis.yml

0

Apt-get, Robert McGibbon Vorschlag ist offenbar immer noch recht langsam.

Hier ist an approach from Dan Balchard mit Miniconda, die Matplotlib und den Rest des Scipy-Stacks auf Ihrer Travis CI-Testmaschine vorinstalliert. Hier ist die vollständige .travis.yml Datei:

language: python 
python: 
    - 2.7 
    - 3.3 
notifications: 
    email: false 

# Setup anaconda 
before_install: 
    - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh 
    - chmod +x miniconda.sh 
    - ./miniconda.sh -b 
    - export PATH=/home/travis/miniconda/bin:$PATH 
    - conda update --yes conda 
    # The next couple lines fix a crash with multiprocessing on Travis and are not specific to using Miniconda 
    - sudo rm -rf /dev/shm 
    - sudo ln -s /run/shm /dev/shm 
# Install packages 
install: 
    - conda install --yes python=$TRAVIS_PYTHON_VERSION atlas numpy scipy matplotlib nose dateutil pandas statsmodels 
    # Coverage packages are on my binstar channel 
    - conda install --yes -c dan_blanchard python-coveralls nose-cov 
    - python setup.py install 

# Run test 
script: 
    - nosetests --with-cov --cov YOUR_PACKAGE_NAME_HERE --cov-config .coveragerc --logging-level=INFO 

# Calculate coverage 
after_success: 
    - coveralls --config_file .coveragerc