-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
37 lines (29 loc) · 857 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
27
28
29
30
31
32
33
34
35
36
import sys
import invoke
@invoke.task
def clean(context):
'''Clean doc and build artifacts
'''
context.run('rm -rf coverage.xml')
context.run('rm -rf htmlcov')
context.run('rm -rf doc/build')
context.run('rm -rf build')
context.run('rm -rf dist')
context.run('rm -rf *.egg-info')
context.run('rm -rf .coverage')
context.run('rm -rf .mypy_cache')
context.run('rm -rf .pytest_cache')
context.run('rm -rf .hypothesis')
context.run('rm -rf .ipynb_checkpoints')
@invoke.task
def test(context):
context.run(f'pytest -p no:warnings test')
@invoke.task(pre=(clean,))
def build(context):
'''Build packages
'''
# NOTE: must pip install build
context.run(f'{sys.executable} -m build')
@invoke.task(pre=(build,), post=(clean,))
def release(context):
context.run('twine upload dist/*')