diff --git a/.travis.yml b/.travis.yml index 9d9a0c2b..c2ede65a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: required dist: bionic python: - - "3.7" + - "3.8" addons: apt: @@ -24,10 +24,11 @@ install: env: global: - - PYTHON_INCLUDE_DIR=~/virtualenv/python3.7/include/python3.7m - - PYTHON_LIB_DIR=/opt/python/3.7.1/lib + - PYTHON_INCLUDE_DIR=~/virtualenv/python3.8/include/python3.8 + - PYTHON_LIB_DIR=/opt/python/3.8.0/lib + - PYD_LIBPYTHON_DIR=/opt/python/3.8.0/lib - PATH=$PYTHON_LIB_DIR:$PATH - - LD_RUN_PATH=$PYTHON_LIB_DIR:$LD_RUN_PATH + - LD_RUN_PATH=$PYTHON_LIB_DIR:$PYD_LIBPYTHON_DIR:$LD_RUN_PATH matrix: - DC=dmd-2.089.0 - DC=dmd-2.088.1 diff --git a/Makefile b/Makefile index b74c9e3c..dffd1338 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,23 @@ # Makefile to drive the tests export PYTHON_LIB_DIR ?= /usr/lib -DUB_CONFIGURATION ?= python37 +export DUB_CONFIGURATION ?= env +export PYD_LIBPYTHON_DIR ?= /usr/lib +export PYD_LIBPYTHON ?= python3.8 +export PYD_D_VERSION_1 ?= Python_2_4_Or_Later +export PYD_D_VERSION_2 ?= Python_2_5_Or_Later +export PYD_D_VERSION_3 ?= Python_2_6_Or_Later +export PYD_D_VERSION_4 ?= Python_2_7_Or_Later +export PYD_D_VERSION_5 ?= Python_3_0_Or_Later +export PYD_D_VERSION_6 ?= Python_3_1_Or_Later +export PYD_D_VERSION_7 ?= Python_3_2_Or_Later +export PYD_D_VERSION_8 ?= Python_3_3_Or_Later +export PYD_D_VERSION_9 ?= Python_3_4_Or_Later +export PYD_D_VERSION_10 ?= Python_3_5_Or_Later +export PYD_D_VERSION_11 ?= Python_3_6_Or_Later +export PYD_D_VERSION_12 ?= Python_3_7_Or_Later +export PYD_D_VERSION_13 ?= Python_3_8_Or_Later + .PHONY: clean test test_python test_python_pyd test_python_pynih test_cs test_simple_pyd test_simple_pynih test_simple_cs test_pyd_pyd test_issues_pyd test_issues_pynih test_numpy_pyd test_numpy_pynih examples/simple/lib/pyd/libsimple.so examples/simple/lib/pynih/libsimple.so examples/issues/lib/pyd/libissues.so examples/issues/lib/pynih/libissues.so examples/numpy/lib/pyd/libnumpy.so examples/numpy/lib/pynih/libnumpy.so examples/pyd/lib/pyd/libpydtests.so examples/pyd/lib/pynih/libpydtests.so examples/phobos/lib/pyd/libphobos.so examples/phobos/lib/pynih/libphobos.so examples/simple/lib/csharp/libsimple.so examples/simple/Simple.cs @@ -13,17 +29,7 @@ test_python_pynih: test_simple_pynih test_pyd_pynih test_issues_pynih test_cs: test_simple_cs clean: - @cd csharp && dub clean -q - @cd excel && dub clean -q - @cd pynih && dub clean -q - @cd python && dub clean -q - @cd reflection && dub clean -q - @cd examples/issues && dub clean -q - @cd examples/numpy && dub clean -q - @cd examples/pyd && dub clean -q - @cd examples/simple && dub clean -q - @rm -f examples/*/*.so examples/pyd/lib/pyd/*.so examples/simple/lib/*/*.so examples/simple/simple examples/simple/Simple.cs - @rm -rf tests/*/bin tests/*/obj + git clean -xffd test_simple_pyd: tests/test_simple.py examples/simple/lib/pyd/simple.so PYTHONPATH=$(PWD)/examples/simple/lib/pyd pytest -s -vv $< diff --git a/ci/test-csharp.sh b/ci/test-csharp.sh index e2b4b71e..d1aad58a 100755 --- a/ci/test-csharp.sh +++ b/ci/test-csharp.sh @@ -3,5 +3,7 @@ set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +echo 'Running C# script test' "$SCRIPT_DIR"/../csharp/tests/test.sh -make -j`nproc` -C "$SCRIPT_DIR"/.. test_cs +echo 'Running C# makefile test' +make -j"$(nproc)" -C "$SCRIPT_DIR"/.. test_cs diff --git a/ci/test-python.sh b/ci/test-python.sh index fdef0d47..20f34ac8 100755 --- a/ci/test-python.sh +++ b/ci/test-python.sh @@ -4,19 +4,29 @@ set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DC="${DC:-dmd}" +PYTHON_LIB_DIR="${PYTHON_LIB_DIR:-/usr/lib}" echo "Testing with $DC compiler" - +# echo 'Testing pynih' "$SCRIPT_DIR"/../pynih/ci.sh -DUB_CONFIGURATION=python37 make -j`nproc` test_python -pushd /tmp -dub fetch pyd --version=0.11.0 -dub run pyd:setup -set +u # or else the script below fails -source pyd_set_env_vars.sh -set -u -popd -DUB_CONFIGURATION=env make -j`nproc` test_python -dub test -q --build=unittest-cov --compiler="$DC" +# FIXME - Use pythono38 when it exists +# DUB_CONFIGURATION=python38 make -j"$(nproc)" test_python + +# FIXME - use env when it works (broken until pyd tags the latest fix) +# pushd /tmp +# dub fetch pyd --version=0.13.0 +# dub run pyd:setup +# set +u # or else the script below fails +# source pyd_set_env_vars.sh +# set -u +# popd +# DUB_CONFIGURATION=env make -j"$(nproc)" test_python + +echo 'Running Python makefile test' +echo "And the lib dir is $PYTHON_LIB_DIR" +make -j"$(nproc)" test_python # FIXME - restore the two above instad of this line + +echo 'Running autowrap unit tests' +PYTHON_LIB_DIR="$PYTHON_LIB_DIR" dub test -q --build=unittest-cov --compiler="$DC" diff --git a/dub.sdl b/dub.sdl index ed6aeff2..07724c30 100644 --- a/dub.sdl +++ b/dub.sdl @@ -30,7 +30,7 @@ configuration "unittest" { versions "unitUnthreaded" # GIL versions "TestingAutowrap" - libs "python3.7m" + libs "python3.8" lflags "-L$PYTHON_LIB_DIR" dependency ":common" version="*" @@ -53,7 +53,7 @@ configuration "unittest-no-pynih" { versions "unitUnthreaded" # GIL versions "TestingAutowrap" - libs "python3.7m" + libs "python3.8" lflags "-L$PYTHON_LIB_DIR" versions "NoPynih" diff --git a/pynih/ci.sh b/pynih/ci.sh index 9687b33a..c0a21f01 100755 --- a/pynih/ci.sh +++ b/pynih/ci.sh @@ -5,7 +5,7 @@ set -euo pipefail DC="${DC:-dmd}" TRAVIS="${TRAVIS:-}" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" -PYTHON_INCLUDE_DIR="${PYTHON_INCLUDE_DIR:-/usr/include/python3.7m}" +PYTHON_INCLUDE_DIR="${PYTHON_INCLUDE_DIR:-/usr/include/python3.8}" if [ "$DC" = "ldc2" ]; then @@ -14,4 +14,4 @@ if [ "$DC" = "ldc2" ]; then fi cd "$SCRIPT_DIR" -make -j`nproc` +make -j"$(nproc)"