Fix CI, prepare test on Python 3.9 beta (#2233)

* Test on Python 3.9 beta
* Pin Sphinx
* Newer version of PyPy
This commit is contained in:
Henry Schreiner 2020-05-31 00:29:30 -04:00 committed by GitHub
parent a54eab92d2
commit a38e5331d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 16 deletions

View File

@ -17,7 +17,8 @@ matrix:
- $PY_CMD -m pip install --user --upgrade pip wheel setuptools - $PY_CMD -m pip install --user --upgrade pip wheel setuptools
install: install:
# breathe 4.14 doesn't work with bit fields. See https://github.com/michaeljones/breathe/issues/462 # breathe 4.14 doesn't work with bit fields. See https://github.com/michaeljones/breathe/issues/462
- $PY_CMD -m pip install --user --upgrade sphinx sphinx_rtd_theme breathe==4.13.1 flake8 pep8-naming pytest # Latest breathe + Sphinx causes warnings and errors out
- $PY_CMD -m pip install --user --upgrade "sphinx<3" sphinx_rtd_theme breathe==4.13.1 flake8 pep8-naming pytest
- curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz - curl -fsSL https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.linux.bin.tar.gz/download | tar xz
- export PATH="$PWD/doxygen-1.8.15/bin:$PATH" - export PATH="$PWD/doxygen-1.8.15/bin:$PATH"
script: script:
@ -109,7 +110,7 @@ matrix:
- os: linux - os: linux
dist: xenial dist: xenial
env: PYTHON=3.8 CPP=17 GCC=7 env: PYTHON=3.8 CPP=17 GCC=7
name: Python 3.8, c++17, gcc 7 (w/o numpy/scipy) # TODO: update build name when the numpy/scipy wheels become available name: Python 3.8, c++17, gcc 7
addons: addons:
apt: apt:
sources: sources:
@ -119,12 +120,21 @@ matrix:
- g++-7 - g++-7
- python3.8-dev - python3.8-dev
- python3.8-venv - python3.8-venv
# Currently there is no numpy/scipy wheels available for python3.8 - os: linux
# TODO: remove next before_install, install and script clause when the wheels become available dist: xenial
before_install: env: PYTHON=3.9 CPP=17 GCC=7
- pyenv global $(pyenv whence 2to3) # activate all python versions name: Python 3.9 beta, c++17, gcc 7 (w/o numpy/scipy) # TODO: update build name when the numpy/scipy wheels become available
- PY_CMD=python3 addons:
- $PY_CMD -m pip install --user --upgrade pip wheel setuptools apt:
sources:
- deadsnakes
- ubuntu-toolchain-r-test
packages:
- g++-7
- python3.9-dev
- python3.9-venv
# Currently there are no numpy/scipy wheels available for python3.9
# TODO: remove next install and script clause when the wheels become available
install: install:
- $PY_CMD -m pip install --user --upgrade pytest - $PY_CMD -m pip install --user --upgrade pytest
script: script:
@ -143,14 +153,25 @@ matrix:
# Test a PyPy 2.7 build # Test a PyPy 2.7 build
- os: linux - os: linux
dist: trusty dist: trusty
env: PYPY=5.8 PYTHON=2.7 CPP=11 GCC=4.8 env: PYPY=7.3.1 PYTHON=2.7 CPP=11 GCC=4.8
name: PyPy 5.8, Python 2.7, c++11, gcc 4.8 name: PyPy 7.3, Python 2.7, c++11, gcc 4.8
addons: addons:
apt: apt:
packages: packages:
- libblas-dev - libblas-dev
- liblapack-dev - liblapack-dev
- gfortran - gfortran
- os: linux
dist: xenial
env: PYPY=7.3.1 PYTHON=3.6 CPP=11 GCC=5
name: PyPy 7.3, Python 3.6, c++11, gcc 5
addons:
apt:
packages:
- libblas-dev
- liblapack-dev
- gfortran
- g++-5
# Build in 32-bit mode and tests against the CMake-installed version # Build in 32-bit mode and tests against the CMake-installed version
- os: linux - os: linux
dist: trusty dist: trusty
@ -170,6 +191,10 @@ matrix:
cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON
make pytest -j 2" make pytest -j 2"
set +ex set +ex
allow_failures:
- name: PyPy 7.3, Python 2.7, c++11, gcc 4.8
- name: PyPy 7.3, Python 3.6, c++11, gcc 5
- name: Python 3.9 beta, c++17, gcc 7 (w/o numpy/scipy)
cache: cache:
directories: directories:
- $HOME/.local/bin - $HOME/.local/bin
@ -211,9 +236,9 @@ before_install:
SCRIPT_RUN_PREFIX="docker exec --tty $containerid" SCRIPT_RUN_PREFIX="docker exec --tty $containerid"
$SCRIPT_RUN_PREFIX sh -c 'for s in 0 15; do sleep $s; apt-get update && apt-get -qy dist-upgrade && break; done' $SCRIPT_RUN_PREFIX sh -c 'for s in 0 15; do sleep $s; apt-get update && apt-get -qy dist-upgrade && break; done'
else else
if [ "$PYPY" = "5.8" ]; then if [ -n "$PYPY" ]; then
curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux64.tar.bz2 | tar xj curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy$PYTHON-v$PYPY-linux64.tar.bz2 | tar xj
PY_CMD=$(echo `pwd`/pypy2-v5.8.0-linux64/bin/pypy) PY_CMD=$(echo `pwd`/pypy$PYTHON-v$PYPY-linux64/bin/pypy$PY)
CMAKE_EXTRA_ARGS+=" -DPYTHON_EXECUTABLE:FILEPATH=$PY_CMD" CMAKE_EXTRA_ARGS+=" -DPYTHON_EXECUTABLE:FILEPATH=$PY_CMD"
else else
PY_CMD=python$PYTHON PY_CMD=python$PYTHON
@ -255,11 +280,12 @@ install:
export NPY_NUM_BUILD_JOBS=2 export NPY_NUM_BUILD_JOBS=2
echo "Installing pytest, numpy, scipy..." echo "Installing pytest, numpy, scipy..."
local PIP_CMD="" local PIP_CMD=""
if [ -n $PYPY ]; then if [ -n "$PYPY" ]; then
# For expediency, install only versions that are available on the extra index. # For expediency, install only versions that are available on the extra index.
travis_wait 30 \ travis_wait 30 \
$PY_CMD -m pip install --user --upgrade --extra-index-url https://imaginary.ca/trusty-pypi \ $PY_CMD -m pip install --user --upgrade --extra-index-url https://antocuni.github.io/pypy-wheels/manylinux2010 \
pytest numpy==1.15.4 scipy==1.2.0 numpy scipy
$PY_CMD -m pip install --user --upgrade pytest
else else
$PY_CMD -m pip install --user --upgrade pytest numpy scipy $PY_CMD -m pip install --user --upgrade pytest numpy scipy
fi fi

View File

@ -67,6 +67,7 @@ def test_vector_int():
v_int2.clear() v_int2.clear()
assert len(v_int2) == 0 assert len(v_int2) == 0
# related to the PyPy's buffer protocol. # related to the PyPy's buffer protocol.
@pytest.unsupported_on_pypy @pytest.unsupported_on_pypy
def test_vector_buffer(): def test_vector_buffer():