Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #734 from lcorbasson/update-python-versions
Update Python versions, test on more platforms and fix Travis CI issues
- Loading branch information
Showing
14 changed files
with
306 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,133 @@ | ||
language: python | ||
os: linux | ||
python: | ||
- "2.7" | ||
- "3.4" | ||
- "3.5" | ||
- "3.8" | ||
- "3.7" | ||
- "3.6" | ||
- "pypy-5.3.1" | ||
- "3.5" | ||
- "2.7" | ||
- "pypy3" | ||
- "pypy3.5-6.0" | ||
- "pypy3.5-7.0" | ||
- "pypy3.6-7.0.0" | ||
- "pypy" | ||
- "pypy2.7-6.0" | ||
- "pypy2.7-7.0.0" | ||
jobs: | ||
include: | ||
- os: osx | ||
python: "3.7" | ||
osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4 | ||
language: shell # 'language: python' is an error on Travis CI macOS | ||
before_install: | ||
- brew install pkg-config | ||
- brew install icu4c | ||
- export PATH="$PATH:/usr/local/opt/icu4c/bin" | ||
- export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" | ||
- which uconv | ||
- uconv -V | ||
- export ICU_VERSION="$(uconv -V | sed -e 's,.*\<ICU \([^ ]*\).*,\1,')" | ||
- locale -a | ||
- python3 -m pip install --upgrade pip | ||
- python3 -m pip install --upgrade virtualenv | ||
- virtualenv -p python3 --system-site-packages "$HOME/venv" | ||
- source "$HOME/venv/bin/activate" | ||
- CFLAGS="-O0" STATIC_DEPS=true python3 -m pip install lxml | ||
- python3 --version | ||
- python --version | ||
env: | ||
- HOMEBREW_NO_INSTALL_CLEANUP=1 | ||
- HOMEBREW_NO_ANALYTICS=1 | ||
before_cache: | ||
- rm -f "$HOME/Library/Caches/pip/log/debug.log" | ||
cache: | ||
directories: | ||
- "$HOME/Library/Caches/pip" | ||
- os: windows # Windows 10.0.17134 N/A Build 17134 | ||
python: "3.8" | ||
language: shell # 'language: python' is an error on Travis CI Windows | ||
before_install: | ||
- choco install pkgconfiglite | ||
- git clone https://github.com/Microsoft/vcpkg.git | ||
- pushd vcpkg | ||
- ./bootstrap-vcpkg.bat -disableMetrics | ||
- ./vcpkg integrate install | ||
- ./vcpkg install icu:x64-windows | ||
- cp buildtrees/icu/x64-windows-rel/bin/uconv.exe installed/x64-windows/bin/ | ||
- popd | ||
- export PATH="$PATH:$PWD/vcpkg/installed/x64-windows/bin" | ||
- export LD_LIBRARY_PATH="$PATH:$PWD/vcpkg/installed/x64-windows/bin:$PWD/vcpkg/installed/x64-windows/lib" | ||
- export PYICU_INCLUDES="$PWD/vcpkg/installed/x64-windows/include" | ||
- export PYICU_LFLAGS='/LIBPATH:$PWD/vcpkg/installed/x64-windows/bin' | ||
# - wget -q https://github.com/unicode-org/icu/releases/download/release-65-1/icu4c-65_1-Win64-MSVC2017.zip -O icu4c.zip | ||
# - unzip -q icu4c.zip -d icu4c | ||
# - export PATH="$PATH:$PWD/icu4c/bin64" | ||
# - export LD_LIBRARY_PATH="$PATH:$PWD/icu4c/bin64:$PWD/icu4c/lib64" | ||
# - export PYICU_INCLUDES="$PWD/icu4c/include" | ||
# - export PYICU_LFLAGS='/LIBPATH:$PWD/icu4c/lib64' | ||
- uconv -V | ||
- export ICU_VERSION="$(uconv -V | sed -e 's,.*\<ICU \([^ ]*\).*,\1,')" | ||
- locale -a | ||
- choco install python --version 3.8.0 | ||
- python -m pip install --upgrade pip | ||
- python --version | ||
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH | ||
# allow failure on OSes other than Linux | ||
# and on PyPy, which regularly segfaults on Travis CI | ||
# because of resource exhaustion | ||
allow_failures: | ||
- os: osx | ||
- os: windows | ||
- python: "pypy3" | ||
- python: "pypy3.5-6.0" | ||
- python: "pypy3.5-7.0" | ||
- python: "pypy3.6-7.0.0" | ||
- python: "pypy" | ||
- python: "pypy2.7-6.0" | ||
- python: "pypy2.7-7.0.0" | ||
fast_finish: true | ||
# command to install dependencies | ||
install: | ||
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip install -r requirements-py3.txt; else pip install -r requirements-py2.txt; fi | ||
- > | ||
if [[ "$TRAVIS_PYTHON_VERSION" == "2"* ]] || [[ "$TRAVIS_PYTHON_VERSION" == "pypy"* ]] && [[ "$TRAVIS_PYTHON_VERSION" != "pypy3"* ]]; then | ||
pip install -r requirements-py2.txt; | ||
else | ||
pip3 install -r requirements-py3.txt; | ||
fi | ||
# command to run tests | ||
script: nosetests tests | ||
sudo: false | ||
script: | ||
# pypy2 and pypy3 segfault on Travis CI if running all tests in the same process | ||
- > | ||
if [[ "$TRAVIS_PYTHON_VERSION" == "pypy" ]]; then | ||
nosetests --collect-only -v tests 2>&1 \ | ||
| grep -e 'ok$' \ | ||
| while read func class etc; do | ||
class="${class//[()]/}"; | ||
class="${class%.*}:${class##*.}"; | ||
nosetests -v "$class.$func"; | ||
done || ( echo "$s" >> "script-failures.log" ); | ||
if [ -e "script-failures.log" ]; then | ||
exit 1; | ||
fi; | ||
elif [[ "$TRAVIS_PYTHON_VERSION" == "pypy3" ]]; then | ||
find tests -type f -name "*.py" | while read s; do | ||
( [ ! -x "$s" ] && nosetests --no-byte-compile -s -v "$s" ) || ( echo "$s" >> "script-failures.log" ); | ||
done; | ||
if [ -e "script-failures.log" ]; then | ||
exit 1; | ||
fi; | ||
else | ||
nosetests --no-byte-compile --with-coverage tests; | ||
fi | ||
after_failure: | ||
- > | ||
if [ -e "script-failures.log" ]; then | ||
echo $(cat "script-failures.log"); | ||
fi | ||
addons: | ||
apt: | ||
packages: | ||
- language-pack-fr | ||
- language-pack-de | ||
- language-pack-ko | ||
- pkg-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.