<commit_before>"""
Deploy this project in dev/stage/production.

Requires commander_ which is installed on the systems that need it.

.. _commander: https://github.com/oremj/commander
"""

import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)))

from commander.deploy import task, hostgroups
import commander_settings as settings


@task
def update_code(ctx, tag):
    """Update the code to a specific git reference (tag/sha/etc)."""
    with ctx.lcd(settings.SRC_DIR):
        ctx.local('git checkout %s' % tag)
        ctx.local('git pull -f')
        ctx.local("find . -type f -name '*.pyc' -delete")
        ctx.local('virtualenv ../venv')
        ctx.local('../venv/bin/pip install bin/peep-2.1.1.tar.gz')
        ctx.local('../venv/bin/peep install -r requirements.txt')


@task
def update_assets(ctx):
    with ctx.lcd(settings.SRC_DIR):
        ctx.local("python2.6 manage.py collectstatic --noinput")

<commit_msg>relocatable<commit_after>"""
Deploy this project in dev/stage/production.

Requires commander_ which is installed on the systems that need it.

.. _commander: https://github.com/oremj/commander
"""

import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)))

from commander.deploy import task, hostgroups
import commander_settings as settings


@task
def update_code(ctx, tag):
    """Update the code to a specific git reference (tag/sha/etc)."""
    with ctx.lcd(settings.SRC_DIR):
        ctx.local('git checkout %s' % tag)
        ctx.local('git pull -f')
        ctx.local("find . -type f -name '*.pyc' -delete")
        ctx.local('virtualenv ../venv')
        ctx.local('../venv/bin/pip install bin/peep-2.1.1.tar.gz')
        ctx.local('../venv/bin/peep install -r requirements.txt')
        ctx.local('virtualenv --relocatable ../venv')


@task
def update_assets(ctx):
    with ctx.lcd(settings.SRC_DIR):
        ctx.local("python2.6 manage.py collectstatic --noinput")


{'fraction_non_alphanumeric': 0.14564102564102563, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 3.186695278969957, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6470071', 'n_tokens_mistral': 650, 'n_tokens_neox': 635, 'n_words': 161}