Travis ci matplotlib依赖项和Python 3
我正试图用我的项目建立一个travis连续构建系统,它的依赖项中有numpy、scipy和matplotlib。我的目标是python 3.3 在我的Travis ci matplotlib依赖项和Python 3,python,numpy,python-3.x,matplotlib,travis-ci,Python,Numpy,Python 3.x,Matplotlib,Travis Ci,我正试图用我的项目建立一个travis连续构建系统,它的依赖项中有numpy、scipy和matplotlib。我的目标是python 3.3 在我的.travis.yml脚本中,我正在从apt get安装numpy和scipy,当然也从pip(仅numpy)安装。不幸的是,matplotlib build仍然表示DEP中缺少numpy。我尝试了网络上几乎所有的方法,但大多数都不起作用(我认为它们已经过时了) 下面是特拉维斯日志的有趣部分。它说依赖性并没有得到满足,但pip命令可以看到已经从ap
.travis.yml
脚本中,我正在从apt get安装numpy和scipy,当然也从pip(仅numpy)安装。不幸的是,matplotlib build仍然表示DEP中缺少numpy。我尝试了网络上几乎所有的方法,但大多数都不起作用(我认为它们已经过时了)
下面是特拉维斯日志的有趣部分。它说依赖性并没有得到满足,但pip命令可以看到已经从apt安装了numpy
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']
如果您不需要针对多个python版本进行测试,最简单的技巧是告诉travis您的语言是
c
,然后安装apt-get中的所有内容。这解决了system_site_软件包和virtualenv的所有问题
例如,该库使用travis ci进行测试,并依赖于完整的scipy堆栈(numpy、scipy、matplotlib、pytables、pandas等),该堆栈通过apt
和language=c
安装
罗伯特·麦吉本(Robert McGibbon)的建议是,Apt get显然仍然相当缓慢 这里使用的是Miniconda,它将在Travis CI测试机器上预安装matplotlib和其他scipy堆栈。这是完整的
.travis.yml
文件:
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
看看scipy travis.yml;他们肯定安装了
numpy
:
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