Mercurial > code > home > repos > light9
annotate tasks.py @ 1907:ec6ec713c276
output escaping bug in homepage made spectrograms fail
Ignore-this: b27ede936127b02f4ed30e132d2bf0d
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sat, 01 Jun 2019 10:54:45 +0000 |
parents | 36849634d50b |
children | ddc9a5ef213a |
rev | line source |
---|---|
1864 | 1 from invoke import task |
2 import glob | |
3 | |
4 bin_sources = [ | |
5 'bin/ascoltami2', | |
6 'bin/captureDevice', | |
7 'bin/collector', | |
8 'bin/collector_loadtest.py', | |
9 'bin/effecteval', | |
10 'bin/effectsequencer', | |
11 'bin/homepageConfig', | |
12 'bin/inputdemo', | |
13 'bin/inputquneo', | |
14 'bin/keyboardcomposer', | |
15 'bin/listsongs', | |
16 'bin/musicPad', | |
17 'bin/musictime', | |
18 'bin/paintserver', | |
19 'bin/picamserve', | |
20 'bin/rdfdb', | |
21 'bin/run_local.py', | |
22 'bin/subcomposer', | |
23 'bin/subserver', | |
24 'bin/vidref', | |
25 'bin/vidrefsetup', | |
26 'bin/wavecurve', | |
27 ] | |
28 def pkg_sources(): | |
29 return glob.glob('light9/**/*.py', recursive=True) | |
30 | |
31 @task | |
32 def mypy(ctx): | |
1873
f001d689b3e2
more py3 and typing fixes
Drew Perttula <drewp@bigasterisk.com>
parents:
1864
diff
changeset
|
33 print('\n\n') |
1864 | 34 def run(sources): |
35 ss = ' '.join(sources) | |
1873
f001d689b3e2
more py3 and typing fixes
Drew Perttula <drewp@bigasterisk.com>
parents:
1864
diff
changeset
|
36 ctx.run(f'MYPYPATH=stubs:/my/proj/rdfdb env/bin/mypy --check-untyped-defs {ss}', |
1864 | 37 pty=True, warn=True) |
38 | |
39 sources = ' '.join(bin_sources + pkg_sources()) | |
40 ctx.run(f'env/bin/flake8 --ignore=E115,E123,E124,E126,E225,E231,E261,E262,E265,E301,E302,E303,E305,E306,E401,E402,E501,E701,E731,W291,W293,W391,W504 {sources}', warn=True) | |
41 | |
42 sources = ' '.join(pkg_sources()) | |
1891 | 43 run(['bin/collector']) |
1873
f001d689b3e2
more py3 and typing fixes
Drew Perttula <drewp@bigasterisk.com>
parents:
1864
diff
changeset
|
44 run(['bin/rdfdb']) |
f001d689b3e2
more py3 and typing fixes
Drew Perttula <drewp@bigasterisk.com>
parents:
1864
diff
changeset
|
45 run(['bin/keyboardcomposer']) |
f001d689b3e2
more py3 and typing fixes
Drew Perttula <drewp@bigasterisk.com>
parents:
1864
diff
changeset
|
46 #for src in bin_sources: |
f001d689b3e2
more py3 and typing fixes
Drew Perttula <drewp@bigasterisk.com>
parents:
1864
diff
changeset
|
47 # print(f"mypy {src}") |
f001d689b3e2
more py3 and typing fixes
Drew Perttula <drewp@bigasterisk.com>
parents:
1864
diff
changeset
|
48 # run([src])# + pkg_sources()) |
1864 | 49 @task |
50 def reformat(ctx): | |
1883 | 51 ctx.run("env/bin/yapf --verbose --parallel --in-place --style google light9/*.py light9/*/*.py `file --no-pad bin/* | grep 'Python script' | perl -lpe 's/:.*//'`") |
1864 | 52 |
53 @task | |
54 def test(ctx): | |
55 ctx.run('docker build -f Dockerfile.build -t light9_build:latest .') | |
56 ctx.run('docker run --rm -it -v `pwd`:/opt light9_build:latest' | |
57 ' nose2 -v light9.currentstategraphapi_test light9.graphfile_test', | |
58 pty=True) |