def build_docs(): """ Build the html and pdf docs """ with cd("/home/vagrant/repos/sympy"): run("mkdir -p dist") venv = "/home/vagrant/docs-virtualenv" make_virtualenv(venv, dependencies=['sphinx==1.1.3', 'numpy', 'mpmath']) with virtualenv(venv): with cd("/home/vagrant/repos/sympy/doc"): run("make clean") run("make html-errors") run("make man") with cd("/home/vagrant/repos/sympy/doc/_build"): run("mv html {html-nozip}".format(**tarball_formatter())) run("zip -9lr {html} {html-nozip}".format( **tarball_formatter())) run("cp {html} ../../dist/".format(**tarball_formatter())) run("make clean") run("make latex") with cd("/home/vagrant/repos/sympy/doc/_build/latex"): run("make") run("cp {pdf-orig} ../../../dist/{pdf}".format( **tarball_formatter()))
def test_tarball(release='2'): """ Test that the tarball can be unpacked and installed, and that sympy imports in the install. """ if release not in {'2', '3'}: # TODO: Add win32 raise ValueError("release must be one of '2', '3', not %s" % release) venv = "/home/vagrant/repos/test-{release}-virtualenv".format( release=release) # We have to run this outside the virtualenv to make sure the version # check runs in Python 2 tarball_formatter_dict = _tarball_formatter() with use_venv(release): make_virtualenv(venv) with virtualenv(venv): if release == '2': run("cp /vagrant/release/{py2} releasetar.tar".format( **tarball_formatter_dict)) if release == '3': run("cp /vagrant/release/{py33} releasetar.tar".format( **tarball_formatter_dict)) run("tar xvf releasetar.tar") with cd("/home/vagrant/{source-orig-notar}".format( **tarball_formatter_dict)): run("python setup.py install") run('python -c "import sympy; print(sympy.__version__)"')
def deploy(): apt_update() install_deps() virtualenv_location = '/var/slurp/venv' fabvenv.prepare_virtualenv() fabvenv.make_virtualenv(virtualenv_location, system_site_packages=False) # figure out the release name and version dist = local('python setup.py --fullname', capture=True).strip() # upload the source tarball to the temporary folder on the server put('dist/%s.tar.gz' % dist, '/tmp/slurp.tar.gz') # create a place where we can unzip the tarball, then enter # that directory and unzip it run('mkdir /tmp/slurp') with cd('/tmp/slurp'): run('tar xzf /tmp/slurp.tar.gz') with cd('/tmp/slurp/%s' % dist): # now setup the package with our virtual environment's # python interpreter run(os.path.join(virtualenv_location, "bin/python") + ' setup.py install') # now that all is set up, delete the folder again run('rm -rf /tmp/slurp /tmp/slurp.tar.gz') put('config.yml', '/var/slurp/config.yml') supervise(virtualenv_location)
def init(): """ initialize the virtualenv and git repo on the server """ require("repo_path", "venv_path") # Create the virtualenv make_virtualenv(env.venv_path, system_site_packages=False) # Create the git repo git_init(env.repo_path)
def bootstrap(): make_virtualenv(path='venv', system_site_packages=False) with virtualenv('venv'): run('pip install --upgrade pip') run('pip install --upgrade distribute') run('rm -rf codalab_src') run("git clone %s codalab_src" % env.django_settings.SOURCE_GIT_URL) put(os.path.join(THIS_SETTINGS_DIR,'deploy.py'), 'codalab_src/codalab/codalab/settings') with virtualenv('venv'): run('cd codalab_src && bash ./requirements')
def test_tarball(release='2'): """ Test that the tarball can be unpacked and installed, and that sympy imports in the install. """ if release not in {'2', '3'}: # TODO: Add win32 raise ValueError("release must be one of '2', '3', not %s" % release) venv = "/home/vagrant/repos/test-{release}-virtualenv".format(release=release) tarball_formatter_dict = tarball_formatter() with use_venv(release): make_virtualenv(venv) with virtualenv(venv): run("cp /vagrant/release/{source} releasetar.tar".format(**tarball_formatter_dict)) run("tar xvf releasetar.tar") with cd("/home/vagrant/{source-orig-notar}".format(**tarball_formatter_dict)): run("python setup.py install") run('python -c "import sympy; print(sympy.__version__)"')
def test_pypi(release='2'): """ Test that the sympy can be pip installed, and that sympy imports in the install. """ # This function is similar to test_tarball() version = get_sympy_version() if release not in {'2', '3'}: # TODO: Add win32 raise ValueError("release must be one of '2', '3', not %s" % release) venv = "/home/vagrant/repos/test-{release}-pip-virtualenv".format(release=release) with use_venv(release): make_virtualenv(venv) with virtualenv(venv): run("pip install sympy") run('python -c "import sympy; assert sympy.__version__ == \'{version}\'"'.format(version=version))
def test_pypi(release='2'): """ Test that the sympy can be pip installed, and that sympy imports in the install. """ # This function is similar to test_tarball() version = get_sympy_version() release = str(release) if release not in {'2', '3'}: # TODO: Add win32 raise ValueError("release must be one of '2', '3', not %s" % release) venv = "/home/vagrant/repos/test-{release}-pip-virtualenv".format(release=release) with use_venv(release): make_virtualenv(venv) with virtualenv(venv): run("pip install sympy") run('python -c "import sympy; assert sympy.__version__ == \'{version}\'"'.format(version=version))
def build_docs(): """ Build the html and pdf docs """ with cd("/home/vagrant/repos/sympy"): run("mkdir -p dist") venv = "/home/vagrant/docs-virtualenv" make_virtualenv(venv, dependencies=['sphinx==1.1.3', 'numpy']) with virtualenv(venv): with cd("/home/vagrant/repos/sympy/doc"): run("make clean") run("make html-errors") with cd("/home/vagrant/repos/sympy/doc/_build"): run("mv html {html-nozip}".format(**tarball_formatter())) run("zip -9lr {html} {html-nozip}".format(**tarball_formatter())) run("cp {html} ../../dist/".format(**tarball_formatter())) run("make clean") run("make latex") with cd("/home/vagrant/repos/sympy/doc/_build/latex"): run("make") run("cp {pdf-orig} ../../../dist/{pdf}".format(**tarball_formatter()))
def bootstrap(): # Create the virtualenv make_virtualenv(env.virtualenv_dir, dependencies=['pip-tools']) # Create the git repository sudo('mkdir -p /var/repo/site.git') sudo('chown www-data:www-data -R /var/repo') sudo('chmod g+rwX -R /var/repo') with cd('/var/repo/site.git'): run('git init --bare') put('post-receive.hook', 'hooks/post-receive') run('chmod +x hooks/post-receive') # Set up the site directory run('mkdir -p /var/www/site') sudo('chown www-data:www-data -R /var/www') sudo('chmod g+rwX -R /var/www') # Set up nginx sudo('rm /etc/nginx/sites-enabled/default', quiet=True)
def test_tarball(release="2"): """ Test that the tarball can be unpacked and installed, and that sympy imports in the install. """ if release not in {"2", "3"}: # TODO: Add win32 raise ValueError("release must be one of '2', '3', not %s" % release) venv = "/home/vagrant/repos/test-{release}-virtualenv".format( release=release) tarball_formatter_dict = tarball_formatter() with use_venv(release): make_virtualenv(venv) with virtualenv(venv): run("cp /vagrant/release/{source} releasetar.tar".format( **tarball_formatter_dict)) run("tar xvf releasetar.tar") with cd("/home/vagrant/{source-orig-notar}".format( **tarball_formatter_dict)): run("python setup.py install") run('python -c "import sympy; print(sympy.__version__)"')
def makevenv(path=None): make_virtualenv(path=env.venvpath, system_site_packages=False)
def create_virtual_env(): """ Create a virtual environment for Python""" if not files.exists(VIRTUALENV_PATH): make_virtualenv(VIRTUALENV_PATH)