forked from marshmallow-code/marshmallow-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
65 lines (46 loc) · 1.24 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import sys
import webbrowser
from invoke import task
@task
def test(ctx):
import pytest
# make output verbose b/c not enough tests yet to be a problem,
# and it helps me avoid getting confused about what's being run
# while developing.
retcode = pytest.main(['-v'])
sys.exit(retcode)
@task
def build(ctx):
ctx.run('python setup.py sdist', echo=True)
ctx.run('python setup.py bdist_wheel', echo=True)
@task
def publish(ctx):
clean(ctx)
build(ctx)
ctx.run('twine upload dist/*', echo=True)
@task
def clean(ctx):
ctx.run("rm -rf build")
ctx.run("rm -rf dist")
ctx.run("rm -rf marshmallow_select.egg-info")
print("Cleaned up.")
# TODO(dmr, 2017-05-31): dry out readme & contrib
@task
def readme(ctx, browse=True):
ctx.run('rst2html.py README.rst > /tmp/README.html')
if browse:
webbrowser.open_new_tab('/tmp/README.html')
@task
def contrib(ctx, browse=True):
ctx.run('rst2html.py CONTRIBUTING.rst > /tmp/CONTRIBUTING.html')
if browse:
webbrowser.open_new_tab('/tmp/CONTRIBUTING.html')
#
# misc tasks
#
@task
def build_sdist(ctx):
ctx.run('python setup.py sdist', echo=True)
@task
def build_bdist(ctx):
ctx.run('python setup.py bdist_wheel', echo=True)