3 from subprocess import check_call
5 # Install tahoe into a new virtualenv, move aside the source tree, run a test
6 # with the installed tahoe. This ensures that the installed code isn't
7 # depending upon anything from the source tree. Requires 'pip' and
8 # 'virtualenv' to be installed, and enough compilers/libraries (libffi-dev)
9 # to enable 'pip install'.
11 # This runs a lot faster if you've cached wheels first. Edit ~/.pip/pip.conf
12 # to have [global] wheel-dir=find-links=/HOME/.pip/wheels, then run 'pip
13 # wheel .' from the tahoe tree.
15 assert os.path.exists("Tahoe.home"), "Run this from the top of the source tree."
16 VE = "test-pip-install-virtualenv"
18 print "creating virtualenv.."
19 if os.path.exists(VE):
21 check_call(["virtualenv", VE])
22 print "running 'pip install .' from virtualenv.."
23 check_call(["%s/bin/pip" % VE, "install", "."])
25 print "moving src/ out of the away"
26 os.rename("src", "src-disabled-by-test-pip-install")
27 print "running 'trial allmydata.test.test_web' from virtualenv.."
28 rc = check_call(["%s/bin/trial" % VE, "allmydata.test.test_web"])
30 print "moving src/ back"
31 os.rename("src-disabled-by-test-pip-install", "src")