fixedcal/tasks.py
2024-05-01 15:19:17 +03:00

30 lines
736 B
Python

from invoke import task
@task
def build(ctx):
ctx.run("poetry build", pty=True)
@task
def publish(ctx, test_repository=True):
repository_flag = ""
if test_repository:
ctx.run("poetry config repositories.testpypi https://test.pypi.org/legacy/", pty=True)
repository_flag = "--repository testpypi"
ctx.run(f"poetry publish --build {repository_flag}", pty=True)
@task
def test(ctx):
ctx.run("pytest tests", pty=True)
@task
def coverage(ctx):
ctx.run("coverage run --branch -m pytest tests && coverage report && coverage html", pty=True)
@task
def lint(ctx):
ctx.run("pylint fixedcal", pty=True)
@task
def clean(ctx):
ctx.run("rm -rf .pytest_cache/ htmlcov/ .coverage dist/", pty=True)