def setup():
    require.git.working_copy(CIDADEILUMINADA_REPO_PATH, path=CIDADEILUMINADA_WORK_PATH, update=True)
    with cd(CIDADEILUMINADA_WORK_PATH):
        require.python.virtualenv(CIDADEILUMINADA_WORK_PATH)
        with virtualenv(CIDADEILUMINADA_WORK_PATH):
            python.install('uwsgi')
    create_settings_local()
Example #2
0
def packages(pkg_list, pip_cmd='pip', python_cmd='python',
             allow_external=None, allow_unverified=None, **kwargs):
    """
    Require several Python packages.

    Package names are case insensitive.

    Starting with version 1.5, pip no longer scrapes insecure external
    urls by default and no longer installs externally hosted files by
    default. Use ``allow_external=['foo', 'bar']`` or
    ``allow_unverified=['bar', 'baz']`` to change these behaviours
    for specific packages.
    """
    if allow_external is None:
        allow_external = []

    if allow_unverified is None:
        allow_unverified = []

    pip(MIN_PIP_VERSION, python_cmd=python_cmd)

    pkg_list = [pkg for pkg in pkg_list if not is_installed(pkg, pip_cmd=pip_cmd)]
    if pkg_list:
        install(pkg_list,
                pip_cmd=pip_cmd,
                allow_external=allow_external,
                allow_unverified=allow_unverified,
                **kwargs)
Example #3
0
def package(pkg_name, url=None, pip_cmd='pip', python_cmd='python', **kwargs):
    """
    Require a Python package.

    If the package is not installed, it will be installed
    using the `pip installer`_.

    Package names are case insensitive.

    ::

        from fabtools.python import virtualenv
        from fabtools import require

        # Install package system-wide
        require.python.package('foo', use_sudo=True)

        # Install package in an existing virtual environment
        with virtualenv('/path/to/venv'):
            require.python.package('bar')

    .. _pip installer: http://www.pip-installer.org/
    """
    pip(MIN_PIP_VERSION, python_cmd=python_cmd)
    if not is_installed(pkg_name, pip_cmd=pip_cmd):
        install(url or pkg_name, pip_cmd=pip_cmd, **kwargs)
Example #4
0
def packages(pkg_list, **kwargs):
    """
    Require several Python packages.
    """
    pip(DEFAULT_PIP_VERSION)
    pkg_list = [pkg for pkg in pkg_list if not is_installed(pkg)]
    if pkg_list:
        install(pkg_list, **kwargs)
Example #5
0
def packages(pkg_list, pip_cmd='pip', python_cmd='python', **kwargs):
    """
    Require several Python packages.

    Package names are case insensitive.
    """
    pip(MIN_PIP_VERSION, python_cmd=python_cmd)
    pkg_list = [pkg for pkg in pkg_list if not is_installed(pkg, pip_cmd=pip_cmd)]
    if pkg_list:
        install(pkg_list, pip_cmd=pip_cmd, **kwargs)
def setup():
    require.git.working_copy('[email protected]:ArthurPBressan/hotsite-sa-bilac-2015.git',
                             path=HOTSITE_WORK_PATH, update=True)
    with cd(HOTSITE_WORK_PATH):
        require.files.directories(['instance', 'tmp'], use_sudo=True)
        require.python.virtualenv(HOTSITE_WORK_PATH)
        with virtualenv(HOTSITE_WORK_PATH):
            python.install('uwsgi')
    deploy()
    with cd(HOTSITE_WORK_PATH), virtualenv(HOTSITE_WORK_PATH):
        sudo('uwsgi --socket :8080 --module="hotsite:create_app()" --touch-reload="/root/uwsgi_file" &')
Example #7
0
def deploy():
    require("install_location")
    sudo("mkdir -p %(install_location)s" % env)
    if not is_pip_installed():
        install_pip()
    install("virtualenv", use_sudo=True)
    put(join_local("pip-requirements.txt"), "/tmp/pip-requirements.txt")
    with _virtualenv():
        install_requirements("/tmp/pip-requirements.txt", use_sudo=True)
        sudo("pip install -e git+https://github.com/oliverdrake/rpitempcontroller.git#egg=tempcontrol")
    put("tempcontroller-config.default", env.config_file, use_sudo=True,
        mirror_local_mode=True)
    with settings(python_bin_dir=os.path.join(_virtualenv_location(), "bin")):
        upload_template("init-script.in", env.init_script, mode=0754,
                        use_jinja=True, context=env, use_sudo=True,
                        backup=False)
    sudo("chown root:root %(init_script)s" % env)
Example #8
0
def sphinx():
    # they are not available in older releases
    require_deb_packages(
        '''
                    python-blockdiag
                    python-seqdiag
                    python-sphinxcontrib.blockdiag
                    python-sphinxcontrib.seqdiag
                    python-tablib
                    ''', error_if_not_exists=False
    )

    require_deb_packages(
        '''
gtkwave
mercurial
python-sphinx
scrot
texlive-fonts-recommended
texlive-latex-extra
                    '''
    )

    require_python_packages(
        '''
PyVirtualDisplay
pyscreenshot

sphinxcontrib-programoutput
sphinxcontrib-programscreenshot
sphinxcontrib-gtkwave
sphinxcontrib-eagle
eagexp
discogui
PyMouse
                    ''')

    # sphinx-contrib
    if not is_installed('autorun'):
        if is_dir('/tmp/sphinx-contrib'):
            run('rm -rf /tmp/sphinx-contrib')
        with cd('/tmp'):
            run('hg clone https://bitbucket.org/birkenfeld/sphinx-contrib')
        install('/tmp/sphinx-contrib/autorun', use_sudo=True)
Example #9
0
def package(pkg_name, url=None, pip_cmd='pip', python_cmd='python',
            allow_external=False, allow_unverified=False, trusted_hosts=None,
            **kwargs):
    """
    Require a Python package.

    If the package is not installed, it will be installed
    using the `pip installer`_.

    Package names are case insensitive.

    Starting with version 1.5, pip no longer scrapes insecure external
    urls by default and no longer installs externally hosted files by
    default. Use ``allow_external=True`` or ``allow_unverified=True``
    to change these behaviours.

    ::

        from fabtools.python import virtualenv
        from fabtools import require

        # Install package system-wide (not recommended)
        require.python.package('foo', use_sudo=True)

        # Install package in an existing virtual environment
        with virtualenv('/path/to/venv'):
            require.python.package('bar')

    .. _pip installer: http://www.pip-installer.org/
    """
    pip(MIN_PIP_VERSION, python_cmd=python_cmd)
    if not is_installed(pkg_name, pip_cmd=pip_cmd):
        install(url or pkg_name,
                pip_cmd=pip_cmd,
                allow_external=[url or pkg_name] if allow_external else [],
                allow_unverified=[url or pkg_name] if allow_unverified else [],
                trusted_hosts=trusted_hosts,
                **kwargs)
Example #10
0
def update_source():
    """Simple git pull inside newebe directory"""

    python.install("git+git://github.com/gelnior/newebe.git")
Example #11
0
def setup_supervisord():
    """Install python daemon manager, supervisord"""

    python.install("meld3==0.6.9", use_sudo=True)
    require.deb.package("supervisor")