GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

setup-virtualenv 711 Bytes
Newer Older
boklm's avatar
boklm committed
1 2 3 4
#!/usr/bin/perl -w
use strict;
use FindBin;
use IO::CaptureOutput qw(qxx);
5
use Cwd;
boklm's avatar
boklm committed
6

7
my $virtenv_marionette = "$FindBin::Bin/virtualenv-marionette";
8
my $pip = "$virtenv_marionette/bin/pip";
boklm's avatar
boklm committed
9 10 11 12 13

sub run {
    system(@_) == 0 || die "Error running " . join(' ', @_);
}

14 15 16 17 18 19 20 21
sub run_from_dir {
    my $old_cwd = getcwd;
    chdir shift @_;
    my $res = run(@_);
    chdir $old_cwd;
    return $res;
}

boklm's avatar
boklm committed
22 23
sub pip_install {
    my ($pkg) = @_;
24
    my ($output) = qxx($pip, 'show', '--disable-pip-version-check', $pkg);
boklm's avatar
boklm committed
25 26 27
    run($pip, 'install', $pkg) unless $output;
}

28 29
run('virtualenv', $virtenv_marionette) unless -d $virtenv_marionette;
run_from_dir('marionette', "$virtenv_marionette/bin/python", 'setup.py', 'develop');