我有一个Python包,其编译扩展依赖于numpy
。我想使用Linux和OS X以及64位和32位架构在Travis CI上测试软件包。由于其他一切都是痛苦或非常慢,我已经使用miniconda。这适用于64位,但我被困在32位,请参阅下面的警告:
WARNING:
Your system is x86_64, but you are trying to install an x86 (32-bit)
version of Miniconda2. Unless you have the necessary 32-bit libraries
installed, Miniconda2 will not work.
We STRONGLY recommend installing the x86_64 version of Miniconda2 on
an x86_64 system.
Are sure you want to continue the installation? [yes|no]
[no] >>>
所以我的问题有两部分:
apt
或brew
个库?这是我的.travis.yml
文件:
language: python
sudo: false
matrix:
include:
- os: osx
language: generic
env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="32"
- os: osx
language: generic
env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="64"
- os: osx
language: generic
env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="32"
- os: osx
language: generic
env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="64"
- os: osx
language: generic
env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="32"
- os: osx
language: generic
env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="64"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="32"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="64"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="32"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="64"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="32"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="64"
before_install:
- source "ci/travis/conda_setup.sh"
install:
- source "ci/travis/conda_install.sh"
script:
- python -c "import numpy as np;print(np.version.version)"
conda_setup.sh
脚本的内容:
#!/usr/bin/env bash
set -ev # exit on first error, print each command
MINICONDA_URL="http://repo.continuum.io/miniconda"
if [ ${PYTHON_VERSION:0:1} == "2" ]; then
MINICONDA="Miniconda2"
else
MINICONDA="Miniconda3"
fi
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
MINICONDA_OS="MacOSX"
else
MINICONDA_OS="Linux"
fi
if [ ${PYTHON_ARCH} == "64" ]; then
URL="${MINICONDA_URL}/${MINICONDA}-latest-${MINICONDA_OS}-x86_64.sh"
else
URL="${MINICONDA_URL}/${MINICONDA}-latest-${MINICONDA_OS}-x86.sh"
fi
travis_retry wget "${URL}" -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b -p "${HOME}/miniconda"
export PATH="${HOME}/miniconda/bin:${PATH}"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda_install.sh
脚本:
#!/usr/bin/env bash
set -ev # exit on first error, print each command
if [ ${PYTHON_ARCH} == "32" ]; then
set CONDA_FORCE_32BIT=1
fi
conda create -q -n testenv ${DEPS} python=${PYTHON_VERSION}
source activate testenv
conda info -a
conda list
感谢您的任何建议。