File: tasks.py

package info (click to toggle)
binaryornot 0.4.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 944 kB
  • sloc: python: 348; makefile: 146; perl: 1
file content (64 lines) | stat: -rw-r--r-- 1,183 bytes parent folder | download | duplicates (4)
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
from invoke import task, run


@task
def clean_docs():
    run("rm -rf docs/_build")
    run("rm -rf docs/binaryornot.rst")
    run("rm -rf docs/modules.rst")


@task('clean_docs')
def docs():
    run("sphinx-apidoc -o docs/ binaryornot/")
    run("sphinx-build docs docs/_build")
    run("open docs/_build/index.html")


@task
def flake8():
    run("flake8 binaryornot tests")


@task
def autopep8():
    run("autopep8 --in-place --aggressive -r binaryornot")
    run("autopep8 --in-place --aggressive -r tests")


@task
def test():
    run("python setup.py test")


@task
def coverage():
    run("coverage run --source binaryornot setup.py test")
    run("coverage report -m")
    run("coverage html")
    run("open htmlcov/index.html")


@task
def clean_build():
    run("rm -fr build/")
    run("rm -fr dist/")
    run("rm -fr *.egg-info")


@task
def clean_pyc():
    run("find . -name '*.pyc' -exec rm -f {} +")
    run("find . -name '*.pyo' -exec rm -f {} +")
    run("find . -name '*~' -exec rm -f {} +")


@task('clean_build', 'clean_pyc')
def sdist():
    run("python setup.py sdist")
    run("ls -l dist")


@task('sdist')
def release():
    run("python setup.py upload")