| Total Complexity | 6 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from invoke import task |
||
| 2 | from bricknil.version import __version__ |
||
| 3 | |||
| 4 | @task |
||
| 5 | def pypi(c): |
||
| 6 | ver = __version__ |
||
| 7 | c.run('python setup.py bdist_wheel') |
||
| 8 | c.run(f'python -m twine upload dist/bricknil-{ver}-py3-none-any.whl') |
||
| 9 | c.run(f'git commit -am "Committing everything for release {ver}"') |
||
| 10 | c.run(f'git tag -a v{ver} -m "Tagging release {ver}"') |
||
| 11 | c.run(f'git push') |
||
| 12 | c.run(f'git push --tags') |
||
| 13 | |||
| 14 | @task |
||
| 15 | def tests(c): |
||
| 16 | test_dir = 'test' |
||
| 17 | #c.run('pytest test') |
||
| 18 | c.run('pytest test --cov-config .coveragerc --cov=bricknil --cov-report=term --cov-report=html') |
||
| 19 | c.run('coveralls') |
||
| 20 | |||
| 21 | |||
| 22 | @task |
||
| 23 | def docs(c): |
||
| 24 | githubpages = "/Users/virantha/dev/githubdocs/bricknil" |
||
| 25 | with c.cd(githubpages): |
||
| 26 | c.run('git checkout gh-pages') |
||
| 27 | c.run('git pull origin gh-pages') |
||
| 28 | #c.run("head CHANGES.rst > CHANGES_RECENT.rst") |
||
| 29 | #c.run("tail -n 1 CHANGES.rst >> CHANGES_RECENT.rst") |
||
| 30 | with c.cd("docs"): |
||
| 31 | print("Running sphinx in docs/ and building to ~/dev/githubdocs/bricknil") |
||
| 32 | c.run("make clean") |
||
| 33 | c.run('rm -rf _auto_summary') |
||
| 34 | c.run("make html BUILDDIR=%s" % githubpages) |
||
| 35 | #c.run("cp -R ../test/htmlcov %s/html/testing" % githubpages) |
||
| 36 | with c.cd(githubpages): |
||
| 37 | #c.run("mv html/* .") |
||
| 38 | c.run("git add .") |
||
| 39 | c.run('git commit -am "doc update"') |
||
| 40 | c.run('git push origin gh-pages') |
||
| 41 |