From 362f438cc677d154be6aa95aab4df3a434ee48c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 7 Mar 2022 21:17:09 +0100 Subject: [PATCH] Instead of checking for Jython, make it possible to opt-out from the Cython test - we don't have Jython any more and even if we had, we could explicitly opt out from it - we sometimes need to opt out from Cython test in the development versions of Python --- smoke/venv.sh | 9 ++++++--- tests.yml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/smoke/venv.sh b/smoke/venv.sh index d82973e..578c130 100755 --- a/smoke/venv.sh +++ b/smoke/venv.sh @@ -8,6 +8,7 @@ VERSION=${VERSION:-3.8} PYTHON=${PYTHON:-python$VERSION} METHOD=${METHOD:-venv} TOX=${TOX:-true} +CYTHON=${CYTHON:-true} INSTALL_OR_SKIP=${INSTALL_OR_SKIP:-false} # clean from possible older runs @@ -52,10 +53,12 @@ if [ "$VERSION" == "2.6" ]; then elif [ "$VERSION" == "3.11" ]; then python -m pip install pytest # Cython support for 3.11.0a1+ is not yet released - python -m pip install https://github.com/cython/cython/archive/master.tar.gz --install-option="--no-cython-compile" + if [ "$CYTHON" == "true" ]; then + python -m pip install https://github.com/cython/cython/archive/master.tar.gz --install-option="--no-cython-compile" + fi else python -m pip install pytest - if [ "$PYTHON" != "jython" ]; then + if [ "$CYTHON" == "true" ]; then # We try to fetch a wheel only and if that fails, we disable compilation # Useful for fresh CPythons, where wheels are not yet ready, but Cython defaults to compiling python -m pip install Cython --only-binary :all: || python -m pip install Cython --install-option="--no-cython-compile" @@ -70,7 +73,7 @@ EOF python -m pytest -v test_foo.py -if [ "$PYTHON" != "jython" ]; then +if [ "$CYTHON" == "true" ]; then cat > module.pyx << EOF cdef int add(int a, int b): return a + b diff --git a/tests.yml b/tests.yml index 4803bf4..ea20a28 100644 --- a/tests.yml +++ b/tests.yml @@ -39,7 +39,7 @@ run: VERSION=3.9 METHOD=venv ./venv.sh - smoke311: dir: smoke - run: VERSION=3.11 METHOD=venv ./venv.sh + run: VERSION=3.11 METHOD=venv CYTHON=false ./venv.sh - smoke39_seeder_pip: dir: smoke run: VERSION=3.9 METHOD=virtualenv-seeder-pip ./venv.sh