Skip to content

Commit

Permalink
Pass a complete copy of os.environ to the subocmmands for installing …
Browse files Browse the repository at this point in the history
…packages in the scaffold testing virtualenvs.
  • Loading branch information
disko committed Jan 4, 2016
1 parent 7a6ec04 commit b9eea89
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kotti/tests/test_zzz_scaffolds.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import shutil
import subprocess
import sys
from copy import copy
from tempfile import mkdtemp

from pytest import fixture
Expand Down Expand Up @@ -54,19 +55,24 @@ def virtualenv(request, travis):
os.path.join('bin', 'pip'),
'install', '-U', 'pip', 'setuptools', 'pip-accel'])

# create a local copy of the environment, where we can override
# VIRTUAL_ENV to make pip-accel work
env = copy(os.environ)
env.update({'VIRTUAL_ENV': virtualenv_directory, })

# install requirements.txt into the virtualenv
subprocess.check_call([
os.path.join('bin', 'pip-accel'),
'install', '-r',
os.path.join(cwd, 'requirements.txt')],
env={'VIRTUAL_ENV': virtualenv_directory, })
env=env)

# setuptools-git is required to be able to call setup.py install
# sucessfully. also install psycopg2 and oursql.
subprocess.check_call([
os.path.join('bin', 'pip-accel'),
'install', 'setuptools-git', 'psycopg2', 'oursql'],
env={'VIRTUAL_ENV': virtualenv_directory, })
env=env)

shutil.copytree(cwd, os.path.join(virtualenv_directory, 'kotti'))

Expand Down

0 comments on commit b9eea89

Please sign in to comment.