Skip to content

Commit 369273e

Browse files
author
Alexander Rowe
committed
Added PyInvoke
1 parent 97d8d58 commit 369273e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tasks.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from invoke import task
2+
3+
@task
4+
def clean(c, docs=True, bytecode=True):
5+
patterns = ['build', 'dist', 'pymitter.egg-info']
6+
if docs:
7+
patterns.append('build/docs')
8+
if bytecode:
9+
patterns.append('**/*.pyc')
10+
for pattern in patterns:
11+
c.run("rm -rf {}".format(pattern))
12+
13+
@task
14+
def docs(c, host=False):
15+
c.run("sphinx-apidoc -o docs ./pyvent -f")
16+
c.run("sphinx-build docs build/docs")
17+
18+
if host:
19+
c.run("cd docs/_build && python3 -m http.server 8080")
20+
21+
@task
22+
def build(c):
23+
c.run("python setup.py bdist_wheel")

0 commit comments

Comments
 (0)