def bundle_javascript(context: Context): """ Copies javascript sources No compilation is necessary """ rsync_flags = '-avz' if context.verbosity == 2 else '-az' context.shell('rsync %s %s %s/' % (rsync_flags, context.app.javascript_source_path, context.app.asset_build_path))
def docs(context: Context): """ Generates static documentation """ try: from sphinx.application import Sphinx except ImportError: context.pip_command('install', 'Sphinx') from sphinx.application import Sphinx context.shell('cp', 'README.rst', 'docs/README.rst') app = Sphinx('docs', 'docs', 'docs/build', 'docs/build/.doctrees', buildername='html', parallel=True, verbosity=context.verbosity) app.build()
def test(context: Context, functional_tests=False): """ Tests the app """ environment = {'IGNORE_LOCAL_SETTINGS': 'True'} if functional_tests: environment.update({ 'RUN_FUNCTIONAL_TESTS': '1', 'OAUTHLIB_INSECURE_TRANSPORT': '1', }) return context.shell('nosetests', environment=environment)
def clean(context: Context, delete_dependencies: bool = False): """ Deletes build outputs """ paths = ['nosetests.xml'] context.shell('rm -rf %s' % paths_for_shell(paths)) context.shell('find %s -name "*.pyc" -or -name __pycache__ -delete' % context.app.django_app_name) if delete_dependencies: context.info('Cleaning app %s dependencies' % context.app.name) paths = ['venv'] context.shell('rm -rf %s' % paths_for_shell(paths))
def clean(context: Context, delete_dependencies: bool = False): """ Deletes build outputs """ paths = ['docs/build', 'build', 'dist', '.eggs'] + glob.glob('*.egg-info') context.shell('rm -rf %s' % paths_for_shell(paths)) context.shell('find %s -name "*.pyc" -or -name __pycache__ -delete' % context.app.django_app_name) if delete_dependencies: context.info('Cleaning local %s dependencies' % context.app.name) paths = ['venv'] context.shell('rm -rf %s' % paths_for_shell(paths))
def upload(context: Context): """ Builds and uploads MTP-common to pypi """ return context.shell(sys.executable, 'setup.py', 'sdist', 'bdist_wheel', 'upload')