-
Notifications
You must be signed in to change notification settings - Fork 6
/
tasks.py
26 lines (22 loc) · 810 Bytes
/
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
from invoke import task
from pycon8 import __version__
from pkg_resources import parse_version
@task
def clean(ctx, cache=False, build=False, dist=False, docs=False, wipe=False):
if cache or wipe:
ctx.run('find . -type d -name "__pycache__" -exec rm -fr {} +')
if build or wipe:
ctx.run('rm -rf build/*')
if dist or wipe:
ctx.run('rm -rf dist/*')
if docs or wipe:
ctx.run('rm -rf docs/build/*')
@task
def build(ctx, bundle=False, docs=False):
if bundle:
version = str(parse_version(__version__))
ctx.run('pip wheel -r requirements/prod.txt --wheel-dir=deploy/files/tmp')
ctx.run(
'cd deploy/files/tmp && tar -cjvf ../pycon8-{}-bundle.tar.bz2 *'
.format(version))
ctx.run('rm -rf deploy/files/tmp')