Skip to content
This repository has been archived by the owner on Oct 20, 2018. It is now read-only.

Commit

Permalink
Add tasks file for use with Invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
thebigmunch committed Feb 13, 2016
1 parent 3f3a865 commit 0cd883c
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# coding=utf-8

"""Useful task commands for development and maintenance."""

from invoke import run, task


@task
def build(clean):
"""Build sdist and bdist_wheel distributions."""

run('python setup.py sdist bdist_wheel')


@task(build)
def deploy():
"""Build and upload gmusicapi_wrapper distributions."""

upload()


@task
def upload():
"""Upload gmusicapi_wrapper distributions using twine."""

run('twine upload dist/*')


@task
def clean():
"""Clean the project directory of unwanted files and directories."""

run('rm -rf gmusicapi_wrapper.egg-info')
run('rm -rf .coverage')
run('rm -rf .tox')
run('rm -rf .cache')
run('rm -rf build/')
run('rm -rf dist/')
run('find . -name *.pyc -delete')
run('find . -name *.pyo -delete')
run('find . -name __pycache__ -delete -depth')
run('find . -name *~ -delete')


@task
def cover(verbose=False):
"""Shorter alias for coverage task."""

coverage(verbose)


@task
def coverage(verbose=False):
"""Run the gmusicapi_wrapper tests using pytest-cov for coverage."""

cov_cmd = 'py.test --cov ./gmusicapi_wrapper --cov ./tests ./gmusicapi_wrapper ./tests'

if verbose:
cov_cmd += ' -v'

run(cov_cmd)


@task
def test():
"""Run the gmusicapi_wrapper tests using pytest."""

run('py.test')


@task
def tox():
"""Run the gmusicapi_wrapper tests using tox."""

run('tox')

0 comments on commit 0cd883c

Please sign in to comment.