-
Notifications
You must be signed in to change notification settings - Fork 3
/
tasks.py
48 lines (36 loc) · 1.18 KB
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from invoke import run, task
from invoke.util import log
@task
def clean(ctx):
"""clean - remove build artifacts."""
run('rm -rf build/')
run('rm -rf dist/')
run('rm -rf mdpy.egg-info')
run('find . -name __pycache__ -delete')
run('find . -name *.pyc -delete')
run('find . -name *.pyo -delete')
run('find . -name *~ -delete')
log.info('cleaned up')
@task
def test(ctx):
"""test - run the test runner."""
run('py.test --flakes --cov-report html --cov mdpy tests/', pty=True)
run('open htmlcov/index.html')
@task
def lint(ctx):
"""lint - check style with flake8."""
run('flake8 mdpy tests')
@task(clean)
def publish(ctx):
"""publish - package and upload a release to the cheeseshop."""
run('python setup.py sdist upload', pty=True)
run('python setup.py bdist_wheel upload', pty=True)
log.info('published new release')
@task
def convert_notebooks(ctx):
"""Convert notebooks to HTML"""
run('''python ./scripts/convert_notebooks.py notebooks/*.ipynb --exclude='_*' --outdir=notebooks/html''')
log.info('Converted notebooks to HTML')