#2 Allow testing pypys and Jython
Merged 4 years ago by psss. Opened 4 years ago by churchyard.
tests/ churchyard/python pypy  into  master

file modified
+12 -3
@@ -2,7 +2,7 @@ 

  

  # set python version

  VERSION=${VERSION:-3.7}

- PYTHON=python$VERSION

+ PYTHON=${PYTHON:-python$VERSION}

  METHOD=${METHOD:-venv}

  TOX=${TOX:-true}

  
@@ -34,7 +34,10 @@ 

      pip install pytest

      pip install Cython --install-option="--no-cython-compile"

  else

-     python -m pip install pytest Cython

+     python -m pip install pytest

+     if [ "$PYTHON" != "jython" ]; then

+         python -m pip install Cython

+     fi

  fi

  

  # run tests
@@ -46,6 +49,7 @@ 

  python -m pytest -v test_foo.py

  

  # check that we can do extension modules

+ if [ "$PYTHON" != "jython" ]; then

  cat > module.pyx << EOF

  cdef int add(int a, int b):

      return a + b
@@ -66,6 +70,7 @@ 

  python setup.py build_ext --inplace

  

  python -c 'import module; print(module.two())' | grep '^2$'

+ fi

  

  # deactivate has unset variable, it's known

  set +u
@@ -82,4 +87,8 @@ 

  commands = python -m pytest -v test_foo.py

  EOF

  

- tox -e py${VERSION/./}

+ if [[ $PYTHON == python* ]]; then

+     tox -e py${VERSION/./}

+ else

+     tox -e $PYTHON

+ fi

METHOD=virtualenv PYTHON=pypy3 VERSION=3.5 ./smoke/venv.sh
METHOD=venv PYTHON=pypy3 VERSION=3.5 ./smoke/venv.sh
METHOD=virtualenv PYTHON=pypy VERSION=2.7 ./smoke/venv.sh

1 new commit added

  • Allow to test Jython
4 years ago

@psss Is it possible to have yaml files for Fedora CI in this repo as well to test if we are not breaking stuff?

Do you mean to execute tests upon commits / pull requests to the tests repo?

I see. That would be very useful. We definitely need something like this. Let's discuss the implementation here:

@psss can you review this please?

I tried to run the test for jython

METHOD=virtualenv PYTHON=jython VERSION=2.7 ./smoke/venv.sh

but it failed with:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 2358, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 703, in main
    create_environment(home_dir,
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 957, in create_environment
    install_wheel(
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 909, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 794, in call_subprocess
    raise OSError(
OSError: Command /tmp/python/venv/bin/jython - setuptools pip wheel failed with error code 2

Tested with jython-2.7.1-5.fc28.noarch. Any idea what might be
wrong? Otherwise looks good to me.

Jython + virtualenv can be totally broken on F28. I'll try to make it work on F29 at least. However here I just want to have the ability to test it.

Metadata Update from @psss:
- Request assigned

4 years ago

Pull-Request has been merged by psss

4 years ago
Metadata