[pypy-issue] [issue724] pypy and virtualenv used from a different user

Jonas Obrist tracker at bugs.pypy.org
Mon May 16 20:49:56 CEST 2011


New submission from Jonas Obrist <jonas.obrist at divio.ch>:

I tried getting my Jenkins CI [1] installation [2] to work with pypy 1.5 and virtualenv 1.6.1. The way I do 
this is having all my virtualenvs (cpython and pypy) in the home directory of the 'divio' user:

~/ci-envs/py25dj12/
~/ci-envs/py26dj13/
~/ci-envs/pypy15djtrunk/
...

Now the actual unit tests run from the user 'jenkins' with a script that looks somewhat like this:

/home/divio/ci-envs/py${python}dj${django}/bin/python manage.py test nani --verbosity=2

Where the 'python' and 'django' variables get substituted by something like "25" and "12" in the case of 
Django 1.2 on CPython 2.5 or "py15" and "12" for Django 1.2 on PyPy 1.5.

Now this approach works fine with CPython (2.5, 2.6, 2.7) but not with PyPy. 

Running pypy using the 'jenkins' user from one of the virtualenvs gives following error:

jenkins at pony:/home/divio/ci-envs/pypy15dj12$ bin/pypy
'import site' failed
Python 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)
[PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
debug: OperationError:
debug:  operror-type: ImportError
debug:  operror-value: No module named _pypy_interact

Note that this does not happen with CPython:

jenkins at pony:/home/divio/ci-envs/py25dj12$ bin/python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

On the 'divio' user pypy works flawlessly:

divio at pony:~/ci-envs/pypy15dj12$ bin/pypy
Python 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)
[PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``"The HHU campus would be a
terrible quake level - you'd never have a clue where you are" - michael''
>>>> 


One difference I found between the two is the layout of the virtualenvs:

jenkins at pony:/home/divio/ci-envs/py25dj12$ ls -l
total 12
drwxr-xr-x 2 divio divio 4096 2011-05-12 10:45 bin
drwxr-xr-x 2 divio divio 4096 2011-02-15 11:40 include
drwxr-xr-x 3 divio divio 4096 2011-02-15 11:40 lib

And:

jenkins at pony:/home/divio/ci-envs/pypy15dj12$ ls -l
total 16
drwxr-xr-x 2 divio divio 4096 2011-05-16 20:04 bin
lrwxrwxrwx 1 divio divio   24 2011-05-16 20:03 include -> /home/divio/pypy/include
drwxr-xr-x 2 divio divio 4096 2011-05-16 20:03 lib_pypy
drwxr-xr-x 4 divio divio 4096 2011-05-16 20:03 lib-python
drwxr-xr-x 7 divio divio 4096 2011-05-16 20:04 site-packages


Please note that the issue is not really Jenkins related, but it's a use case that causes this issue. The 
real problem seems to be related to different users accessing virtualenvs.

[1] http://jenkins-ci.org/
[2] http://ci.django-cms.org/

----------
messages: 2522
nosy: ojii, pypy-issue
priority: bug
status: unread
title: pypy and virtualenv used from a different user

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue724>
________________________________________


More information about the pypy-issue mailing list