diff --git a/.travis.yml b/.travis.yml index 7a56c97e5..05f615ce6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ matrix: language: generic sudo: required env: - - PYVER=3.6.1 - osx_image: xcode9.1 + - PYVER=3.6.7 + osx_image: xcode10.2 ## 3.7 is dropped until more mature # - os: osx # language: generic diff --git a/appveyor.yml b/appveyor.yml index f6113610b..5a7a36f40 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,8 @@ cache: install: - git submodule update --init - curl -o mkn.exe -L https://github.com/Dekken/maiken/raw/binaries/win10_x64/mkn.exe - - IF NOT EXIST C:\ProgramData\chocolatey\bin\swig.exe choco install tools\windows\swig.3.0.12.nupkg --yes --limit-output #> $null + - IF NOT EXIST C:\ProgramData\chocolatey\bin\swig.exe choco install tools\windows\swig.4.0.0.nupkg --yes --limit-output #> $null + - cat C:\ProgramData\chocolatey\logs\chocolatey.log - git clone https://github.com/X-DataInitiative/tick_appveyor -b master --depth 1 appveyor build_script: diff --git a/setup.py b/setup.py index 9be1cc3f0..6b7184ede 100644 --- a/setup.py +++ b/setup.py @@ -264,8 +264,6 @@ def add_dir_name(dir_name, filenames): min_swig_opts = ['-py3', '-c++', - '-modern', - '-new_repr', '-Ilib/swig', '-Ilib/include', '-outdir', swig_path.build, @@ -302,9 +300,6 @@ def add_dir_name(dir_name, filenames): else: ## Added -Wall to get all warnings and -Werror to treat them as errors extra_compile_args.append("-Werror") - ## This warning is turned off because SWIG generates files that triggers the - ## warning - extra_compile_args.append("-Wno-uninitialized") # Include directory of module mod = SwigPath(module_dir, extension_name) diff --git a/sh/swig.sh b/sh/swig.sh index bfe6885e5..f9c593a23 100755 --- a/sh/swig.sh +++ b/sh/swig.sh @@ -58,7 +58,7 @@ for P in "${PROFILES[@]}"; do [ -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \ rm "${SWIG_BASE}/$P/${B}_wrap.cpp" [ ! -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \ - $SWIG -python -py3 -c++ -modern -new_repr ${INCS[@]} \ + $SWIG -python -py3 -c++ ${INCS[@]} \ -outdir $DIR/build "$SWIG_C_FLAGS" \ -o ${SWIG_BASE}/$P/${B}_wrap.cpp $IF else @@ -70,7 +70,7 @@ for P in "${PROFILES[@]}"; do [ -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \ rm "${SWIG_BASE}/$P/${B}_wrap.cpp" [ ! -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \ - $SWIG -python -py3 -c++ -modern -new_repr ${INCS[@]} \ + $SWIG -python -py3 -c++ ${INCS[@]} \ -outdir $DIR/build "$SWIG_C_FLAGS" \ -o ${SWIG_BASE}/$P/${B}_wrap.cpp $IF done @@ -80,7 +80,7 @@ for P in "${PROFILES[@]}"; do [ -f "${SWIG_BASE}/$P/${P1}_wrap.cpp" ] && \ rm "${SWIG_BASE}/$P/${P1}_wrap.cpp" [ ! -f "${SWIG_BASE}/$P/${P}_wrap.cpp" ] && \ - $SWIG -python -py3 -c++ -modern -new_repr ${INCS[@]} \ + $SWIG -python -py3 -c++ ${INCS[@]} \ -outdir $DIR/build "$SWIG_C_FLAGS" -o ${SWIG_BASE}/$P/${P1}_wrap.cpp \ "${DIR}/swig/${P1}.i" fi diff --git a/tick/dataset/download_helper.py b/tick/dataset/download_helper.py index 7e7aea942..3afb5a985 100644 --- a/tick/dataset/download_helper.py +++ b/tick/dataset/download_helper.py @@ -181,7 +181,7 @@ def load_dataset(dataset_path, data_home=None, n_features=None): cache_path = os.path.join(data_home, dataset_path) if cache_path.endswith(".npz"): - dataset = np.load(cache_path) + dataset = np.load(cache_path, allow_pickle=True) # If we have only one numpy array we return it directly otherwise # we return the row dictionary if len(dataset.keys()) == 1: diff --git a/tools/travis/docker_run.sh b/tools/travis/docker_run.sh index 20deaf913..2de936d60 100755 --- a/tools/travis/docker_run.sh +++ b/tools/travis/docker_run.sh @@ -6,8 +6,13 @@ set -e -x cp -R /io src cd src -eval "$(pyenv init -)" +( apt-get update && apt-get remove --purge -y swig* && apt-get autoremove && \ + apt-get install -y autotools-dev automake gawk bison flex && \ + git clone https://github.com/swig/swig -b rel-4.0.0 swig && \ + cd swig && ./autogen.sh && ./configure --without-pcre && \ + make && make install ) & SWIG_PID=$! +eval "$(pyenv init -)" pyenv global ${PYVER} pyenv local ${PYVER} @@ -20,6 +25,8 @@ pyenv local ${PYVER} python -m pip install -r requirements.txt python setup.py cpplint +wait $SWIG_PID +swig -version # should be 4.0.0 PYMAJ=$(python -c "import sys; print(sys.version_info[0])") PYMIN=$(python -c "import sys; print(sys.version_info[1])") if (( PYMAJ == 3 )) && (( PYMIN == 6 )); then diff --git a/tools/travis/osx_install.sh b/tools/travis/osx_install.sh index e356b69b2..c25105430 100755 --- a/tools/travis/osx_install.sh +++ b/tools/travis/osx_install.sh @@ -1,21 +1,15 @@ #!/usr/bin/env bash -set -e -x +set -ex shell_session_update() { :; } brew update -brew upgrade pyenv brew install swig - -if [ ! -d googletest ] || [ ! -f googletest/CMakeLists.txt ]; then - git clone https://github.com/google/googletest - mkdir -p googletest/build - pushd googletest/build - cmake .. && make -s && make -s install - popd -fi +( git clone https://github.com/google/googletest && \ + mkdir -p googletest/build && cd googletest/build && \ + cmake .. && make -s && make -s install) & GTEST_PID=$! export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" @@ -24,7 +18,7 @@ export CXX="clang++" eval "$(pyenv init -)" -env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -s ${PYVER} +env CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -s ${PYVER} pyenv local ${PYVER} @@ -42,8 +36,7 @@ fi python -m pip install --quiet -U pip python -m pip install --quiet numpy pandas python -m pip install -r requirements.txt -python -m pip install sphinx pillow -python -m pip install cpplint +python -m pip install sphinx pillow cpplint [[ "${PYVER}" != "3.7.0" ]] && python -m pip install tensorflow # does not yet exist on python 3.7 pyenv rehash - +wait $GTEST_PID diff --git a/tools/windows/swig.3.0.12.nupkg b/tools/windows/swig.3.0.12.nupkg deleted file mode 100644 index 08f6d0430..000000000 Binary files a/tools/windows/swig.3.0.12.nupkg and /dev/null differ diff --git a/tools/windows/swig.4.0.0.nupkg b/tools/windows/swig.4.0.0.nupkg new file mode 100644 index 000000000..4b9326556 Binary files /dev/null and b/tools/windows/swig.4.0.0.nupkg differ