Пример #1
0
def perform_dist(buildno=None):
    header('Building a distribuable package')
    cmd = ['python setup.py']
    if buildno:
        cmd.append('egg_info -b {0}'.format(buildno))
    cmd.append('bdist_wheel')
    lrun(' '.join(cmd), pty=True)
Пример #2
0
def perform_dist(buildno=None):
    header('Building a distribuable package')
    cmd = ['python setup.py']
    if buildno:
        cmd.append('egg_info -b {0}'.format(buildno))
    cmd.append('bdist_wheel')
    lrun(' '.join(cmd), pty=True)
Пример #3
0
def test(fast=False):
    '''Run tests suite'''
    header('Run tests suite')
    cmd = 'nosetests --rednose --force-color udata'
    if fast:
        cmd = ' '.join([cmd, '--stop'])
    lrun(cmd, pty=True)
Пример #4
0
def test(ctx, fast=False):
    '''Run tests suite'''
    header('Run tests suite')
    cmd = 'nosetests --rednose --force-color udata'
    if fast:
        cmd = ' '.join([cmd, '--stop'])
    lrun(cmd)
Пример #5
0
def test(fast=False):
    """Run tests suite"""
    header("Run tests suite")
    cmd = "nosetests --rednose --force-color udata"
    if fast:
        cmd = " ".join([cmd, "--stop"])
    lrun(cmd, pty=True)
Пример #6
0
def cover():
    """Run tests suite with coverage"""
    header("Run tests suite with coverage")
    lrun(
        "nosetests --rednose --force-color \
        --with-coverage --cover-html --cover-package=udata",
        pty=True,
    )
Пример #7
0
def assets_build(ctx, progress=False):
    '''Install and compile assets'''
    header('Building static assets')
    cmd = 'npm run assets:build -- --config {0}.js'
    if progress:
        cmd += ' --progress'
    lrun(cmd.format('webpack.config.prod'), pty=True)
    lrun(cmd.format('webpack.widgets.config'), pty=True)
Пример #8
0
def assets_build(progress=False):
    '''Install and compile assets'''
    header('Building static assets')
    cmd = 'npm run assets:build -- --config {0}.js'
    if progress:
        cmd += ' --progress'
    lrun(cmd.format('webpack.config.prod'), pty=True)
    lrun(cmd.format('webpack.widgets.config'), pty=True)
Пример #9
0
def assets_build(progress=False):
    """Install and compile assets"""
    header("Building static assets")
    cmd = "npm run assets:build -- --config {0}.js"
    if progress:
        cmd += " --progress"
    lrun(cmd.format("webpack.config.prod"), pty=True)
    lrun(cmd.format("webpack.widgets.config"), pty=True)
Пример #10
0
def i18n(ctx, update=False):
    '''Extract translatable strings'''
    header('Extract translatable strings')

    info('Extract Python strings')
    lrun('python setup.py extract_messages')
    if update:
        lrun('python setup.py update_catalog')

    info('Extract JavaScript strings')
    keys = set()
    catalog = {}
    catalog_filename = join(ROOT, 'js', 'locales',
                            '{}.en.json'.format(I18N_DOMAIN))
    if exists(catalog_filename):
        with codecs.open(catalog_filename, encoding='utf8') as f:
            catalog = json.load(f)

    globs = '*.js', '*.vue', '*.hbs'
    regexps = [
        re.compile(r'(?:|\.|\s|\{)_\(\s*(?:"|\')(.*?)(?:"|\')\s*(?:\)|,)'
                   ),  # JS _('trad')
        re.compile(r'v-i18n="(.*?)"'),  # Vue.js directive v-i18n="trad"
        re.compile(r'"\{\{\{?\s*\'(.*?)\'\s*\|\s*i18n\}\}\}?"'
                   ),  # Vue.js filter {{ 'trad'|i18n }}
        re.compile(r'{{_\s*"(.*?)"\s*}}'),  # Handlebars {{_ "trad" }}
        re.compile(r'{{_\s*\'(.*?)\'\s*}}'),  # Handlebars {{_ 'trad' }}
        re.compile(r'\:[a-z0-9_\-]+="\s*_\(\'(.*?)\'\)\s*"'
                   ),  # Vue.js binding :prop="_('trad')"
    ]

    for directory, _, _ in os.walk(join(ROOT, 'js')):
        glob_patterns = (iglob(join(directory, g)) for g in globs)
        for filename in itertools.chain(*glob_patterns):
            print('Extracting messages from {0}'.format(green(filename)))
            content = codecs.open(filename, encoding='utf8').read()
            for regexp in regexps:
                for match in regexp.finditer(content):
                    key = match.group(1)
                    key = key.replace('\\n', '\n')
                    keys.add(key)
                    if key not in catalog:
                        catalog[key] = key

    # Remove old/not found translations
    for key in catalog.keys():
        if key not in keys:
            del catalog[key]

    with codecs.open(catalog_filename, 'w', encoding='utf8') as f:
        json.dump(catalog,
                  f,
                  sort_keys=True,
                  indent=4,
                  ensure_ascii=False,
                  encoding='utf8',
                  separators=(',', ': '))
Пример #11
0
def qa():
    """Run a quality report"""
    header("Performing static analysis")
    info("Python static analysis")
    flake8_results = lrun("flake8 udata --jobs 1", pty=True, warn=True)
    info("JavaScript static analysis")
    eslint_results = lrun("npm -s run lint", pty=True, warn=True)
    if flake8_results.failed or eslint_results.failed:
        exit(flake8_results.return_code or eslint_results.return_code)
    print(green("OK"))
Пример #12
0
def qa(ctx):
    '''Run a quality report'''
    header('Performing static analysis')
    info('Python static analysis')
    flake8_results = lrun('flake8 udata --jobs 1', pty=True, warn=True)
    info('JavaScript static analysis')
    eslint_results = lrun('npm -s run lint', pty=True, warn=True)
    if flake8_results.failed or eslint_results.failed:
        exit(flake8_results.return_code or eslint_results.return_code)
    print(green('OK'))
Пример #13
0
def qa(ctx):
    '''Run a quality report'''
    header('Performing static analysis')
    info('Python static analysis')
    flake8_results = lrun('flake8 udata --jobs 1', pty=True, warn=True)
    info('JavaScript static analysis')
    eslint_results = lrun('npm -s run lint', pty=True, warn=True)
    if flake8_results.failed or eslint_results.failed:
        exit(flake8_results.return_code or eslint_results.return_code)
    print(green('OK'))
Пример #14
0
def i18n():
    '''Extract translatable strings'''
    header('Extract translatable strings')

    info('Extract Python strings')
    lrun('python setup.py extract_messages')
    lrun('python setup.py update_catalog')

    info('Extract JavaScript strings')
    keys = []
    catalog = {}
    catalog_filename = join(ROOT, 'js', 'locales',
                            '{}.en.json'.format(I18N_DOMAIN))
    not_found = {}
    not_found_filename = join(ROOT, 'js', 'locales',
                            '{}.notfound.json'.format(I18N_DOMAIN))
    if exists(catalog_filename):
        with codecs.open(catalog_filename, encoding='utf8') as f:
            catalog = json.load(f)

    globs = '*.js', '*.vue', '*.hbs'
    regexps = [
        re.compile(r'(?:|\.|\s|\{)_\(\s*(?:"|\')(.*?)(?:"|\')\s*(?:\)|,)'),
        # re.compile(r'this\._\(\s*(?:"|\')(.*?)(?:"|\')\s*\)'),
        re.compile(r'v-i18n="(.*?)"'),
        re.compile(r'"\{\{\{?\s*\'(.*?)\'\s*\|\s*i18n\}\}\}?"'),
        re.compile(r'{{_\s*"(.*?)"\s*}}'),
        re.compile(r'{{_\s*\'(.*?)\'\s*}}'),
    ]

    for directory, _, _ in os.walk(join(ROOT, 'js')):
        glob_patterns = (iglob(join(directory, g)) for g in globs)
        for filename in itertools.chain(*glob_patterns):
            print('Extracting messages from {0}'.format(green(filename)))
            content = codecs.open(filename, encoding='utf8').read()
            for regexp in regexps:
                for match in regexp.finditer(content):
                    key = match.group(1)
                    keys.append(key)
                    if key not in catalog:
                        catalog[key] = key

    with codecs.open(catalog_filename, 'w', encoding='utf8') as f:
        json.dump(catalog, f, sort_keys=True, indent=4, ensure_ascii=False,
                  encoding='utf8', separators=(',', ': '))

    for key, value in catalog.items():
        if key not in keys:
            not_found[key] = value

    with codecs.open(not_found_filename, 'w', encoding='utf8') as f:
        json.dump(not_found, f, sort_keys=True, indent=4, ensure_ascii=False,
                  encoding='utf8', separators=(',', ': '))
Пример #15
0
def i18n():
    '''Extract translatable strings'''
    header('Extract translatable strings')

    info('Extract Python strings')
    lrun('python setup.py extract_messages')
    lrun('python setup.py update_catalog')

    info('Extract JavaScript strings')
    keys = []
    catalog = {}
    catalog_filename = join(ROOT, 'js', 'locales',
                            '{}.en.json'.format(I18N_DOMAIN))
    not_found = {}
    not_found_filename = join(ROOT, 'js', 'locales',
                            '{}.notfound.json'.format(I18N_DOMAIN))
    if exists(catalog_filename):
        with codecs.open(catalog_filename, encoding='utf8') as f:
            catalog = json.load(f)

    globs = '*.js', '*.vue', '*.hbs'
    regexps = [
        re.compile(r'(?:|\.|\s|\{)_\(\s*(?:"|\')(.*?)(?:"|\')\s*(?:\)|,)'),
        # re.compile(r'this\._\(\s*(?:"|\')(.*?)(?:"|\')\s*\)'),
        re.compile(r'v-i18n="(.*?)"'),
        re.compile(r'"\{\{\{?\s*\'(.*?)\'\s*\|\s*i18n\}\}\}?"'),
        re.compile(r'{{_\s*"(.*?)"\s*}}'),
        re.compile(r'{{_\s*\'(.*?)\'\s*}}'),
    ]

    for directory, _, _ in os.walk(join(ROOT, 'js')):
        glob_patterns = (iglob(join(directory, g)) for g in globs)
        for filename in itertools.chain(*glob_patterns):
            print('Extracting messages from {0}'.format(green(filename)))
            content = codecs.open(filename, encoding='utf8').read()
            for regexp in regexps:
                for match in regexp.finditer(content):
                    key = match.group(1)
                    keys.append(key)
                    if key not in catalog:
                        catalog[key] = key

    with codecs.open(catalog_filename, 'w', encoding='utf8') as f:
        json.dump(catalog, f, sort_keys=True, indent=4, ensure_ascii=False,
                  encoding='utf8', separators=(',', ': '))

    for key, value in catalog.items():
        if key not in keys:
            not_found[key] = value

    with codecs.open(not_found_filename, 'w', encoding='utf8') as f:
        json.dump(not_found, f, sort_keys=True, indent=4, ensure_ascii=False,
                  encoding='utf8', separators=(',', ': '))
Пример #16
0
def clean(ctx, node=False, translations=False, all=False):
    '''Cleanup all build artifacts'''
    header('Clean all build artifacts')
    patterns = [
        'build', 'dist', 'cover', 'docs/_build', '**/*.pyc', '*.egg-info',
        '.tox', 'udata/static/*'
    ]
    if node or all:
        patterns.append('node_modules')
    if translations or all:
        patterns.append('udata/translations/*/LC_MESSAGES/udata.mo')
    for pattern in patterns:
        info(pattern)
    lrun('rm -rf {0}'.format(' '.join(patterns)))
Пример #17
0
def clean(ctx, node=False, translations=False, all=False):
    '''Cleanup all build artifacts'''
    header('Clean all build artifacts')
    patterns = [
        'build', 'dist', 'cover', 'docs/_build',
        '**/*.pyc', '*.egg-info', '.tox', 'udata/static/*'
    ]
    if node or all:
        patterns.append('node_modules')
    if translations or all:
        patterns.append('udata/translations/*/LC_MESSAGES/udata.mo')
    for pattern in patterns:
        info(pattern)
    lrun('rm -rf {0}'.format(' '.join(patterns)))
Пример #18
0
def i18n():
    """Extract translatable strings"""
    header("Extract translatable strings")

    info("Extract Python strings")
    lrun("python setup.py extract_messages")
    lrun("python setup.py update_catalog")

    info("Extract JavaScript strings")
    keys = []
    catalog = {}
    catalog_filename = join(ROOT, "js", "locales", "{}.en.json".format(I18N_DOMAIN))
    not_found = {}
    not_found_filename = join(ROOT, "js", "locales", "{}.notfound.json".format(I18N_DOMAIN))
    if exists(catalog_filename):
        with codecs.open(catalog_filename, encoding="utf8") as f:
            catalog = json.load(f)

    globs = "*.js", "*.vue", "*.hbs"
    regexps = [
        re.compile(r'(?:|\.|\s|\{)_\(\s*(?:"|\')(.*?)(?:"|\')\s*(?:\)|,)'),  # JS _('trad')
        re.compile(r'v-i18n="(.*?)"'),  # Vue.js directive v-i18n="trad"
        re.compile(r'"\{\{\{?\s*\'(.*?)\'\s*\|\s*i18n\}\}\}?"'),  # Vue.js filter {{ 'trad'|i18n }}
        re.compile(r'{{_\s*"(.*?)"\s*}}'),  # Handlebars {{_ "trad" }}
        re.compile(r"{{_\s*\'(.*?)\'\s*}}"),  # Handlebars {{_ 'trad' }}
        re.compile(r'\:[a-z0-9_\-]+="\s*_\(\'(.*?)\'\)\s*"'),  # Vue.js binding :prop="_('trad')"
    ]

    for directory, _, _ in os.walk(join(ROOT, "js")):
        glob_patterns = (iglob(join(directory, g)) for g in globs)
        for filename in itertools.chain(*glob_patterns):
            print("Extracting messages from {0}".format(green(filename)))
            content = codecs.open(filename, encoding="utf8").read()
            for regexp in regexps:
                for match in regexp.finditer(content):
                    key = match.group(1)
                    keys.append(key)
                    if key not in catalog:
                        catalog[key] = key

    with codecs.open(catalog_filename, "w", encoding="utf8") as f:
        json.dump(catalog, f, sort_keys=True, indent=4, ensure_ascii=False, encoding="utf8", separators=(",", ": "))

    for key, value in catalog.items():
        if key not in keys:
            not_found[key] = value

    with codecs.open(not_found_filename, "w", encoding="utf8") as f:
        json.dump(not_found, f, sort_keys=True, indent=4, ensure_ascii=False, encoding="utf8", separators=(",", ": "))
Пример #19
0
def qa():
    '''Run a quality report'''
    header('Performing static analysis')
    info('Python static analysis')
    flake8_results = lrun('flake8 udata', warn=True)
    info('JavaScript static analysis')
    jshint_results = nrun('jshint js', warn=True)
    if flake8_results.failed or jshint_results.failed:
        exit(flake8_results.return_code or jshint_results.return_code)
Пример #20
0
def qa():
    '''Run a quality report'''
    header('Performing static analysis')
    info('Python static analysis')
    flake8_results = lrun('flake8 udata', pty=True, warn=True)
    info('JavaScript static analysis')
    eslint_results = nrun('eslint js/ --ext .vue,.js', pty=True, warn=True)
    if flake8_results.failed or eslint_results.failed:
        exit(flake8_results.return_code or eslint_results.return_code)
    print(green('OK'))
Пример #21
0
def clean(ctx, bower=False, node=False, translations=False, all=False):
    '''Cleanup all build artifacts'''
    header('Clean all build artifacts')
    patterns = [
        'build', 'dist', 'cover', 'docs/_build', '**/*.pyc', '*.egg-info',
        '.tox'
    ]
    # Static build assets
    patterns.extend('udata/static/*.{0}'.format(e) for e in STATIC_ASSETS_EXTS)
    patterns.extend('udata/static/{0}'.format(d) for d in STATIC_ASSETS_DIRS)
    if bower or all:
        patterns.append('udata/static/bower')
    if node or all:
        patterns.append('node_modules')
    if translations or all:
        patterns.append('udata/translations/*/LC_MESSAGES/udata.mo')
    for pattern in patterns:
        info(pattern)
    lrun('rm -rf {0}'.format(' '.join(patterns)))
Пример #22
0
def qa():
    '''Run a quality report'''
    header('Performing static analysis')
    info('Python static analysis')
    flake8_results = lrun('flake8 udata', pty=True, warn=True)
    info('JavaScript static analysis')
    eslint_results = nrun('eslint js/ --ext .vue,.js', pty=True, warn=True)
    if flake8_results.failed or eslint_results.failed:
        exit(flake8_results.return_code or eslint_results.return_code)
    print(green('OK'))
Пример #23
0
def qa():
    '''Run a quality report'''
    header('Performing static analysis')
    info('Python static analysis')
    flake8_results = lrun('flake8 udata', warn=True)
    info('JavaScript static analysis')
    jshint_results = nrun('jshint js --extra-ext=.vue --extract=auto',
                          warn=True)
    if flake8_results.failed or jshint_results.failed:
        exit(flake8_results.return_code or jshint_results.return_code)
    print(green('OK'))
Пример #24
0
def update(ctx, migrate=False):
    '''Perform a development update'''
    msg = 'Update all dependencies'
    if migrate:
        msg += ' and migrate data'
    header(msg)
    info('Updating Python dependencies')
    lrun('pip install -r requirements/develop.pip')
    lrun('pip install -e .')
    info('Updating JavaScript dependencies')
    lrun('npm install')
    if migrate:
        info('Migrating database')
        lrun('udata db migrate')
Пример #25
0
def update(ctx, migrate=False):
    '''Perform a development update'''
    msg = 'Update all dependencies'
    if migrate:
        msg += ' and migrate data'
    header(msg)
    info('Updating Python dependencies')
    lrun('pip install -r requirements/develop.pip')
    lrun('pip install -e .')
    info('Updating JavaScript dependencies')
    lrun('npm install')
    if migrate:
        info('Migrating database')
        lrun('udata db migrate')
Пример #26
0
def widgets_watch(ctx):
    '''Build widgets on changes'''
    lrun('npm run widgets:watch', pty=True)
Пример #27
0
def widgets_build(ctx):
    '''Compile and minify widgets'''
    header('Building widgets')
    lrun('npm run widgets:build', pty=True)
Пример #28
0
def i18nc(ctx):
    '''Compile translations'''
    header('Compiling translations')
    lrun('python setup.py compile_catalog')
Пример #29
0
def serve():
    '''Run a development server'''
    lrun('python manage.py serve -d -r', pty=True)
Пример #30
0
def doc():
    '''Build the documentation'''
    header('Building documentation')
    lrun('cd doc && make html', pty=True)
Пример #31
0
def test():
    '''Run tests suite'''
    header('Run tests suite')
    lrun('nosetests --rednose --force-color udata', pty=True)
Пример #32
0
def oembed_watch(ctx):
    '''Build OEmbed assets on changes'''
    lrun('npm run oembed:watch', pty=True)
Пример #33
0
def dist():
    """Package for distribution"""
    header("Building a distribuable package")
    lrun("python setup.py bdist_wheel", pty=True)
Пример #34
0
def assets_watch():
    lrun("npm run assets:watch", pty=True)
Пример #35
0
def jstest(ctx, watch=False):
    '''Run Karma tests suite'''
    header('Run Karma/Mocha test suite')
    cmd = 'npm run -s test:{0}'.format('watch' if watch else 'unit')
    lrun(cmd)
Пример #36
0
def i18nc():
    """Compile translations"""
    header("Compiling translations")
    lrun("python setup.py compile_catalog")
Пример #37
0
def doc(ctx):
    '''Build the documentation'''
    header('Building documentation')
    lrun('mkdocs serve', pty=True)
Пример #38
0
def oembed_watch(ctx):
    '''Build OEmbed assets on changes'''
    lrun('npm run oembed:watch', pty=True)
Пример #39
0
def widgets_watch(ctx):
    '''Build widgets on changes'''
    lrun('npm run widgets:watch', pty=True)
Пример #40
0
def dist():
    '''Package for distribution'''
    header('Building a distribuable package')
    lrun('python setup.py bdist_wheel', pty=True)
Пример #41
0
def doc():
    """Build the documentation"""
    header("Building documentation")
    lrun("cd doc && make html", pty=True)
Пример #42
0
def cover():
    '''Run tests suite with coverage'''
    header('Run tests suite with coverage')
    lrun('nosetests --rednose --force-color \
        --with-coverage --cover-html --cover-package=udata', pty=True)
Пример #43
0
def assets_watch(ctx):
    '''Build assets on change'''
    lrun('npm run assets:watch', pty=True)
Пример #44
0
def serve(ctx):
    '''Run a development server'''
    lrun('python manage.py serve -d -r', pty=True)
Пример #45
0
def serve():
    """Run a development server"""
    lrun("python manage.py serve -d -r", pty=True)
Пример #46
0
def serve(ctx, host='localhost'):
    '''Run a development server'''
    lrun('python manage.py serve -d -r -h %s' % host)
Пример #47
0
def i18n(ctx, update=False):
    '''Extract translatable strings'''
    header('Extract translatable strings')

    info('Extract Python strings')
    lrun('python setup.py extract_messages')

    # Fix crowdin requiring Language with `2-digit` iso code in potfile
    # to produce 2-digit iso code pofile
    # Opening the catalog also allows to set extra metadata
    potfile = join(ROOT, 'udata', 'translations', '{}.pot'.format(I18N_DOMAIN))
    with open(potfile, 'rb') as infile:
        catalog = read_po(infile, 'en')
    catalog.copyright_holder = 'Open Data Team'
    catalog.msgid_bugs_address = '*****@*****.**'
    catalog.language_team = 'Open Data Team <*****@*****.**>'
    catalog.last_translator = 'Open Data Team <*****@*****.**>'
    catalog.revision_date = datetime.now(LOCALTZ)
    with open(potfile, 'wb') as outfile:
        write_po(outfile, catalog, width=80)

    if update:
        lrun('python setup.py update_catalog')

    info('Extract JavaScript strings')
    keys = set()
    catalog = {}
    catalog_filename = join(ROOT, 'js', 'locales',
                            '{}.en.json'.format(I18N_DOMAIN))
    if exists(catalog_filename):
        with codecs.open(catalog_filename, encoding='utf8') as f:
            catalog = json.load(f)

    globs = '*.js', '*.vue', '*.hbs'
    regexps = [
        re.compile(r'(?:|\.|\s|\{)_\(\s*(?:"|\')(.*?)(?:"|\')\s*(?:\)|,)'
                   ),  # JS _('trad')
        re.compile(r'v-i18n="(.*?)"'),  # Vue.js directive v-i18n="trad"
        re.compile(r'"\{\{\{?\s*\'(.*?)\'\s*\|\s*i18n\}\}\}?"'
                   ),  # Vue.js filter {{ 'trad'|i18n }}
        re.compile(r'{{_\s*"(.*?)"\s*}}'),  # Handlebars {{_ "trad" }}
        re.compile(r'{{_\s*\'(.*?)\'\s*}}'),  # Handlebars {{_ 'trad' }}
        re.compile(r'\:[a-z0-9_\-]+="\s*_\(\'(.*?)\'\)\s*"'
                   ),  # Vue.js binding :prop="_('trad')"
    ]

    for directory, _, _ in os.walk(join(ROOT, 'js')):
        glob_patterns = (iglob(join(directory, g)) for g in globs)
        for filename in itertools.chain(*glob_patterns):
            print('Extracting messages from {0}'.format(green(filename)))
            content = codecs.open(filename, encoding='utf8').read()
            for regexp in regexps:
                for match in regexp.finditer(content):
                    key = match.group(1)
                    key = key.replace('\\n', '\n')
                    keys.add(key)
                    if key not in catalog:
                        catalog[key] = key

    # Remove old/not found translations
    for key in catalog.keys():
        if key not in keys:
            del catalog[key]

    with codecs.open(catalog_filename, 'w', encoding='utf8') as f:
        json.dump(catalog,
                  f,
                  sort_keys=True,
                  indent=4,
                  ensure_ascii=False,
                  encoding='utf8',
                  separators=(',', ': '))
Пример #48
0
def assets_build(ctx):
    '''Install and compile assets'''
    header('Building static assets')
    lrun('npm run assets:build', pty=True)
Пример #49
0
def cover(ctx):
    '''Run tests suite with coverage'''
    header('Run tests suite with coverage')
    lrun('nosetests --rednose --force-color \
        --with-coverage --cover-html --cover-package=udata')
Пример #50
0
def assets_watch(ctx):
    '''Build assets on change'''
    lrun('npm run assets:watch', pty=True)
Пример #51
0
def doc(ctx):
    '''Build the documentation'''
    header('Building documentation')
    lrun('mkdocs serve', pty=True)
Пример #52
0
def dist():
    '''Package for distribution'''
    header('Building a distribuable package')
    lrun('python setup.py bdist_wheel', pty=True)
Пример #53
0
def widgets_watch(ctx):
    lrun('npm run widgets:watch', pty=True)
Пример #54
0
def doc():
    '''Build the documentation'''
    header('Building documentation')
    lrun('cd doc && make html', pty=True)
Пример #55
0
def oembed_build(ctx):
    '''Compile and minify OEmbed assets'''
    header('Building OEmbed assets')
    lrun('npm run oembed:build', pty=True)
Пример #56
0
def jstest(ctx, watch=False):
    '''Run Karma tests suite'''
    header('Run Karma/Mocha test suite')
    cmd = 'npm run -s test:{0}'.format('watch' if watch else 'unit')
    lrun(cmd)
Пример #57
0
def i18nc():
    '''Compile translations'''
    header('Compiling translations')
    lrun('python setup.py compile_catalog')
Пример #58
0
def widgets_watch():
    lrun("npm run widgets:watch", pty=True)
Пример #59
0
def assets_watch(ctx):
    lrun('npm run assets:watch', pty=True)